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:
Christian Boltz 2018-05-31 21:42:16 +02:00
parent 06eb65eb50
commit 5ae94391c5
Failed to generate hash of commit

View file

@ -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()):