TypeError raised when trying to get domain properties in AccessInfo object
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
keystoneauth |
Fix Released
|
Low
|
Boris Bobrov |
Bug Description
Attempts to access domain_name or domain_id in https:/
To exercise this bug, add this test case (or similar access attempt to properties domain_id or domain_name) http://
Some log details, when trying to reproduce the steps above:
=======
FAIL: keystoneauth1.
tags: worker-3
-------
pythonlogging:'': {{{
Parsed 2015-07-
Got '2015' for 'year' with default None
Got '07' for 'monthdash' with default 1
Got 7 for 'month' with default 7
Got '22' for 'daydash' with default 1
Got 22 for 'day' with default 22
Got '21' for 'hour' with default None
Got '56' for 'minute' with default None
Got '30' for 'second' with default None
}}}
Traceback (most recent call last):=
FAIL: keystoneauth1.
tags: worker-3
-------
pythonlogging:'': {{{
Parsed 2015-07-
Got '2015' for 'year' with default None
Got '07' for 'monthdash' with default 1
Got 7 for 'month' with default 7
Got '22' for 'daydash' with default 1
Got 22 for 'day' with default 22
Got '21' for 'hour' with default None
Got '56' for 'minute' with default None
Got '30' for 'second' with default None
}}}
Traceback (most recent call last):
File "keystoneauth1/
print auth_ref.domain_ids
File "keystoneauth1/
return f(self)
File "keystoneauth1/
return self._domain['id']
TypeError: 'NoneType' object has no attribute '__getitem__'
Ran 207 tests in 0.723s (+0.278s)
FAILED (id=2, failures=1)
error: testr failed (1)
Changed in keystoneauth: | |
milestone: | none → 0.4.0 |
status: | Fix Committed → Fix Released |
We had a short discussion about this in IRC today. The issue is that since ``_domain`` is decorated as a ``missingproperty`` any KeyErrors will actually be returned as a None. There are other properties like ``domain_id`` and ``domain_name`` that don't check for a None before accessing the ``_domain`` as a dictionary.
I'm thinking these other properties should check for a None and raise a smarter error saying that a domain was not found.