All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Vermeulen <sven.vermeulen@siphos.be>
To: selinux@tycho.nsa.gov
Subject: [PATCH/RFC 2/2] Fix AttributeError: 'dict' object has no attribute 'attributes'
Date: Sat, 11 May 2013 20:57:11 +0200	[thread overview]
Message-ID: <20130511185711.GC933@siphos.be> (raw)
In-Reply-To: <20130511185446.GA933@siphos.be>

While running the tests, the test_export one fails as follows:

======================================================================
ERROR: test_export (test_interfaces.TestInterfaceSet)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/portage/portage/dev-python/sepolgen-1.1.9-r1/work/sepolgen-1.1.9-2.7/tests/test_interfaces.py", line 263, in test_export
    i.add_headers(h)
  File "../src/./sepolgen/interfaces.py", line 412, in add_headers
    self.add(i, attributes)
  File "../src/./sepolgen/interfaces.py", line 407, in add
    ifv = InterfaceVector(interface, attributes)
  File "../src/./sepolgen/interfaces.py", line 257, in __init__
    self.from_interface(interface, attributes)
  File "../src/./sepolgen/interfaces.py", line 279, in from_interface
    if not attributes.attributes.has_key(attr):
AttributeError: 'dict' object has no attribute 'attributes'

Not sure about the fix here, I'm guessing those we have an "attributes" too
many.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
---
 sepolgen/src/sepolgen/interfaces.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sepolgen/src/sepolgen/interfaces.py b/sepolgen/src/sepolgen/interfaces.py
index ae1c9c5..23d2d11 100644
--- a/sepolgen/src/sepolgen/interfaces.py
+++ b/sepolgen/src/sepolgen/interfaces.py
@@ -276,7 +276,7 @@ class InterfaceVector:
         if attributes != None:
             for typeattribute in interface.typeattributes():
                 for attr in typeattribute.attributes:
-                    if not attributes.attributes.has_key(attr):
+                    if not attributes.has_key(attr):
                         # print "missing attribute " + attr
                         continue
                     attr_vec = attributes.attributes[attr]
-- 
1.8.1.5


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

      parent reply	other threads:[~2013-05-13  3:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-11 18:54 [PATCH/RFC 0/2] Test failures when building sepolgen Sven Vermeulen
2013-05-11 18:56 ` [PATCH/RFC 1/2] Fix test that compares matchlist length Sven Vermeulen
2013-05-11 18:57 ` Sven Vermeulen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130511185711.GC933@siphos.be \
    --to=sven.vermeulen@siphos.be \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.