Skip to content

Instantly share code, notes, and snippets.

@anteaya
Last active December 11, 2015 06:28
Show Gist options
  • Save anteaya/d82a242b592fb8556055 to your computer and use it in GitHub Desktop.
Save anteaya/d82a242b592fb8556055 to your computer and use it in GitHub Desktop.
tracking process through novaclient find_resource in novaclient/utils.py
so looking at how find_resource deals with any object that calls it:
First it evaluates the second argument name_or_id to see if it is either an
int object or a string composed wholly of numbers:
try:
is_intid = isinstance(name_or_id, int) or name_or_id.isdigit()
except AttributeError:
is_intid = False
if is_intid:
try:
return manager.get(int(name_or_id))
except exceptions.NotFound:
pass
is_intid == False so on to the next bit of code.
Then find_resource trys to see if name_or_id is a uuid:
try:
uuid.UUID(str(name_or_id))
return manager.get(name_or_id)
except (ValueError, exceptions.NotFound):
pass
> /opt/stack/python-novaclient/novaclient/utils.py(192)find_resource()
-> uuid.UUID(str(name_or_id))
(Pdb) print uuid.UUID(str(name_or_id))
9e44f0ee-083d-40a4-804c-534d66fb15ac
(Pdb) print type(uuid.UUID(str(name_or_id)))
<class 'uuid.UUID'>
So it would appear that this round of going through find_resource() recognizes that
name_or_id is a uuid.
> /opt/stack/python-novaclient/novaclient/utils.py(192)find_resource()
-> uuid.UUID(str(name_or_id))
(Pdb) print uuid.UUID(str(name_or_id))
9e44f0ee-083d-40a4-804c-534d66fb15ac
(Pdb) print type(uuid.UUID(str(name_or_id)))
<class 'uuid.UUID'>
(Pdb) n
> /opt/stack/python-novaclient/novaclient/utils.py(193)find_resource()
-> return manager.get(name_or_id)
(Pdb) print manager.get(name_or_id)
*** NotFound: Instance could not be found (HTTP 404) (Request-ID: req-a5ce39af-6912-4906-a667-d89e3ab5f9e8)
It might be that if manager is images and name_or_id is not a uuid we need to throw an exception.
Maybe.
I am going to try importing novaclient/v1_1/images.py in the novaclient/utils.py file to see if I can get a comparision with ImageManager working.
based off of this line: from novaclient.v1_1 import shell as shell_v1_1
I think I will try something like: from novaclient.v1_1 import images
then hopefully I will have access to the ImageManager as a class to do a comparision.
That doesn't work, it puts it into an import loop and errors out.
Hmmm, how to compare find_resource(manager) with something to ensure it is an ImageManager instance.
I will try something like this: import novaclient.v1_1.images.ImageManager
Traceback (most recent call last):
File "/usr/local/bin/nova", line 9, in <module>
load_entry_point('python-novaclient==2.10.0.41.g4410339', 'console_scripts', 'nova')()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 337, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2279, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1989, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/opt/stack/python-novaclient/novaclient/shell.py", line 32, in <module>
from novaclient import client
File "/opt/stack/python-novaclient/novaclient/client.py", line 38, in <module>
from novaclient import utils
File "/opt/stack/python-novaclient/novaclient/utils.py", line 10, in <module>
from novaclient.v1_1.images import ImageManager
File "/opt/stack/python-novaclient/novaclient/v1_1/__init__.py", line 17, in <module>
from novaclient.v1_1.client import Client
File "/opt/stack/python-novaclient/novaclient/v1_1/client.py", line 1, in <module>
from novaclient import client
ImportError: cannot import name client
I also tried: from novaclient.v1_1.images import ImageManager
which results in the same ImportError
$ nova boot --flavor 1 --image 1111 some-server
> /opt/stack/python-novaclient/novaclient/utils.py(179)find_resource()
-> try:
(Pdb) print manager
<novaclient.v1_1.flavors.FlavorManager object at 0x16df4d0>
(Pdb) n
> /opt/stack/python-novaclient/novaclient/utils.py(180)find_resource()
-> is_intid = isinstance(name_or_id, int) or name_or_id.isdigit()
(Pdb) c
> /opt/stack/python-novaclient/novaclient/utils.py(179)find_resource()
-> try:
(Pdb) print manager
<novaclient.v1_1.images.ImageManager object at 0x16e32d0>
(Pdb) print type(manager)
<class 'novaclient.v1_1.images.ImageManager'>
(Pdb) print isinstance(manager, 'novaclient.v1_1.images.ImageManager')
*** TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types
(Pdb) print isinstance(manager, class 'novaclient.v1_1.images.ImageManager')
*** SyntaxError: invalid syntax (<stdin>, line 1)
(Pdb) print isinstance(manager, (class 'novaclient.v1_1.images.ImageManager'))
*** SyntaxError: invalid syntax (<stdin>, line 1)
(Pdb) print isinstance(manager, novaclient.v1_1.images.ImageManager)
*** NameError: name 'novaclient' is not defined
(Pdb) print isinstance(manager, ImageManager)
*** NameError: name 'ImageManager' is not defined
(Pdb) print manager
<novaclient.v1_1.images.ImageManager object at 0x16e32d0>
(Pdb) print manager.id
*** AttributeError: 'ImageManager' object has no attribute 'id'
(Pdb) print manager.self
*** AttributeError: 'ImageManager' object has no attribute 'self'
(Pdb) print manager.attributes
*** AttributeError: 'ImageManager' object has no attribute 'attributes'
(Pdb) print dir(manager)
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_create', '_delete', '_get', '_hooks_map', '_list', '_update', 'add_hook', 'api', 'completion_cache', 'delete', 'delete_meta', 'find', 'findall', 'get', 'list', 'resource_class', 'run_hooks', 'set_meta', 'write_to_completion_cache']
(Pdb) print manager.list
<bound method ImageManager.list of <novaclient.v1_1.images.ImageManager object at 0x16e32d0>>
(Pdb) print manager.__class__
<class 'novaclient.v1_1.images.ImageManager'>
(Pdb) print manager.__class__ == 'novaclient.v1_1.images.ImageManager'
False
(Pdb) print manager.__class__ == novaclient.v1_1.images.ImageManager
*** NameError: name 'novaclient' is not defined
(Pdb) print manager.__class__ == <class 'novaclient.v1_1.images.ImageManager'>
*** SyntaxError: invalid syntax (<stdin>, line 1)
(Pdb) print manager.__sizeof__
<built-in method __sizeof__ of ImageManager object at 0x16e32d0>
(Pdb) print type(manager) == ImageManager
*** NameError: name 'ImageManager' is not defined
(Pdb) print type(manager) == 'ImageManager'
False
(Pdb) print type(manager)
<class 'novaclient.v1_1.images.ImageManager'>
(Pdb) print type(manager) == <class 'novaclient.v1_1.images.ImageManager'>
*** SyntaxError: invalid syntax (<stdin>, line 1)
(Pdb)
> /opt/stack/python-novaclient/novaclient/utils.py(179)find_resource()
-> try:
(Pdb) print manager
<novaclient.v1_1.images.ImageManager object at 0x12cfe10>
(Pdb) print type(manager)
<class 'novaclient.v1_1.images.ImageManager'>
(Pdb) print isinstance(manager, class)
*** SyntaxError: invalid syntax (<stdin>, line 1)
(Pdb) print isinstance(manager, class('novaclient.v1_1.images.ImageManager'))
*** SyntaxError: invalid syntax (<stdin>, line 1)
(Pdb) print isinstance(manager, class 'novaclient.v1_1.images.ImageManager')
*** SyntaxError: invalid syntax (<stdin>, line 1)
(Pdb)
$ nova boot --flavor 1 --image 1111 some-server> /opt/stack/python-novaclient/novaclient/utils.py(179)find_resource()
-> try:
(Pdb) print manager
<novaclient.v1_1.flavors.FlavorManager object at 0x23e74d0>
(Pdb) print name_or_id
1
(Pdb) c
> /opt/stack/python-novaclient/novaclient/utils.py(179)find_resource()
-> try:
(Pdb) print manager
<novaclient.v1_1.images.ImageManager object at 0x23ea2d0>
(Pdb) print name_or_id
1111
(Pdb) s
> /opt/stack/python-novaclient/novaclient/utils.py(180)find_resource()
-> is_intid = isinstance(name_or_id, int) or name_or_id.isdigit()
(Pdb) s
> /opt/stack/python-novaclient/novaclient/utils.py(184)find_resource()
-> if is_intid:
(Pdb) s
> /opt/stack/python-novaclient/novaclient/utils.py(185)find_resource()
-> try:
(Pdb) print is_intid
True
(Pdb) s
> /opt/stack/python-novaclient/novaclient/utils.py(186)find_resource()
-> return manager.get(int(name_or_id))
(Pdb) print manager
<novaclient.v1_1.images.ImageManager object at 0x23ea2d0>
(Pdb) s
--Call--
> /opt/stack/python-novaclient/novaclient/v1_1/images.py(35)get()
-> def get(self, image):
(Pdb) s
> /opt/stack/python-novaclient/novaclient/v1_1/images.py(42)get()
-> if uuidutils.is_uuid_like(image):
(Pdb) s
--Call--
> /opt/stack/python-novaclient/novaclient/openstack/common/uuidutils.py(29)is_uuid_like()
-> def is_uuid_like(val):
(Pdb) print image
*** NameError: name 'image' is not defined
(Pdb) print val
1111
(Pdb) s
> /opt/stack/python-novaclient/novaclient/openstack/common/uuidutils.py(36)is_uuid_like()
-> try:
(Pdb) s
> /opt/stack/python-novaclient/novaclient/openstack/common/uuidutils.py(37)is_uuid_like()
-> return str(uuid.UUID(val)) == val
(Pdb) s
--Call--
> /usr/lib/python2.7/uuid.py(101)__init__()
-> def __init__(self, hex=None, bytes=None, bytes_le=None, fields=None,
(Pdb)
> /opt/stack/python-novaclient/novaclient/utils.py(180)find_resource()
-> is_intid = isinstance(name_or_id, int) or name_or_id.isdigit()
(Pdb) print manager
<novaclient.v1_1.images.ImageManager object at 0x2aaf2d0>
(Pdb) print name_or_id
11111111-1111-1111-1111-111111111111
(Pdb) s
> /opt/stack/python-novaclient/novaclient/utils.py(184)find_resource()
-> if is_intid:
(Pdb) s
> /opt/stack/python-novaclient/novaclient/utils.py(191)find_resource()
-> try:
(Pdb) print is_intid
False
(Pdb) s
> /opt/stack/python-novaclient/novaclient/utils.py(192)find_resource()
-> uuid.UUID(str(name_or_id))
(Pdb) s
--Call--
> /usr/lib/python2.7/uuid.py(101)__init__()
-> def __init__(self, hex=None, bytes=None, bytes_le=None, fields=None,
(Pdb) n
> /usr/lib/python2.7/uuid.py(128)__init__()
-> if [hex, bytes, bytes_le, fields, int].count(None) != 4:
(Pdb) n
> /usr/lib/python2.7/uuid.py(130)__init__()
-> if hex is not None:
(Pdb) n
> /usr/lib/python2.7/uuid.py(131)__init__()
-> hex = hex.replace('urn:', '').replace('uuid:', '')
(Pdb) n
> /usr/lib/python2.7/uuid.py(132)__init__()
-> hex = hex.strip('{}').replace('-', '')
(Pdb) n
> /usr/lib/python2.7/uuid.py(133)__init__()
-> if len(hex) != 32:
(Pdb) n
> /usr/lib/python2.7/uuid.py(135)__init__()
-> int = long(hex, 16)
(Pdb) n
> /usr/lib/python2.7/uuid.py(136)__init__()
-> if bytes_le is not None:
(Pdb) n
> /usr/lib/python2.7/uuid.py(142)__init__()
-> if bytes is not None:
(Pdb) n
> /usr/lib/python2.7/uuid.py(146)__init__()
-> if fields is not None:
(Pdb) n
> /usr/lib/python2.7/uuid.py(166)__init__()
-> if int is not None:
(Pdb) n
> /usr/lib/python2.7/uuid.py(167)__init__()
-> if not 0 <= int < 1<<128L:
(Pdb) n
> /usr/lib/python2.7/uuid.py(169)__init__()
-> if version is not None:
(Pdb) n
> /usr/lib/python2.7/uuid.py(178)__init__()
-> self.__dict__['int'] = int
(Pdb) n
--Return--
> /usr/lib/python2.7/uuid.py(178)__init__()->None
-> self.__dict__['int'] = int
(Pdb) n
> /opt/stack/python-novaclient/novaclient/utils.py(193)find_resource()
-> return manager.get(name_or_id)
(Pdb) print name_or_id
11111111-1111-1111-1111-111111111111
(Pdb) print type(name_or_id)
<type 'str'>
(Pdb) print manager
<novaclient.v1_1.images.ImageManager object at 0x2aaf2d0>
(Pdb) n
NotFound: NotFound()
> /opt/stack/python-novaclient/novaclient/utils.py(193)find_resource()
-> return manager.get(name_or_id)
(Pdb) n
> /opt/stack/python-novaclient/novaclient/utils.py(194)find_resource()
-> except (ValueError, exceptions.NotFound):
(Pdb) n
> /opt/stack/python-novaclient/novaclient/utils.py(195)find_resource()
-> pass
(Pdb) n
> /opt/stack/python-novaclient/novaclient/utils.py(198)find_resource()
-> if getattr(manager, 'is_alphanum_id_allowed', False):
(Pdb) n
> /opt/stack/python-novaclient/novaclient/utils.py(204)find_resource()
-> try:
(Pdb) n
> /opt/stack/python-novaclient/novaclient/utils.py(205)find_resource()
-> try:
(Pdb) n
> /opt/stack/python-novaclient/novaclient/utils.py(206)find_resource()
-> return manager.find(human_id=name_or_id)
(Pdb) n
NotFound: NotFound()
> /opt/stack/python-novaclient/novaclient/utils.py(206)find_resource()
-> return manager.find(human_id=name_or_id)
(Pdb) n
> /opt/stack/python-novaclient/novaclient/utils.py(207)find_resource()
-> except exceptions.NotFound:
(Pdb) n
> /opt/stack/python-novaclient/novaclient/utils.py(208)find_resource()
-> pass
(Pdb) n
> /opt/stack/python-novaclient/novaclient/utils.py(211)find_resource()
-> try:
(Pdb) n
> /opt/stack/python-novaclient/novaclient/utils.py(212)find_resource()
-> resource = getattr(manager, 'resource_class', None)
(Pdb) n
> /opt/stack/python-novaclient/novaclient/utils.py(213)find_resource()
-> name_attr = resource.NAME_ATTR if resource else 'name'
(Pdb) n
> /opt/stack/python-novaclient/novaclient/utils.py(214)find_resource()
-> kwargs = {name_attr: name_or_id}
(Pdb)
$ nova show 9e44f0ee-083d-40a4-804c-534d66fb15ac> /opt/stack/python-novaclient/novaclient/utils.py(179)find_resource()
-> try:
(Pdb) print self
*** NameError: name 'self' is not defined
(Pdb) s
> /opt/stack/python-novaclient/novaclient/utils.py(180)find_resource()
-> is_intid = isinstance(name_or_id, int) or name_or_id.isdigit()
(Pdb) print int
<type 'int'>
(Pdb) print name_or_id
9e44f0ee-083d-40a4-804c-534d66fb15ac
(Pdb) print isinstance(name_or_id, int)
False
(Pdb) print name_or_id.isdigit()
False
(Pdb) print is_intid
*** NameError: name 'is_intid' is not defined
(Pdb) s
> /opt/stack/python-novaclient/novaclient/utils.py(184)find_resource()
-> if is_intid:
(Pdb) print is_intid
False
(Pdb) l
179 try:
180 is_intid = isinstance(name_or_id, int) or name_or_id.isdigit()
181 except AttributeError:
182 is_intid = False
183
184 -> if is_intid:
185 try:
186 return manager.get(int(name_or_id))
187 except exceptions.NotFound:
188 pass
189
(Pdb) s
> /opt/stack/python-novaclient/novaclient/utils.py(191)find_resource()
-> try:
(Pdb) l
186 return manager.get(int(name_or_id))
187 except exceptions.NotFound:
188 pass
189
190 # now try to get entity as uuid
191 -> try:
192 uuid.UUID(str(name_or_id))
193 return manager.get(name_or_id)
194 except (ValueError, exceptions.NotFound):
195 pass
196
(Pdb) s
> /opt/stack/python-novaclient/novaclient/utils.py(192)find_resource()
-> uuid.UUID(str(name_or_id))
(Pdb) print name_or_id
9e44f0ee-083d-40a4-804c-534d66fb15ac
(Pdb) print str(name_or_id))
*** SyntaxError: invalid syntax (<stdin>, line 1)
(Pdb) print str(name_or_id)
9e44f0ee-083d-40a4-804c-534d66fb15ac
(Pdb) s
--Call--
> /usr/lib/python2.7/uuid.py(101)__init__()
-> def __init__(self, hex=None, bytes=None, bytes_le=None, fields=None,
(Pdb) print self
*** AttributeError: 'UUID' object has no attribute 'int'
(Pdb) print hex
9e44f0ee-083d-40a4-804c-534d66fb15ac
(Pdb) print bytes
None
(Pdb) print bytes_le
None
(Pdb) print fields
None
(Pdb) print __init__
*** NameError: name '__init__' is not defined
(Pdb) l
96
97 version the UUID version number (1 through 5, meaningful only
98 when the variant is RFC_4122)
99 """
100
101 -> def __init__(self, hex=None, bytes=None, bytes_le=None, fields=None,
102 int=None, version=None):
103 r"""Create a UUID from either a string of 32 hexadecimal digits,
104 a string of 16 bytes as the 'bytes' argument, a string of 16 bytes
105 in little-endian order as the 'bytes_le' argument, a tuple of six
106 integers (32-bit time_low, 16-bit time_mid, 16-bit time_hi_version,
(Pdb) s
> /usr/lib/python2.7/uuid.py(128)__init__()
-> if [hex, bytes, bytes_le, fields, int].count(None) != 4:
(Pdb) s
> /usr/lib/python2.7/uuid.py(130)__init__()
-> if hex is not None:
(Pdb) print hex
9e44f0ee-083d-40a4-804c-534d66fb15ac
(Pdb) s
> /usr/lib/python2.7/uuid.py(131)__init__()
-> hex = hex.replace('urn:', '').replace('uuid:', '')
(Pdb) print hex
9e44f0ee-083d-40a4-804c-534d66fb15ac
(Pdb) s
> /usr/lib/python2.7/uuid.py(132)__init__()
-> hex = hex.strip('{}').replace('-', '')
(Pdb) print hex
9e44f0ee-083d-40a4-804c-534d66fb15ac
(Pdb) s
> /usr/lib/python2.7/uuid.py(133)__init__()
-> if len(hex) != 32:
(Pdb) print hex
9e44f0ee083d40a4804c534d66fb15ac
(Pdb) s
> /usr/lib/python2.7/uuid.py(135)__init__()
-> int = long(hex, 16)
(Pdb) print int
None
(Pdb) s
> /usr/lib/python2.7/uuid.py(136)__init__()
-> if bytes_le is not None:
(Pdb) print int
210375986157554560812888724280555804076
(Pdb) print bytes_le
None
(Pdb) s
> /usr/lib/python2.7/uuid.py(142)__init__()
-> if bytes is not None:
(Pdb) print bytes
None
(Pdb) s
> /usr/lib/python2.7/uuid.py(146)__init__()
-> if fields is not None:
(Pdb) print fields
None
(Pdb) s
> /usr/lib/python2.7/uuid.py(166)__init__()
-> if int is not None:
(Pdb) print int
210375986157554560812888724280555804076
(Pdb) s
> /usr/lib/python2.7/uuid.py(167)__init__()
-> if not 0 <= int < 1<<128L:
(Pdb) print int
210375986157554560812888724280555804076
(Pdb) s
> /usr/lib/python2.7/uuid.py(169)__init__()
-> if version is not None:
(Pdb) print version
None
(Pdb) s
> /usr/lib/python2.7/uuid.py(178)__init__()
-> self.__dict__['int'] = int
(Pdb) print int
210375986157554560812888724280555804076
(Pdb) print self
*** AttributeError: 'UUID' object has no attribute 'int'
(Pdb) s
--Return--
> /usr/lib/python2.7/uuid.py(178)__init__()->None
-> self.__dict__['int'] = int
(Pdb) print self
9e44f0ee-083d-40a4-804c-534d66fb15ac
(Pdb) s
> /opt/stack/python-novaclient/novaclient/utils.py(193)find_resource()
-> return manager.get(name_or_id)
(Pdb) print name_or_id
9e44f0ee-083d-40a4-804c-534d66fb15ac
(Pdb) s
--Call--
> /opt/stack/python-novaclient/novaclient/v1_1/servers.py(288)get()
-> def get(self, server):
(Pdb) print self
<novaclient.v1_1.servers.ServerManager object at 0x29c0850>
(Pdb) print server
9e44f0ee-083d-40a4-804c-534d66fb15ac
(Pdb) s
> /opt/stack/python-novaclient/novaclient/v1_1/servers.py(295)get()
-> return self._get("/servers/%s" % base.getid(server), "server")
(Pdb) print self
<novaclient.v1_1.servers.ServerManager object at 0x29c0850>
(Pdb) print server
9e44f0ee-083d-40a4-804c-534d66fb15ac
(Pdb) s
--Call--
> /opt/stack/python-novaclient/novaclient/base.py(37)getid()
-> def getid(obj):
(Pdb) print self
*** NameError: name 'self' is not defined
(Pdb) print obj
9e44f0ee-083d-40a4-804c-534d66fb15ac
(Pdb) s
> /opt/stack/python-novaclient/novaclient/base.py(42)getid()
-> try:
(Pdb) s
> /opt/stack/python-novaclient/novaclient/base.py(43)getid()
-> return obj.id
(Pdb) print obj.id
*** AttributeError: 'str' object has no attribute 'id'
(Pdb) print obj
9e44f0ee-083d-40a4-804c-534d66fb15ac
(Pdb) print type(obj)
<type 'str'>
(Pdb) s
AttributeError: "'str' object has no attribute 'id'"
> /opt/stack/python-novaclient/novaclient/base.py(43)getid()
-> return obj.id
(Pdb) s
> /opt/stack/python-novaclient/novaclient/base.py(44)getid()
-> except AttributeError:
(Pdb) s
> /opt/stack/python-novaclient/novaclient/base.py(45)getid()
-> return obj
(Pdb) print obj
9e44f0ee-083d-40a4-804c-534d66fb15ac
(Pdb) s
--Return--
> /opt/stack/python-novaclient/novaclient/base.py(45)getid()->'9e44f0ee-083...-534d66fb15ac'
-> return obj
(Pdb) s
--Call--
> /opt/stack/python-novaclient/novaclient/base.py(139)_get()
-> def _get(self, url, response_key):
(Pdb) print self
<novaclient.v1_1.servers.ServerManager object at 0x29c0850>
(Pdb) print url
/servers/9e44f0ee-083d-40a4-804c-534d66fb15ac
(Pdb) print response_key
server
(Pdb) l
134 def write_to_completion_cache(self, cache_type, val):
135 cache = getattr(self, "_%s_cache" % cache_type, None)
136 if cache:
137 cache.write("%s\n" % val)
138
139 -> def _get(self, url, response_key):
140 _resp, body = self.api.client.get(url)
141 return self.resource_class(self, body[response_key], loaded=True)
142
143 def _create(self, url, body, response_key, return_raw=False, **kwargs):
144 self.run_hooks('modify_body_for_create', body, **kwargs)
(Pdb) s
> /opt/stack/python-novaclient/novaclient/base.py(140)_get()
-> _resp, body = self.api.client.get(url)
(Pdb) print self.api.client.get(url)
*** NotFound: Instance could not be found (HTTP 404) (Request-ID: req-e311b3c0-793d-40ad-ac3e-193d0c719e2b)
(Pdb) s
--Call--
> /opt/stack/python-novaclient/novaclient/client.py(231)get()
-> def get(self, url, **kwargs):
(Pdb) print _resp
*** NameError: name '_resp' is not defined
(Pdb) print body
*** NameError: name 'body' is not defined
(Pdb) print self
<novaclient.client.HTTPClient object at 0x29d6050>
(Pdb) print url
/servers/9e44f0ee-083d-40a4-804c-534d66fb15ac
(Pdb) print **kwargs
*** SyntaxError: invalid syntax (<stdin>, line 1)
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(232)get()
-> return self._cs_request(url, 'GET', **kwargs)
(Pdb) print self
<novaclient.client.HTTPClient object at 0x29d6050>
(Pdb) s
--Call--
> /opt/stack/python-novaclient/novaclient/client.py(206)_cs_request()
-> def _cs_request(self, url, method, **kwargs):
(Pdb) print self
<novaclient.client.HTTPClient object at 0x29d6050>
(Pdb) print url
/servers/9e44f0ee-083d-40a4-804c-534d66fb15ac
(Pdb) print method
GET
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(207)_cs_request()
-> if not self.management_url:
(Pdb) print self.management_url
http://50.56.25.223:8774/v2/b8ce19bf3c7c4d59acc8900b989b5413
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(213)_cs_request()
-> try:
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(214)_cs_request()
-> kwargs.setdefault('headers', {})['X-Auth-Token'] = self.auth_token
(Pdb) print self.auth_token
MIIKkgYJKoZIhvcNAQcCoIIKgzCCCn8CAQExCTAHBgUrDgMCGjCCCWsGCSqGSIb3DQEHAaCCCVwEgglYeyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAiMjAxMy0wMS0xN1QyMDoyOTowNi41NDM3ODUiLCAiZXhwaXJlcyI6ICIyMDEzLTAxLTE4VDIwOjI5OjA2WiIsICJpZCI6ICJwbGFjZWhvbGRlciIsICJ0ZW5hbnQiOiB7ImVuYWJsZWQiOiB0cnVlLCAiZGVzY3JpcHRpb24iOiBudWxsLCAibmFtZSI6ICJkZW1vIiwgImlkIjogImI4Y2UxOWJmM2M3YzRkNTlhY2M4OTAwYjk4OWI1NDEzIn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==
(Pdb) l
209
210 # Perform the request once. If we get a 401 back then it
211 # might be because the auth token expired, so try to
212 # re-authenticate and try again. If it still fails, bail.
213 try:
214 -> kwargs.setdefault('headers', {})['X-Auth-Token'] = self.auth_token
215 if self.projectid:
216 kwargs['headers']['X-Auth-Project-Id'] = self.projectid
217
218 resp, body = self._time_request(self.management_url + url, method,
219 **kwargs)
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(215)_cs_request()
-> if self.projectid:
(Pdb) print self.projectid
demo
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(216)_cs_request()
-> kwargs['headers']['X-Auth-Project-Id'] = self.projectid
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(218)_cs_request()
-> resp, body = self._time_request(self.management_url + url, method,
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(219)_cs_request()
-> **kwargs)
(Pdb) s
--Call--
> /opt/stack/python-novaclient/novaclient/client.py(199)_time_request()
-> def _time_request(self, url, method, **kwargs):
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(200)_time_request()
-> start_time = time.time()
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(201)_time_request()
-> resp, body = self.request(url, method, **kwargs)
(Pdb) s
--Call--
> /opt/stack/python-novaclient/novaclient/client.py(157)request()
-> def request(self, url, method, **kwargs):
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(158)request()
-> kwargs.setdefault('headers', kwargs.get('headers', {}))
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(159)request()
-> kwargs['headers']['User-Agent'] = self.USER_AGENT
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(160)request()
-> kwargs['headers']['Accept'] = 'application/json'
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(161)request()
-> if 'body' in kwargs:
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(166)request()
-> self.http_log_req((url, method,), kwargs)
(Pdb) s
--Call--
> /opt/stack/python-novaclient/novaclient/client.py(129)http_log_req()
-> def http_log_req(self, args, kwargs):
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(130)http_log_req()
-> if not self.http_log_debug:
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(131)http_log_req()
-> return
(Pdb) s
--Return--
> /opt/stack/python-novaclient/novaclient/client.py(131)http_log_req()->None
-> return
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(167)request()
-> resp = requests.request(
(Pdb) print requests.request
<function wrapped at 0x26525f0>
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(168)request()
-> method,
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(169)request()
-> url,
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(170)request()
-> verify=self.verify_cert,
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(171)request()
-> config=self.requests_config,
(Pdb) self.verify_cert
'/opt/stack/data/CA/int-ca/ca-chain.pem'
(Pdb) print self.requests_config
{'danger_mode': False}
(Pdb) s
> /opt/stack/python-novaclient/novaclient/client.py(172)request()
-> **kwargs)
(Pdb) s
--Call--
> /usr/local/lib/python2.7/dist-packages/requests/safe_mode.py(26)wrapped()
-> def wrapped(method, url, **kwargs):
(Pdb) print method
GET
(Pdb) print url
http://50.56.25.223:8774/v2/b8ce19bf3c7c4d59acc8900b989b5413/servers/9e44f0ee-083d-40a4-804c-534d66fb15ac
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/safe_mode.py(28)wrapped()
-> if (kwargs.get('config') and kwargs.get('config').get('safe_mode')) or (kwargs.get('session')
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/safe_mode.py(39)wrapped()
-> return function(method, url, **kwargs)
(Pdb) s
--Call--
> /usr/local/lib/python2.7/dist-packages/requests/api.py(18)request()
-> @catch_exceptions_if_in_safe_mode
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/api.py(44)request()
-> adhoc_session = False
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/api.py(45)request()
-> session = kwargs.pop('session', None)
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/api.py(46)request()
-> if session is None:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/api.py(47)request()
-> session = sessions.session()
(Pdb) s
--Call--
> /usr/local/lib/python2.7/dist-packages/requests/sessions.py(325)session()
-> def session(**kwargs):
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/sessions.py(328)session()
-> return Session(**kwargs)
(Pdb) s
--Call--
> /usr/local/lib/python2.7/dist-packages/requests/sessions.py(63)__init__()
-> def __init__(self,
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/sessions.py(76)__init__()
-> self.headers = from_key_val_list(headers or [])
(Pdb) s
--Call--
> /usr/local/lib/python2.7/dist-packages/requests/utils.py(117)from_key_val_list()
-> def from_key_val_list(value):
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/utils.py(131)from_key_val_list()
-> if value is None:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/utils.py(134)from_key_val_list()
-> if isinstance(value, (str, bytes, bool, int)):
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/utils.py(137)from_key_val_list()
-> return OrderedDict(value)
(Pdb) s
--Call--
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(29)__init__()
-> def __init__(self, *args, **kwds):
(Pdb) print self
OrderedDict()
(Pdb) print *args
*** SyntaxError: invalid syntax (<stdin>, line 1)
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(35)__init__()
-> if len(args) > 1:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(37)__init__()
-> try:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(38)__init__()
-> self.__root
(Pdb) s
AttributeError: "'OrderedDict' object has no attribute '_OrderedDict__root'"
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(38)__init__()
-> self.__root
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(39)__init__()
-> except AttributeError:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(40)__init__()
-> self.__root = root = [] # sentinel node
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(41)__init__()
-> root[:] = [root, root, None]
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(42)__init__()
-> self.__map = {}
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(43)__init__()
-> self.__update(*args, **kwds)
(Pdb) s
--Call--
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(143)update()
-> def update(*args, **kwds):
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(152)update()
-> if len(args) > 2:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(155)update()
-> elif not args:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(157)update()
-> self = args[0]
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(159)update()
-> other = ()
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(160)update()
-> if len(args) == 2:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(161)update()
-> other = args[1]
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(162)update()
-> if isinstance(other, dict):
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(165)update()
-> elif hasattr(other, 'keys'):
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(169)update()
-> for key, value in other:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(171)update()
-> for key, value in kwds.items():
(Pdb) s
--Return--
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(171)update()->None
-> for key, value in kwds.items():
(Pdb) s
--Return--
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(43)__init__()->None
-> self.__update(*args, **kwds)
(Pdb) s
--Return--
> /usr/local/lib/python2.7/dist-packages/requests/utils.py(137)from_key_val_list()->OrderedDict()
-> return OrderedDict(value)
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/sessions.py(77)__init__()
-> self.auth = auth
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/sessions.py(78)__init__()
-> self.timeout = timeout
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/sessions.py(79)__init__()
-> self.proxies = from_key_val_list(proxies or [])
(Pdb) s
--Call--
> /usr/local/lib/python2.7/dist-packages/requests/utils.py(117)from_key_val_list()
-> def from_key_val_list(value):
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/utils.py(131)from_key_val_list()
-> if value is None:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/utils.py(134)from_key_val_list()
-> if isinstance(value, (str, bytes, bool, int)):
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/utils.py(137)from_key_val_list()
-> return OrderedDict(value)
(Pdb) s
--Call--
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(29)__init__()
-> def __init__(self, *args, **kwds):
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(35)__init__()
-> if len(args) > 1:
(Pdb) l
30 '''Initialize an ordered dictionary. Signature is the same as for
31 regular dictionaries, but keyword arguments are not recommended
32 because their insertion order is arbitrary.
33
34 '''
35 -> if len(args) > 1:
36 raise TypeError('expected at most 1 arguments, got %d' % len(args))
37 try:
38 self.__root
39 except AttributeError:
40 self.__root = root = [] # sentinel node
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(37)__init__()
-> try:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(38)__init__()
-> self.__root
(Pdb) s
AttributeError: "'OrderedDict' object has no attribute '_OrderedDict__root'"
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(38)__init__()
-> self.__root
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(39)__init__()
-> except AttributeError:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(40)__init__()
-> self.__root = root = [] # sentinel node
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(41)__init__()
-> root[:] = [root, root, None]
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(42)__init__()
-> self.__map = {}
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(43)__init__()
-> self.__update(*args, **kwds)
(Pdb) s
--Call--
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(143)update()
-> def update(*args, **kwds):
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(152)update()
-> if len(args) > 2:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(155)update()
-> elif not args:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(157)update()
-> self = args[0]
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(159)update()
-> other = ()
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(160)update()
-> if len(args) == 2:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(161)update()
-> other = args[1]
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(162)update()
-> if isinstance(other, dict):
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(165)update()
-> elif hasattr(other, 'keys'):
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(169)update()
-> for key, value in other:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(171)update()
-> for key, value in kwds.items():
(Pdb) s
--Return--
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(171)update()->None
-> for key, value in kwds.items():
(Pdb) s
--Return--
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(43)__init__()->None
-> self.__update(*args, **kwds)
(Pdb) s
--Return--
> /usr/local/lib/python2.7/dist-packages/requests/utils.py(137)from_key_val_list()->OrderedDict()
-> return OrderedDict(value)
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/sessions.py(80)__init__()
-> self.hooks = from_key_val_list(hooks or {})
(Pdb) s
--Call--
> /usr/local/lib/python2.7/dist-packages/requests/utils.py(117)from_key_val_list()
-> def from_key_val_list(value):
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/utils.py(131)from_key_val_list()
-> if value is None:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/utils.py(134)from_key_val_list()
-> if isinstance(value, (str, bytes, bool, int)):
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/utils.py(137)from_key_val_list()
-> return OrderedDict(value)
(Pdb) s
--Call--
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(29)__init__()
-> def __init__(self, *args, **kwds):
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(35)__init__()
-> if len(args) > 1:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(37)__init__()
-> try:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(38)__init__()
-> self.__root
(Pdb) s
AttributeError: "'OrderedDict' object has no attribute '_OrderedDict__root'"
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(38)__init__()
-> self.__root
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(39)__init__()
-> except AttributeError:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(40)__init__()
-> self.__root = root = [] # sentinel node
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(41)__init__()
-> root[:] = [root, root, None]
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(42)__init__()
-> self.__map = {}
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(43)__init__()
-> self.__update(*args, **kwds)
(Pdb) s
--Call--
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(143)update()
-> def update(*args, **kwds):
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(152)update()
-> if len(args) > 2:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(155)update()
-> elif not args:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(157)update()
-> self = args[0]
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(159)update()
-> other = ()
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(160)update()
-> if len(args) == 2:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(161)update()
-> other = args[1]
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(162)update()
-> if isinstance(other, dict):
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(163)update()
-> for key in other:
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(171)update()
-> for key, value in kwds.items():
(Pdb) s
--Return--
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(171)update()->None
-> for key, value in kwds.items():
(Pdb) s
--Return--
> /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/packages/ordered_dict.py(43)__init__()->None
-> self.__update(*args, **kwds)
(Pdb) s
--Return--
> /usr/local/lib/python2.7/dist-packages/requests/utils.py(137)from_key_val_list()->OrderedDict()
-> return OrderedDict(value)
(Pdb) s
> /usr/local/lib/python2.7/dist-packages/requests/sessions.py(81)__init__()
-> self.params = from_key_val_list(params or [])
(Pdb) c
ERROR: No server with a name or ID of '9e44f0ee-083d-40a4-804c-534d66fb15ac' exists.
anita@iccha-gnome:/opt/stack/python-novaclient$
Again looking to address this bug: https://bugs.launchpad.net/python-novaclient/+bug/1080515
My verify uuid code is working in the tests for images.get() however it is breaking when
the shell tests run. It appears that the shell tests call find_resource() and it
doesn't appear that images.get() does.
find_resource() does appear to have some uuid verifying functionality in it however
I wonder if the order of the various pieces of code that are to be tried nullifies
the verification process of uuid.
bcwaldon seems to feel that the uuid verification process originally brought to light
with the use of images.get() would be better served in find_resource().
I need to see if I can drop down into the debugger somehow to take a look around.
I will take the import pdb and pdb.set_trace() out of images.py where it is now
and put them into novaclient/utils.py inside find_resource() and see what happens.
I can't get this to work, all that happens is the test hangs.
Hmmm, okay next I will try to create a novaclient client instance in the console and ask it
to get an image and see what happens.
Nope, creating a client in the console and invoking images.get() does not drop me into
the debugger.
Hey, how about the command line?
And I am in the debugger:
$ source ~/devstack/openrc
anita@iccha-gnome:/opt/stack/python-novaclient$ nova image-list
+--------------------------------------+---------------------------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+---------------------------------+--------+--------+
| 9e44f0ee-083d-40a4-804c-534d66fb15ac | cirros-0.3.0-x86_64-uec | ACTIVE | |
| 82b793ca-d68d-4536-b9a5-e880ded13cef | cirros-0.3.0-x86_64-uec-kernel | ACTIVE | |
| b49b3d23-d4b3-4731-ba96-eaf2e69daa12 | cirros-0.3.0-x86_64-uec-ramdisk | ACTIVE | |
+--------------------------------------+---------------------------------+--------+--------+
anita@iccha-gnome:/opt/stack/python-novaclient$ nova show 9e44f0ee-083d-40a4-804c-534d66fb15ac> /opt/stack/python-novaclient/novaclient/utils.py(179)find_resource()
-> try:
(Pdb)
Okay so that worked.
Now how do I get the fakes from test_shell.py to work?
Let's see one of the fakes and maybe I can feed it in from the command line.
Here is a fake command:
'boot --flavor 1 --image 11111111-1111-1111-1111-111111111111 some-server'
let's try that on the command line.
Output: boot_debugger_output_image_id_11111111-1111-1111-1111-111111111111.txt
Let's try:
'boot --flavor 1 --image 1111 some-server'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment