+def get_stx_client_args():
+ client_args = dict(
+ auth_url=os.environ.get('OS_AUTH_URL', _DEFAULT_STX_URL),
+ username=os.environ.get('OS_USERNAME', "admin"),
+ api_key=os.environ.get('OS_PASSWORD', "fakepasswd1"),
+ project_name=os.environ.get('OS_PROJECT_NAME', "admin"),
+ )
+ if config.conf.OCLOUD.OS_AUTH_URL is not None and \
+ config.conf.OCLOUD.OS_AUTH_URL != '':
+ client_args['auth_url'] = config.conf.OCLOUD.OS_AUTH_URL
+ if config.conf.OCLOUD.OS_USERNAME is not None and \
+ config.conf.OCLOUD.OS_USERNAME != '':
+ client_args['username'] = config.conf.OCLOUD.OS_USERNAME
+ if config.conf.OCLOUD.OS_PASSWORD is not None and \
+ config.conf.OCLOUD.OS_PASSWORD != '':
+ client_args['api_key'] = config.conf.OCLOUD.OS_PASSWORD
+ if config.conf.OCLOUD.OS_PROJECT_NAME is not None and \
+ config.conf.OCLOUD.OS_PROJECT_NAME != '':
+ client_args['project_name'] = config.conf.OCLOUD.OS_PROJECT_NAME
+ return client_args
+
+
+def is_ipv6(address):
+ try:
+ # Try to convert the address and check the IP version
+ ip = ipaddress.ip_address(address)
+ return ip.version == 6
+ except ValueError:
+ return False
+
+