udica/0002-Syntax-changes-after-running-black.patch
Vit Mojzis 4a53696b71 udica-0.2.7-5
- Show diff when checking formatting
- Fix several lint findings
- Fix generating policy for Crio mounts

Fixes:
  https://github.com/containers/udica/issues/118
2023-04-20 17:25:50 +02:00

48 lines
1.5 KiB
Diff

From a2f0e4588e010e9df9da7bbd46fa4304335f9b25 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Sk=C3=B8tt?= <martin@skoett.name>
Date: Thu, 11 Aug 2022 20:29:18 +0200
Subject: [PATCH] Syntax changes after running black
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Martin Skøtt <martin@skoett.name>
---
udica/__main__.py | 2 +-
udica/policy.py | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/udica/__main__.py b/udica/__main__.py
index 9cb276d..84e0ba4 100644
--- a/udica/__main__.py
+++ b/udica/__main__.py
@@ -133,7 +133,7 @@ def get_args():
required=False,
default=None,
type=str,
- dest='DeviceAccess'
+ dest="DeviceAccess",
)
args = parser.parse_args()
return vars(args)
diff --git a/udica/policy.py b/udica/policy.py
index 0f1145a..9b7a14f 100644
--- a/udica/policy.py
+++ b/udica/policy.py
@@ -173,8 +173,10 @@ def create_policy(
# devices
# Not applicable for CRI-O container engine
if inspect_format != "CRI-0":
- if (not devices and opts["DeviceAccess"]):
- devices = [{"PathOnHost": device} for device in opts["DeviceAccess"].split(',')]
+ if not devices and opts["DeviceAccess"]:
+ devices = [
+ {"PathOnHost": device} for device in opts["DeviceAccess"].split(",")
+ ]
write_policy_for_podman_devices(devices, policy)
# mounts
--
2.37.3