def get_auth_token(node, tenant, user, password): cmd = ". /root/openrc; keystone --os-tenant-name {0}"\ " --os-username {1} --os-password {2} token-get".format(tenant, user, password) token_info, _ = ssh.call(["sh", "-c", cmd], stdout=ssh.PIPE, node=node) return env_util.parse_tenant_get(token_info, 'id')
def test_parse_tenant_get(): res = env_util.parse_tenant_get(TENANT_GET_SAMPLE, "id") assert res == "e26c8079d61f46c48f9a6d606631ee5e"
def test_parse_tenant_get(): res = env_util.parse_tenant_get(TENANT_GET_SAMPLE, 'id') assert res == 'e26c8079d61f46c48f9a6d606631ee5e'
def get_auth_token(node, tenant, user, password): cmd = ". /root/openrc; keystone --os-tenant-name {0}" " --os-username {1} --os-password {2} token-get".format( tenant, user, password ) token_info, _ = ssh.call(["sh", "-c", cmd], stdout=ssh.PIPE, node=node) return env_util.parse_tenant_get(token_info, "id")