@@ -45,28 +45,36 @@ def __print_pending_data(data, fields, info, filters=None):
45
45
46
46
def print_pending_updates (data , all_info , filters = None ):
47
47
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" )]
50
52
else :
51
- fields = [("Repository" , "repository" ), ("Name" , "package-name" )]
53
+ fields = [("Repository" , "repository" ),
54
+ ("Name" , "package-name" )]
52
55
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
+ )
54
60
info = Info (prefix , description )
55
61
56
62
__print_pending_data (data , fields , info , filters )
57
63
58
64
59
65
def print_pending_patches (data , all_info , filters = None ):
60
66
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" )]
65
73
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" ) ]
70
78
prefix = "zypper_patch_pending"
71
79
description = "zypper patch available from repository. (0 = not available , 1 = available)"
72
80
info = Info (prefix , description )
@@ -75,9 +83,8 @@ def print_pending_patches(data, all_info, filters=None):
75
83
76
84
77
85
def print_orphaned_packages (data , filters = None ):
78
- fields = [
79
- ("Name" , "package" ), ("Version" , "installed-version" )
80
- ]
86
+ fields = [("Name" , "package" ),
87
+ ("Version" , "installed-version" )]
81
88
prefix = "zypper_package_orphan"
82
89
description = "zypper packages with no update source (orphaned)"
83
90
info = Info (prefix , description )
@@ -87,9 +94,9 @@ def print_orphaned_packages(data, filters=None):
87
94
88
95
def print_data_sum (data , prefix , description , filters = None ):
89
96
gauge = Gauge (prefix ,
90
- description ,
91
- namespace = NAMESPACE ,
92
- registry = REGISTRY )
97
+ description ,
98
+ namespace = NAMESPACE ,
99
+ registry = REGISTRY )
93
100
filters = filters or {}
94
101
if len (data ) == 0 :
95
102
gauge .set (0 )
@@ -106,7 +113,10 @@ def print_reboot_required():
106
113
107
114
if is_path_ok :
108
115
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
+ )
110
120
info = Info (prefix , description )
111
121
result = subprocess .run (
112
122
[needs_restarting_path , '-r' ],
0 commit comments