Skip to content

Better json parsing in ordering #1107

@allmightyspiff

Description

@allmightyspiff
slcli --really order place --billing monthly --preset DSILVER_4110_96GB_1X960GB_SSD_SED_NORAID  BARE_METAL_SERVER DALLAS13 BANDWIDTH_1000_GB  OS_UBUNTU_18_04_LTS_BIONIC_BEAVER_64_BIT 1_GBPS_REDUNDANT_PUBLIC_PRIVATE_NETWORK_UPLINKS 1_IP_ADDRESS 1_IPV6_ADDRESS  REBOOT_KVM_OVER_IP UNLIMITED_SSL_VPN_USERS_1_PPTP_VPN_USER_PER_ACCOUNT NESSUS_VULNERABILITY_ASSESSMENT_REPORTING  --extras '{"hardware": [{"hostname": 'portspeed01', "domain": "cgallo.com"}]}' --complex-type SoftLayer_Container_Product_Order_Hardware_Server

Expected Behavior

Should tell me there is an error with the extras field

Actual Behavior

An unexpected error has occured:
Traceback (most recent call last):
  File "/Users/christopher/.virtualenvs/py3/lib/python3.7/site-packages/SoftLayer/CLI/core.py", line 182, in main
    cli.main(**kwargs)
  File "/Users/christopher/.virtualenvs/py3/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/christopher/.virtualenvs/py3/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/christopher/.virtualenvs/py3/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/christopher/.virtualenvs/py3/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/christopher/.virtualenvs/py3/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/christopher/.virtualenvs/py3/lib/python3.7/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/Users/christopher/.virtualenvs/py3/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/christopher/.virtualenvs/py3/lib/python3.7/site-packages/SoftLayer/CLI/order/place.py", line 79, in cli
    extras = json.loads(extras)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 28 (char 27)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions