mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
inline set_ref_allow() into write_list_vars()
set_ref_allow() is only used by write_list_vars(). Inline it (actually only the used, boring if branch) to simplify the code.
This commit is contained in:
parent
06eb65eb50
commit
5ae94391c5
1 changed files with 2 additions and 7 deletions
|
@ -169,12 +169,6 @@ def set_allow_str(allow):
|
|||
else:
|
||||
raise AppArmorException(_("Invalid allow string: %(allow)s"))
|
||||
|
||||
def set_ref_allow(prof_data, allow):
|
||||
if allow:
|
||||
return prof_data[allow], set_allow_str(allow)
|
||||
else:
|
||||
return prof_data, ''
|
||||
|
||||
def write_list_vars(prof_data, depth):
|
||||
allow = ''
|
||||
name = 'lvar'
|
||||
|
@ -185,7 +179,8 @@ def write_list_vars(prof_data, depth):
|
|||
|
||||
pre = ' ' * depth
|
||||
data = []
|
||||
ref, allow = set_ref_allow(prof_data, allow)
|
||||
ref = prof_data
|
||||
allow = ''
|
||||
|
||||
if ref.get(name, False):
|
||||
for key in sorted(ref[name].keys()):
|
||||
|
|
Loading…
Add table
Reference in a new issue