Skip to content

Instantly share code, notes, and snippets.

@RyanKor
Created October 10, 2021 15:45
Show Gist options
  • Save RyanKor/ec7034328ce0b4f867c6df9bdfb53429 to your computer and use it in GitHub Desktop.
Save RyanKor/ec7034328ce0b4f867c6df9bdfb53429 to your computer and use it in GitHub Desktop.
def __init__(self):
self.compute = None
self.identity = None
self.image = None
self.object_store = None
self.volume = None
self.network = None
self.session = None
self.auth_ref = None
self.auth_plugin_name = None
self.network_endpoint_enabled = True
self.compute_endpoint_enabled = True
self.volume_endpoint_enabled = True
self.configuration_type = "cloud_config"
def get_configuration(self):
config = {
'region': REGION_NAME,
'identity_api_version': VERSION,
}
if self.configuration_type == "cloud_config":
config["auth"] = {
'username': USERNAME,
'password': PASSWORD,
'token': AUTH_TOKEN,
}
elif self.configuration_type == "global_env":
config["username"] = USERNAME
config["password"] = PASSWORD
config["token"] = AUTH_TOKEN
return config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment