opentelekomcloud / python-otcextensions

Extension of the OpenStackSDK && OpenStackClient with OpenTelekomCloud services
https://docs.otc-service.com/python-otcextensions
Apache License 2.0
24 stars 26 forks source link

[CCE] Invalid output for viewing non-existent cluster #152

Closed outcatcher closed 3 years ago

outcatcher commented 3 years ago

Versions

$ openstack --version
openstack 5.4.0
$ sudo pip show otcextensions
Name: otcextensions
Version: 0.13.0

Command used

openstack --os-cloud machine cce cluster show notexisting -v

Command output

START with options: --os-cloud machine cce cluster show notexisting -v
/usr/lib/python3.9/site-packages/barbicanclient/__init__.py:57: UserWarning: The secrets module is moved to barbicanclient/v1 directory, direct import of barbicanclient.secrets will be deprecated. Please import barbicanclient.v1.secrets instead.
  warnings.warn("The %s module is moved to barbicanclient/v1 "
/usr/lib/python3.9/site-packages/yaql/language/utils.py:54: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
  SequenceType = collections.Sequence
command: cce cluster show -> otcextensions.osclient.cce.v2.cluster.ShowCCECluster (auth=True)
Using auth plugin: password
'NoneType' object has no attribute 'id'
END return value: 1

Expected

Something like it is in the network service:

$ os --os-cloud machine network show notexisting -v
START with options: --os-cloud machine network show notexisting -v
/usr/lib/python3.9/site-packages/barbicanclient/__init__.py:57: UserWarning: The secrets module is moved to barbicanclient/v1 directory, direct import of barbicanclient.secrets will be deprecated. Please import barbicanclient.v1.secrets instead.
  warnings.warn("The %s module is moved to barbicanclient/v1 "
/usr/lib/python3.9/site-packages/yaql/language/utils.py:54: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
  SequenceType = collections.Sequence
command: network show -> openstackclient.network.v2.network.ShowNetwork (auth=True)
Using auth plugin: password
Error while executing command: No Network found for notexisting
END return value: 1

(not 'NoneType' object has no attribute 'id')

tischrei commented 3 years ago

I confirm this issue and try to fix it.