// for make install case:
apparmor-related python libs are installed in /usr/lib/python2.7/site-packages/apparmor and LibAppArmor
// and this error happens.
ubuntu 14.04]$ sudo aa-complain
Traceback (most recent call last):
File "/usr/sbin/aa-complain", line 17, in <module>
import apparmor.tools
ImportError: No module named apparmor.tools
// when I copied like this, there was no error
/usr/lib/python2.7/site-packages/apparmor => /usr/lib/python2.7/dist-packages/apparmor
/usr/lib/python2.7/site-packages/LibApparmor=> /usr/lib/python2.7/dist-packages/LibApparmor
// No error without arguments
]$ sudo aa-complain
usage: aa-complain [-h] [-d DIR] program [program ...]
aa-complain: error: too few arguments
// But error with argument
===============================================
]$ sudo aa-complain /etc/apparmor.d/bin.ping
Traceback (most recent call last):
File "/usr/sbin/aa-complain", line 30, in <module>
tool.cmd_complain()
File "/usr/lib/python2.7/dist-packages/apparmor/tools.py", line 171, in cmd_complain
apparmor.read_profiles()
File "/usr/lib/python2.7/dist-packages/apparmor/aa.py", line 2558, in read_profiles
read_profile(profile_dir + '/' + file, True)
File "/usr/lib/python2.7/dist-packages/apparmor/aa.py", line 2584, in read_profile
profile_data = parse_profile_data(data, file, 0)
File "/usr/lib/python2.7/dist-packages/apparmor/aa.py", line 2914, in parse_profile_data
load_include(include_name)
File "/usr/lib/python2.7/dist-packages/apparmor/aa.py", line 4170, in load_include
incdata = parse_profile_data(data, incfile, True)
File "/usr/lib/python2.7/dist-packages/apparmor/aa.py", line 3031, in parse_profile_data
raise AppArmorException(_('Syntax Error: Unknown line found in file: %s line: %s') % (file, lineno + 1))
==when I comment out these regular expressions handling routine, it seemed to work!! ==============
/usr/lib/python2.7/dist-packages/apparmor/aa.py
RE_PROFILE_VARIABLE = re.compile('^\s*(@\{?\w+\}?)\s*(\+?=)\s*(@*.+?)\s*,?\s*(#.*)?$')
// for make install case: python2. 7/site- packages/ apparmor and LibAppArmor
apparmor-related python libs are installed in /usr/lib/
// and this error happens. aa-complain" , line 17, in <module>
ubuntu 14.04]$ sudo aa-complain
Traceback (most recent call last):
File "/usr/sbin/
import apparmor.tools
ImportError: No module named apparmor.tools
// when I copied like this, there was no error python2. 7/site- packages/ apparmor => /usr/lib/ python2. 7/dist- packages/ apparmor python2. 7/site- packages/ LibApparmor= > /usr/lib/ python2. 7/dist- packages/ LibApparmor
/usr/lib/
/usr/lib/
// No error without arguments
]$ sudo aa-complain
usage: aa-complain [-h] [-d DIR] program [program ...]
aa-complain: error: too few arguments
// But error with argument ======= ======= ======= ======= ======= ===== d/bin.ping aa-complain" , line 30, in <module> cmd_complain( ) python2. 7/dist- packages/ apparmor/ tools.py" , line 171, in cmd_complain read_profiles( ) python2. 7/dist- packages/ apparmor/ aa.py", line 2558, in read_profiles profile( profile_ dir + '/' + file, True) python2. 7/dist- packages/ apparmor/ aa.py", line 2584, in read_profile data(data, file, 0) python2. 7/dist- packages/ apparmor/ aa.py", line 2914, in parse_profile_data include( include_ name) python2. 7/dist- packages/ apparmor/ aa.py", line 4170, in load_include data(data, incfile, True) python2. 7/dist- packages/ apparmor/ aa.py", line 3031, in parse_profile_data on(_('Syntax Error: Unknown line found in file: %s line: %s') % (file, lineno + 1))
=======
]$ sudo aa-complain /etc/apparmor.
Traceback (most recent call last):
File "/usr/sbin/
tool.
File "/usr/lib/
apparmor.
File "/usr/lib/
read_
File "/usr/lib/
profile_data = parse_profile_
File "/usr/lib/
load_
File "/usr/lib/
incdata = parse_profile_
File "/usr/lib/
raise AppArmorExcepti
==when I comment out these regular expressions handling routine, it seemed to work!! ============== python2. 7/dist- packages/ apparmor/ aa.py '^\s*(@ \{?\w+\ }?)\s*( \+?=)\s* (@*.+?) \s*,?\s* (#.*)?$ ')
/usr/lib/
RE_PROFILE_VARIABLE = re.compile(