mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-25 19:10:10 +00:00
changes done as per request
This commit is contained in:
parent
88c47c9254
commit
13d4c57ee2
@ -237,7 +237,7 @@ if __name__ == '__main__':
|
||||
allok = True
|
||||
uuidok = False
|
||||
macok = False
|
||||
valid_nodes = [node for node in sess.read('/nodes/')] #get all valiv nodes
|
||||
valid_nodes = [node['item']['href'][:-1] for node in c.read('/nodes/')] #get all valiv nodes
|
||||
for rsp in sess.read(f'/nodes/{args.node}/attributes/all'):
|
||||
if rsp.get('errorcode', None) == 404:
|
||||
emprint(f'There is no node named "{args.node}"')
|
||||
@ -262,9 +262,9 @@ if __name__ == '__main__':
|
||||
macok = True
|
||||
#adding new code to check if the response is something like net.<something>switch
|
||||
for key in rsp:
|
||||
if key.startswith('new.')and key.endswith('switch'):
|
||||
if key.startswith('net.')and key.endswith('switch'):
|
||||
switch_value = rsp[key].get('value',None)
|
||||
if switch_value == 'true':
|
||||
if switch_value in valid_nodes:
|
||||
if args.node in valid_nodes:
|
||||
print(f'{args.node} is a valid node.')
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user