mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
move write_alias to ProfileList
It's only needed in the preamble, which makes ProfileList the perfect place.
This commit is contained in:
parent
fc6bd72781
commit
8855c60f23
2 changed files with 13 additions and 13 deletions
|
@ -14,7 +14,7 @@
|
|||
|
||||
from apparmor.aare import AARE
|
||||
from apparmor.common import AppArmorBug, AppArmorException, type_is_str
|
||||
from apparmor.profile_storage import write_alias
|
||||
from apparmor.rule import quote_if_needed
|
||||
from apparmor.rule.abi import AbiRule, AbiRuleset
|
||||
from apparmor.rule.include import IncludeRule, IncludeRuleset
|
||||
|
||||
|
@ -175,3 +175,15 @@ class ProfileList:
|
|||
raise AppArmorBug('%s not listed in ProfileList files' % filename)
|
||||
|
||||
return self.files[filename]['profiles']
|
||||
|
||||
def write_alias(prof_data, depth):
|
||||
pre = ' ' * depth
|
||||
data = []
|
||||
|
||||
if prof_data['alias']:
|
||||
for key in sorted(prof_data['alias'].keys()):
|
||||
data.append('%salias %s -> %s,' % (pre, quote_if_needed(key), quote_if_needed(prof_data['alias'][key])))
|
||||
|
||||
data.append('')
|
||||
|
||||
return data
|
||||
|
|
|
@ -218,18 +218,6 @@ def write_list_vars(ref, depth):
|
|||
|
||||
return data
|
||||
|
||||
def write_alias(prof_data, depth):
|
||||
pre = ' ' * depth
|
||||
data = []
|
||||
|
||||
if prof_data['alias']:
|
||||
for key in sorted(prof_data['alias'].keys()):
|
||||
data.append('%salias %s -> %s,' % (pre, quote_if_needed(key), quote_if_needed(prof_data['alias'][key])))
|
||||
|
||||
data.append('')
|
||||
|
||||
return data
|
||||
|
||||
def write_includes(prof_data, depth):
|
||||
pre = ' ' * depth
|
||||
data = []
|
||||
|
|
Loading…
Add table
Reference in a new issue