Skip to content

Commit 65e2e6d

Browse files
committed
fix(zypper.py): fix linting problems
Signed-off-by: Wabri <[email protected]>
1 parent 8b2a2f2 commit 65e2e6d

File tree

1 file changed

+29
-19
lines changed

1 file changed

+29
-19
lines changed

zypper.py

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,28 +45,36 @@ def __print_pending_data(data, fields, info, filters=None):
4545

4646
def print_pending_updates(data, all_info, filters=None):
4747
if all_info:
48-
fields = [("Repository", "repository"), ("Name", "package-name"),
49-
("Available Version", "available-version")]
48+
fields = [("Repository", "repository"),
49+
("Name", "package-name"),
50+
("Available Version",
51+
"available-version")]
5052
else:
51-
fields = [("Repository", "repository"), ("Name", "package-name")]
53+
fields = [("Repository", "repository"),
54+
("Name", "package-name")]
5255
prefix = "zypper_update_pending"
53-
description = "zypper package update available from repository. (0 = not available, 1 = available)"
56+
description = (
57+
"zypper package update available from repository. "
58+
"(0 = not available, 1 = available)"
59+
)
5460
info = Info(prefix, description)
5561

5662
__print_pending_data(data, fields, info, filters)
5763

5864

5965
def print_pending_patches(data, all_info, filters=None):
6066
if all_info:
61-
fields = [
62-
("Repository", "repository"), ("Name", "patch-name"), ("Category", "category"),
63-
("Severity", "severity"), ("Interactive", "interactive"), ("Status", "status")
64-
]
67+
fields = [("Repository", "repository"),
68+
("Name", "patch-name"),
69+
("Category", "category"),
70+
("Severity", "severity"),
71+
("Interactive", "interactive"),
72+
("Status", "status")]
6573
else:
66-
fields = [
67-
("Repository", "repository"), ("Name", "patch-name"),
68-
("Interactive", "interactive"), ("Status", "status")
69-
]
74+
fields = [("Repository", "repository"),
75+
("Name", "patch-name"),
76+
("Interactive", "interactive"),
77+
("Status", "status")]
7078
prefix = "zypper_patch_pending"
7179
description = "zypper patch available from repository. (0 = not available , 1 = available)"
7280
info = Info(prefix, description)
@@ -75,9 +83,8 @@ def print_pending_patches(data, all_info, filters=None):
7583

7684

7785
def print_orphaned_packages(data, filters=None):
78-
fields = [
79-
("Name", "package"), ("Version", "installed-version")
80-
]
86+
fields = [("Name", "package"),
87+
("Version", "installed-version")]
8188
prefix = "zypper_package_orphan"
8289
description = "zypper packages with no update source (orphaned)"
8390
info = Info(prefix, description)
@@ -87,9 +94,9 @@ def print_orphaned_packages(data, filters=None):
8794

8895
def print_data_sum(data, prefix, description, filters=None):
8996
gauge = Gauge(prefix,
90-
description,
91-
namespace=NAMESPACE,
92-
registry=REGISTRY)
97+
description,
98+
namespace=NAMESPACE,
99+
registry=REGISTRY)
93100
filters = filters or {}
94101
if len(data) == 0:
95102
gauge.set(0)
@@ -106,7 +113,10 @@ def print_reboot_required():
106113

107114
if is_path_ok:
108115
prefix = "node_reboot_required"
109-
description = "Node require reboot to activate installed updates or patches. (0 = not needed, 1 = needed)"
116+
description = (
117+
"Node require reboot to activate installed updates or patches. "
118+
"(0 = not needed, 1 = needed)"
119+
)
110120
info = Info(prefix, description)
111121
result = subprocess.run(
112122
[needs_restarting_path, '-r'],

0 commit comments

Comments
 (0)