def sahara(self, token_id):

        print "Establishing connection to Sahara..."

        sahara_url = "http://%s:8386/v1.1/%s" % (self.main_ip, self.project_id)
        sahara_client = saharaclient(sahara_url=sahara_url, input_auth_token=token_id)

        print "Success! Connected to Sahara!"
        return sahara_client
    def sahara(self, token_id):

        print 'Establishing connection to Sahara...'

        sahara_url = 'http://%s:8386/v1.1/%s' % (self.main_ip, self.project_id)
        sahara_client = saharaclient(sahara_url=sahara_url, input_auth_token=token_id)

        print 'Connected to Sahara'
        return sahara_client
Ejemplo n.º 3
0
    def sahara(self, token_id):

        print 'Establishing connection to Sahara...'

        sahara_url = 'http://%s:8386/v1.1/%s' % (self.main_ip, self.project_id)
        sahara_client = saharaclient(sahara_url=sahara_url,
                                     input_auth_token=token_id)

        print 'Success! Connected to Sahara!'
        return sahara_client
Ejemplo n.º 4
0
 def get_sahara_client(self, username, password, project_id, auth_ip,
                       domain):
     auth = v3.Password(auth_url=auth_ip + ':5000/v3',
                        username=username,
                        password=password,
                        project_id=project_id,
                        user_domain_name=domain)
     ses = session.Session(auth=auth)
     print auth_ip + ':5000/v3'
     print username
     print project_id
     return saharaclient('1.1', session=ses)
Ejemplo n.º 5
0
def get_sahara_cluster(name):
    sahara = saharaclient(auth_url=os.getenv("OS_AUTH_URL"),
                          username=os.getenv("OS_USERNAME"),
                          api_key=os.getenv("OS_PASSWORD"),
                          project_name=os.getenv("OS_TENANT_NAME"))

    cluster = None
    for cluster in sahara.clusters.list():
        if cluster.name.lower() == name.lower():
            cluster = cluster

    if cluster:
        return (sahara, cluster)
    else:
        raise Exception("No cluster found with name " + name)