[apparmor] [PATCH 3/8] utils: Add confdir env variable to aa.py for in-tree testing
Seth Arnold
seth.arnold at canonical.com
Thu Feb 9 00:00:05 UTC 2017
On Wed, Feb 08, 2017 at 10:01:40PM +0000, Tyler Hicks wrote:
> --- a/utils/apparmor/aa.py
> +++ b/utils/apparmor/aa.py
> @@ -73,7 +73,7 @@ _ = init_translation()
> # Setup logging incase of debugging is enabled
> debug_logger = DebugLogger('aa')
>
> -CONFDIR = '/etc/apparmor'
> +CONFDIR = os.getenv('APPARMOR_PY_CONFDIR', '/etc/apparmor')
>
> check: __libapparmor
> + export PYTHONPATH=$(PYTHONPATH) LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) LC_ALL=C APPARMOR_PY_CONFDIR=$(CONFDIR) ; $(foreach test, $(wildcard test-*.py), echo ; echo === $(test) === ; $(call pyalldo, $(test)))
>
Note that it's possible for the variable to be set, but not to a value;
os.getenv() won't return the fallback in this spot:
$ export SARS= ; python3 -c 'import os; print(os.getenv("SARNOLD", "NOT SET"))'
NOT SET
$ export SARS= ; python3 -c 'import os; print(os.getenv("SARS", "NOT SET"))'
$
Thanks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20170208/23a4e547/attachment.pgp>
More information about the AppArmor
mailing list