Skip to content

Conversation

flavio-fernandes
Copy link

@flavio-fernandes flavio-fernandes commented Jul 5, 2018

BUG: #996

Avoid exceptions in cases when IMS returns hardware or VSI instances
that have no 'hostname' and 'domain' attributes.

An example of such:

$ slcli vlan detail 1499927
An unexpected error has occured:
Traceback (most recent call last):
  File "/home/vagrant/.venv/local/lib/python2.7/site-packages/SoftLayer/CLI/core.py", line 176, in main
    cli.main(**kwargs)
  File "/home/vagrant/.venv/local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/vagrant/.venv/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/vagrant/.venv/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/vagrant/.venv/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/vagrant/.venv/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/vagrant/.venv/local/lib/python2.7/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args[1:], **kwargs)
  File "/home/vagrant/.venv/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/vagrant/.venv/local/lib/python2.7/site-packages/SoftLayer/CLI/vlan/detail.py", line 76, in cli
    hardware['domain'],
KeyError: 'domain'

Feel free to report this error as it is likely a bug:
    https://github.com/softlayer/softlayer-python/issues
The following snippet should be able to reproduce the error

Avoid exceptions in cases when IMS returns hardware or VSI instances
that have no 'hostname' and 'domain' attributes.

An example of such:

$ slcli vlan detail 1499927
An unexpected error has occured:
Traceback (most recent call last):
  File "/home/vagrant/.venv/local/lib/python2.7/site-packages/SoftLayer/CLI/core.py", line 176, in main
    cli.main(**kwargs)
  File "/home/vagrant/.venv/local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/vagrant/.venv/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/vagrant/.venv/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/vagrant/.venv/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/vagrant/.venv/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/vagrant/.venv/local/lib/python2.7/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args[1:], **kwargs)
  File "/home/vagrant/.venv/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/vagrant/.venv/local/lib/python2.7/site-packages/SoftLayer/CLI/vlan/detail.py", line 76, in cli
    hardware['domain'],
KeyError: 'domain'

Feel free to report this error as it is likely a bug:
    https://github.com/softlayer/softlayer-python/issues
The following snippet should be able to reproduce the error
@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 88.554% when pulling de7c255 on flavio-fernandes:vlan_detail_bug.merge into 6332ffe on softlayer:master.

@allmightyspiff allmightyspiff merged commit 70e4996 into softlayer:master Jul 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants