Skip to content

Conversation

@acamacho82
Copy link
Contributor

@acamacho82 acamacho82 commented Apr 10, 2019

Fixes #1129

I found an annoying error when no price is found:

$ slcli subnet create --v6 public 32 11223344 --test

An unexpected error has occured:
Traceback (most recent call last):
  File "/home/acamacho/Workspace/interpreters/python27/local/lib/python2.7/site-packages/SoftLayer-5.6.4-py2.7.egg/SoftLayer/CLI/core.py", line 182, in main
    cli.main(**kwargs)
  File "/home/acamacho/Workspace/interpreters/python27/local/lib/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/acamacho/Workspace/interpreters/python27/local/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/acamacho/Workspace/interpreters/python27/local/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/acamacho/Workspace/interpreters/python27/local/lib/python2.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/acamacho/Workspace/interpreters/python27/local/lib/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/acamacho/Workspace/interpreters/python27/local/lib/python2.7/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/home/acamacho/Workspace/interpreters/python27/local/lib/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/acamacho/Workspace/interpreters/python27/local/lib/python2.7/site-packages/SoftLayer-5.6.4-py2.7.egg/SoftLayer/CLI/subnet/create.py", line 46, in cli
    result = mgr.add_subnet(network, quantity=quantity, vlan_id=vlan_id, version=version, test_order=test)
  File "/home/acamacho/Workspace/interpreters/python27/local/lib/python2.7/site-packages/SoftLayer-5.6.4-py2.7.egg/SoftLayer/managers/network.py", line 154, in add_subnet
    raise TypeError('Invalid combination specified for ordering a'
TypeError: Invalid combination specified for ordering a subnet.

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

So I removed the TypeError in NetworkManager.add_subnet() and improved the error message which comes from the api

$ slcli subnet create --v6 public 32 11223344 --test

There is no price id for 32 public ipv6

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 91.967% when pulling 6d5b3f4 on acamacho82:issues1129 into cfab07e on softlayer:master.

@allmightyspiff allmightyspiff merged commit 9d6bf59 into softlayer:master Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to request new subnet: cli() got an unexpected keyword argument 'v6'

3 participants