On Sun, 26 Apr 2009 17:08:44 -0500, James Cammarata <jimi(a)sngx.net> wrote:
So this is a new issue. Got to images, and I'm seeing this
traceback in
cobblerd.log:
2009-04-26 17:07:33,355 - api - REMOTE calling authorize for resource
['modify_image', 'testing', None]; user(cobbler)
2009-04-26 17:07:33,356 - api - Exception occured:
exceptions.AttributeError
2009-04-26 17:07:33,356 - api - Exception value: 'str' object has no
attribute 'owners'
2009-04-26 17:07:33,357 - api - Exception Info:
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 1102,
in
check_access_no_fail
self.check_access(token,resource,arg1,arg2)
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 1115,
in
check_access
rc = self.__authorize(token,resource,arg1,arg2)
File "/usr/lib/python2.4/site-packages/cobbler/remote.py", line 1142,
in
__authorize
rc = self.api.authorize(user,resource,arg1,arg2)
File "/usr/lib/python2.4/site-packages/cobbler/api.py", line 729, in
authorize
rc =
self.authz.authorize(self,user,resource,arg1,arg2,acl_engine=self.acl_engine)
File
"/usr/lib/python2.4/site-packages/cobbler/modules/authz_ownership.py",
line
179, in authorize
if obj is None or obj.owners is None or obj.owners == []:
That would seem to be a bug, anyone else using ownership with images?
So I think I found the issue here. In remote.py, starting at line 1111:
need_remap = False
for x in [ "distro", "profile", "system",
"repo" ]:
if arg1 is not None and resource.find(x) != -1:
need_remap = True
break
if need_remap:
# we're called with an object name, but need an object
arg1 = self.__name_to_object(resource,arg1)
So images are not hitting this code, when I believe they should be. As a
result, arg1 is a string, which when passed up the chain is expected to be
a class with the "owners" property.
Was there any reason images were excluded from this? If not, I'll submit a
patch.
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.