Accepting request 707832 from home:cboltz

- add upstream libapparmor-swig-4.diff: fix libapparmor tests with swig
  4.0 (boo#1135751)

OBS-URL: https://build.opensuse.org/request/show/707832
OBS-URL: https://build.opensuse.org/package/show/security:apparmor/apparmor?expand=0&rev=244
This commit is contained in:
Christian Boltz 2019-06-05 12:14:49 +00:00 committed by Git OBS Bridge
parent bdfa577764
commit 81e6e09dde
3 changed files with 41 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jun 5 11:36:25 UTC 2019 - Christian Boltz <suse-beta@cboltz.de>
- add upstream libapparmor-swig-4.diff: fix libapparmor tests with swig
4.0 (boo#1135751)
-------------------------------------------------------------------
Tue Apr 23 11:34:08 UTC 2019 - Martin Liška <mliska@suse.cz>

View File

@ -81,6 +81,9 @@ Patch12: dnsmasq-revert-alternation.diff
# fix usrmerge (and accidently also update-alternatives) test failures (boo#1127877, from upstream https://gitlab.com/apparmor/apparmor/merge_requests/331)
Patch13: usrmerge-fixes.diff
# fix libapparmor tests with swig 4.0 (from upstream https://gitlab.com/apparmor/apparmor/merge_requests/384)
Patch14: libapparmor-swig-4.diff
PreReq: sed
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define apparmor_bin_prefix /lib/apparmor
@ -374,6 +377,7 @@ SubDomain.
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%build
%define _lto_cflags %{nil}

31
libapparmor-swig-4.diff Normal file
View File

@ -0,0 +1,31 @@
commit a6ac6f4cfcc3d4fe1064087389004c3cc8b41207
Author: John Johansen <john.johansen@canonical.com>
Date: Tue Jun 4 13:16:43 2019 -0700
libapparmor python: Fix 'aa_log_record' object has no attribute '__getattr__'
When building with swig 4 we are seeing the error
AttributeError: 'aa_log_record' object has no attribute '__getattr__'
Which forces swig to use modern classes which do not generate __getattr__
methods.
issue: https://gitlab.com/apparmor/apparmor/issues/33
Acked-by: Seth Arnold <seth.arnold@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
Signed-off-by: John Johansen <john.johansen@canonical.com>
diff --git a/libraries/libapparmor/swig/python/test/test_python.py.in b/libraries/libapparmor/swig/python/test/test_python.py.in
index 54bd70a9..75c71415 100644
--- a/libraries/libapparmor/swig/python/test/test_python.py.in
+++ b/libraries/libapparmor/swig/python/test/test_python.py.in
@@ -109,7 +109,7 @@ class AAPythonBindingsTests(unittest.TestCase):
new_record = dict()
for key in [x for x in dir(record) if not (x.startswith('_') or x == 'this')]:
- value = record.__getattr__(key)
+ value = getattr(record, key)
if key == "event" and value in EVENT_MAP:
new_record[key] = EVENT_MAP[value]
elif key == "version":