cloudmesh / cloudmesh1

http://cloudmesh.org
Apache License 2.0
14 stars 12 forks source link

KeyError: 'private' in cluster command #208

Open lee212 opened 9 years ago

lee212 commented 9 years ago

"Update": Exception added to look up "int-net" name as well. This patch is waiting to be merged to the master.

OpenStack Nova API returns a "int-net" in the instance dict but the name is supposed to be a "private" based on the previous settings. The two places (263, 275 lines) in cm_shell_cluster.py use "private" name to get the value. This could be caused by a new release of OpenStack Juno or a change of network settings of "int-net".

assigning public ips...
Traceback (most recent call last):
  File "/home/ubuntu/ENV/bin/cm", line 9, in <module>
    load_entry_point('cmd3==1.7.0', 'console_scripts', 'cm')()
  File "/home/ubuntu/ENV/local/lib/python2.7/site-packages/cmd3/shell.py", line 493, in main
    cmd.cmdloop()
  File "/home/ubuntu/ENV/local/lib/python2.7/site-packages/cmd3/plugins/shell_core.py", line 145, in cmdloop
    stop = self.onecmd(line)
  File "/usr/lib/python2.7/cmd.py", line 221, in onecmd
    return func(arg)
  File "/home/ubuntu/ENV/local/lib/python2.7/site-packages/cmd3/shell.py", line 246, in new
    func(instance, args, arguments)
  File "/home/ubuntu/ENV/local/lib/python2.7/site-packages/cloudmesh-2.3.0-py2.7.egg/cloudmesh_cmd3/plugins/cm_shell_cluster.py", line 303, in do_cluster
    if not check_public_ip_existence(v):
  File "/home/ubuntu/ENV/local/lib/python2.7/site-packages/cloudmesh-2.3.0-py2.7.egg/cloudmesh_cmd3/plugins/cm_shell_cluster.py", line 263, in check_public_ip_existence
    temp = d['addresses']['private']
KeyError: 'private'

Error message 2:

'private'
Traceback (most recent call last):
  File "/home/ubuntu/ENV/local/lib/python2.7/site-packages/cmd3/shell.py", line 482, in main
    cmd.onecmd(user_cmd)
  File "/usr/lib/python2.7/cmd.py", line 221, in onecmd
    return func(arg)
  File "/home/ubuntu/ENV/local/lib/python2.7/site-packages/cmd3/shell.py", line 246, in new
    func(instance, args, arguments)
  File "/home/ubuntu/ENV/local/lib/python2.7/site-packages/cloudmesh-2.3.0-py2.7.egg/cloudmesh_cmd3/plugins/cm_shell_cluster.py", line 369, in do_cluster
    address_floating = get_ip(v)
  File "/home/ubuntu/ENV/local/lib/python2.7/site-packages/cloudmesh-2.3.0-py2.7.egg/cloudmesh_cmd3/plugins/cm_shell_cluster.py", line 275, in get_ip
    temp = d['addresses']['private']
KeyError: 'private'

Example of the value:

{u'cm_cloud_type': u'openstack', u'OS-EXT-STS:task_state': None, u'addresses': {u'int-net': [{u'OS-EXT-IPS-MAC:mac_addr': u'fa:16:3e:ea:82:eb', u'version': 4, u'addr': u'10.23.2.191', u'OS-EXT-IPS:type': u'fixed'}, {u'OS-EXT-IPS-MAC:mac_addr': u'fa:16:3e:ea:82:eb', u'version': 4, u'addr': u'149.165.158.90', u'OS-EXT-IPS:type': u'floating'}]},

Colin reported this issue.