Skip to content

Instantly share code, notes, and snippets.

@dizz
Last active October 15, 2015 20:42
Show Gist options
  • Save dizz/7e02b61ddd41d116d124 to your computer and use it in GitHub Desktop.
Save dizz/7e02b61ddd41d116d124 to your computer and use it in GitHub Desktop.
update of dns method
def get_dnsaas(token, **kwargs):
"""
Return a instance of the DNSaaS.
A new instance is deployed if don't exist one
:param token: The token
"""
if kwargs['tenant_name'] is not None:
tenant = kwargs['tenant_name']
else:
tenant = 'demo'
if kwargs['dns_endpont'] is not None:
endpoint = kwargs['dns_endpont']
dns_action = DNSaaSClientCore # TODO this needs to be the client as used in the DSS
return dns_action
else:
endpoint = services.get_service_endpoint('http://schemas.mobile-cloud-networking.eu/occi/sm#dnsaas',
token, **kwargs)
if endpoint is None:
print ("Error: Initiate the SM")
return None
else:
maas_address=None
maas_endpoint=None
dispose_maas=False
dns_action = dnsaasclient.DNSaaSClientAction(endpoint, tenant, token, maas_address, maas_endpoint, dispose_maas)
if dns_action.init_dns():
return dns_action
else:
return None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment