mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-22 03:32:04 +00:00
Change var "all_nodes" to "response"
This commit is contained in:
parent
cee687b0ba
commit
2180c28ff8
@ -77,20 +77,20 @@ except Exception as e:
|
||||
#
|
||||
# Send a request to get all nodes, passing in user and password
|
||||
#
|
||||
all_nodes = requests.get(get_all_nodes + "?userName=" + username + "&userPW=" + password, verify=False)
|
||||
response = requests.get(get_all_nodes + "?userName=" + username + "&userPW=" + password, verify=False)
|
||||
|
||||
# Display returned data
|
||||
print "List of all nodes extracted with userid and password:"
|
||||
print all_nodes.content
|
||||
print response.content
|
||||
#
|
||||
# Send a request to get all nodes, passing in a token
|
||||
#
|
||||
user_data = {'userName': username,'userPW': password}
|
||||
token = requests.post(get_token, verify=False, headers={'Content-Type': 'application/json'}, data=json.dumps(user_data))
|
||||
all_nodes = requests.get(get_all_nodes, verify=False, headers={'X-Auth-Token': token.json()['token']['id']})
|
||||
response = requests.get(get_all_nodes, verify=False, headers={'X-Auth-Token': token.json()['token']['id']})
|
||||
|
||||
# Display returned data
|
||||
print "List of all nodes extracted with authentication token:"
|
||||
print all_nodes.content
|
||||
print response.content
|
||||
|
||||
sys.exit(0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user