Don't call sdk.connect() again

openstack_cloud_from_module() returns a connection object.

Change-Id: Icda289b76b8b57857e6ace521c7984b70ba04392
This commit is contained in:
Rabi Mishra 2020-04-07 10:49:14 +05:30
parent 3ed3739f04
commit 0007e05c78
2 changed files with 2 additions and 4 deletions

View File

@ -105,8 +105,7 @@ def run_module():
**openstack_module_kwargs()
)
sdk, _ = openstack_cloud_from_module(module)
conn = sdk.connect()
_, conn = openstack_cloud_from_module(module)
session = conn.session
# if the user is working with this module in only check mode we do not

View File

@ -124,8 +124,7 @@ def main():
**openstack_module_kwargs()
)
sdk, _ = openstack_cloud_from_module(module)
conn = sdk.connect()
_, conn = openstack_cloud_from_module(module)
tripleo = TripleOCommon(session=conn.session)
if hasattr(tripleo, module.params["action"]):