unable to get_one_cloud using argparse
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack SDK |
Fix Released
|
Undecided
|
Matthew Edmonds |
Bug Description
Unable to use make_sdk because of bug 1629319, I tried to create an openstacksdk connection using openstack.
>>> import argparse
>>> from openstack import connection
>>> sdk = connection.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
cloud_config = occ.get_
File "/usr/lib/
args = self._fix_
File "/usr/lib/
new_args[key] = self._fix_
File "/usr/lib/
new_args[key] = self._fix_
File "/usr/lib/
key = key.replace('-', '_')
AttributeError: 'NoneType' object has no attribute 'replace'
os-client-config version 1.21.1
openstacksdk version 0.9.5
argparse version 1.2.1
no longer affects: | os-client-config |
Changed in python-openstacksdk: | |
assignee: | nobody → Matthew Edmonds (edmondsw) |
I think this may actually be an openstacksdk bug. I was able to get os_client_ config. config. get_one_ cloud working like this:
cloud_config = os_client_ config. OpenStackConfig () ArgumentParser( ) register_ argparse_ arguments( parser, sys.argv[1:]) get_one_ cloud(argparse= options)
parser = argparse.
cloud_config.
options = parser.parse_args()
cloud = cloud_config.
whereas openstacksdk is just passing the ArgumentParser() instance without calling register_ argparse_ arguments or parse_args