diff --git a/utils/apparmor/rule/abi.py b/utils/apparmor/rule/abi.py index 52f6ad3e4..586db8428 100644 --- a/utils/apparmor/rule/abi.py +++ b/utils/apparmor/rule/abi.py @@ -50,7 +50,7 @@ class AbiRule(IncludeRule): return ('%s%s "%s",%s' % (space, self.rule_name, self.path, self.comment)) def _logprof_header_localvars(self): - return [_('Abi'), self.get_clean()] + return _('Abi'), self.get_clean() class AbiRuleset(IncludeRuleset): diff --git a/utils/apparmor/rule/alias.py b/utils/apparmor/rule/alias.py index 1de27c5b6..aca4c530a 100644 --- a/utils/apparmor/rule/alias.py +++ b/utils/apparmor/rule/alias.py @@ -92,11 +92,7 @@ class AliasRule(BaseRule): return True def _logprof_header_localvars(self): - headers = [] - - return headers + [ - _('Alias'), '%s -> %s' % (self.orig_path, self.target), - ] + return _('Alias'), '%s -> %s' % (self.orig_path, self.target) class AliasRuleset(BaseRuleset): diff --git a/utils/apparmor/rule/boolean.py b/utils/apparmor/rule/boolean.py index e5ef638e2..7d24ddda7 100644 --- a/utils/apparmor/rule/boolean.py +++ b/utils/apparmor/rule/boolean.py @@ -99,11 +99,7 @@ class BooleanRule(BaseRule): return True def _logprof_header_localvars(self): - headers = [] - - return headers + [ - _('Boolean Variable'), self.get_clean(), - ] + return _('Boolean Variable'), self.get_clean() class BooleanRuleset(BaseRuleset): diff --git a/utils/apparmor/rule/capability.py b/utils/apparmor/rule/capability.py index 817aaf408..1e6f1fc3a 100644 --- a/utils/apparmor/rule/capability.py +++ b/utils/apparmor/rule/capability.py @@ -125,9 +125,7 @@ class CapabilityRule(BaseRule): def _logprof_header_localvars(self): cap_txt = logprof_value_or_all(self.capability, self.all_caps) - return [ - _('Capability'), cap_txt, - ] + return _('Capability'), cap_txt class CapabilityRuleset(BaseRuleset): diff --git a/utils/apparmor/rule/dbus.py b/utils/apparmor/rule/dbus.py index 342861dc1..74c9cac4c 100644 --- a/utils/apparmor/rule/dbus.py +++ b/utils/apparmor/rule/dbus.py @@ -288,25 +288,25 @@ class DbusRule(BaseRule): return True def _logprof_header_localvars(self): - access = logprof_value_or_all(self.access, self.all_access) - bus = logprof_value_or_all(self.bus, self.all_buses) - path = logprof_value_or_all(self.path, self.all_paths) - name = logprof_value_or_all(self.name, self.all_names) - interface = logprof_value_or_all(self.interface, self.all_interfaces) - member = logprof_value_or_all(self.member, self.all_members) - peername = logprof_value_or_all(self.peername, self.all_peernames) - peerlabel = logprof_value_or_all(self.peerlabel, self.all_peerlabels) + access = logprof_value_or_all(self.access, self.all_access) # noqa: E221 + bus = logprof_value_or_all(self.bus, self.all_buses) # noqa: E221 + path = logprof_value_or_all(self.path, self.all_paths) # noqa: E221 + name = logprof_value_or_all(self.name, self.all_names) # noqa: E221 + interface = logprof_value_or_all(self.interface, self.all_interfaces) + member = logprof_value_or_all(self.member, self.all_members) # noqa: E221 + peername = logprof_value_or_all(self.peername, self.all_peernames) # noqa: E221 + peerlabel = logprof_value_or_all(self.peerlabel, self.all_peerlabels) - return [ - _('Access mode'), access, - _('Bus'), bus, - _('Path'), path, - _('Name'), name, - _('Interface'), interface, - _('Member'), member, - _('Peer name'), peername, - _('Peer label'), peerlabel, - ] + return ( + _('Access mode'), access, + _('Bus'), bus, + _('Path'), path, + _('Name'), name, + _('Interface'), interface, + _('Member'), member, + _('Peer name'), peername, + _('Peer label'), peerlabel, + ) class DbusRuleset(BaseRuleset): diff --git a/utils/apparmor/rule/include.py b/utils/apparmor/rule/include.py index ca10275d9..6ade58874 100644 --- a/utils/apparmor/rule/include.py +++ b/utils/apparmor/rule/include.py @@ -108,7 +108,7 @@ class IncludeRule(BaseRule): return True def _logprof_header_localvars(self): - return [_('Include'), self.get_clean()] + return _('Include'), self.get_clean() def get_full_paths(self, profile_dir): """get list of full paths of an include (can contain multiple paths if self.path is a directory)""" diff --git a/utils/apparmor/rule/network.py b/utils/apparmor/rule/network.py index 7f96280ca..abd0b9600 100644 --- a/utils/apparmor/rule/network.py +++ b/utils/apparmor/rule/network.py @@ -169,10 +169,10 @@ class NetworkRule(BaseRule): family = logprof_value_or_all(self.domain, self.all_domains) # noqa: E221 sock_type = logprof_value_or_all(self.type_or_protocol, self.all_type_or_protocols) - return [ + return ( _('Network Family'), family, _('Socket Type'), sock_type, - ] + ) class NetworkRuleset(BaseRuleset): diff --git a/utils/apparmor/rule/ptrace.py b/utils/apparmor/rule/ptrace.py index ec3d3a4d1..b7c5366f3 100644 --- a/utils/apparmor/rule/ptrace.py +++ b/utils/apparmor/rule/ptrace.py @@ -151,10 +151,10 @@ class PtraceRule(BaseRule): access = logprof_value_or_all(self.access, self.all_access) peer = logprof_value_or_all(self.peer, self.all_peers) # noqa: E221 - return [ + return ( _('Access mode'), access, _('Peer'), peer, - ] + ) class PtraceRuleset(BaseRuleset): diff --git a/utils/apparmor/rule/rlimit.py b/utils/apparmor/rule/rlimit.py index d4e9c72d8..8ba59cd92 100644 --- a/utils/apparmor/rule/rlimit.py +++ b/utils/apparmor/rule/rlimit.py @@ -220,17 +220,15 @@ class RlimitRule(BaseRule): return True def _logprof_header_localvars(self): - rlimit_txt = self.rlimit - if self.all_values: values_txt = 'infinity' else: values_txt = self.value - return [ - _('Rlimit'), rlimit_txt, + return ( + _('Rlimit'), self.rlimit, _('Value'), values_txt, - ] + ) class RlimitRuleset(BaseRuleset): diff --git a/utils/apparmor/rule/signal.py b/utils/apparmor/rule/signal.py index 96deeb77e..adc6bcccc 100644 --- a/utils/apparmor/rule/signal.py +++ b/utils/apparmor/rule/signal.py @@ -211,11 +211,11 @@ class SignalRule(BaseRule): signal = logprof_value_or_all(self.signal, self.all_signals) peer = logprof_value_or_all(self.peer, self.all_peers) # noqa: E221 - return [ + return ( _('Access mode'), access, _('Signal'), signal, - _('Peer'), peer - ] + _('Peer'), peer, + ) class SignalRuleset(BaseRuleset): diff --git a/utils/apparmor/rule/userns.py b/utils/apparmor/rule/userns.py index 4fd255385..34bb9ca6d 100644 --- a/utils/apparmor/rule/userns.py +++ b/utils/apparmor/rule/userns.py @@ -112,9 +112,7 @@ class UserNamespaceRule(BaseRule): def _logprof_header_localvars(self): access = logprof_value_or_all(self.access, self.all_access) - return ( - _('Access mode'), access, - ) + return _('Access mode'), access class UserNamespaceRuleset(BaseRuleset): diff --git a/utils/apparmor/rule/variable.py b/utils/apparmor/rule/variable.py index 7600fd20c..ca7f774bd 100644 --- a/utils/apparmor/rule/variable.py +++ b/utils/apparmor/rule/variable.py @@ -118,11 +118,7 @@ class VariableRule(BaseRule): return True def _logprof_header_localvars(self): - headers = [] - - return headers + [ - _('Variable'), self.get_clean(), - ] + return _('Variable'), self.get_clean() class VariableRuleset(BaseRuleset):