Пример #1
0
def stack_delete_status(stack_name, stack_id):
    tokenID = keystone_auth()
    headers = {"Content-Type": "application/json", "X-Auth-Token": tokenID}
    http = httplib2.Http()
    path = get_stack_show_url(stack_name, stack_id)
    response1, content1 = http.request(path, "GET", headers=headers)
    stack_status = json.loads(content1)["stack"]["stack_status"]
    return stack_status
Пример #2
0
def stack_show(stack_name, stack_id):
    tokenID = keystone_auth()
    headers = {"Content-Type": "application/json", "X-Auth-Token": tokenID}
    path1 = get_stack_show_url(stack_name, stack_id)
    http = httplib2.Http()
    response1, content1 = http.request(path1, headers=headers)
    while json.loads(content1)["stack"]["stack_status"] == "CREATE_IN_PROGRESS":
        time.sleep(2)
        response1, content1 = http.request(path1, headers=headers)
    stack_status = json.loads(content1)["stack"]["stack_status"]
    return stack_status
Пример #3
0
def stack_delete(stack_name, stack_id):
    try:
        tokenID = keystone_auth()
        headers = {"Content-Type": "application/json", "X-Auth-Token": tokenID}
        path = get_stack_show_url(stack_name, stack_id)
        http = httplib2.Http()
        response, content = http.request(path, "DELETE", headers=headers)
        response1, content1 = http.request(path, "GET", headers=headers)
    except ValueError:
        pass
    stack_status = json.loads(content1)["stack"]["stack_status"]
    return stack_status