utils: test: test-aa-notify: Ensure aanotify_bin is always a list

os.environ returns a string, but the default value is a list, and the concatenation of __AA_CONFDIR assumes a list.
Thus, if APPARMOR_NOTIFY and __AA_CONFDIR were both specified, this would error out.

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
This commit is contained in:
Ryan Lee 2025-01-22 11:52:38 -08:00
parent 1462e1c4b0
commit 3365e492a7

View file

@ -602,7 +602,7 @@ setup_aa(aa) # Wrapper for aa.init_aa()
setup_all_loops(__name__)
if __name__ == '__main__':
if 'APPARMOR_NOTIFY' in os.environ:
aanotify_bin = os.environ['APPARMOR_NOTIFY']
aanotify_bin = [os.environ['APPARMOR_NOTIFY']]
if '__AA_CONFDIR' in os.environ:
aanotify_bin = aanotify_bin + ['--configdir', os.getenv('__AA_CONFDIR')]