Changeset 194
- Timestamp:
- 05/18/09 16:51:18 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/new_rack_pbsmon.py
r186 r194 66 66 sys.exit(-1) 67 67 68 p.new_data_structure() 69 68 70 # get the state of the nodes 69 71 attr = [ 'state', 'jobs', 'properties' ] … … 77 79 node_dict = {} 78 80 79 for nodename, node in nodes.items():81 for id in nodes: 80 82 81 83 # Skip login nodes in status display 82 84 # 83 if not nodename.find('login'): 84 continue 85 86 state = node['state'] 87 if string.find(state, ',') >= 0: # multiple states for a node? 88 state_list = string.split(state, ',') 89 if pbs.ND_down in state_list: 90 state = pbs.ND_down 91 else: 92 state = string.split(state, ',')[-1] 93 85 if not nodes[id].name.find('login'): 86 continue 87 88 if pbs.ND_down in nodes[id].state: 89 state = pbs.ND_down 90 else: 91 state = nodes[id].state[0] 94 92 95 93 state_char = PBS_STATES[state] 96 94 97 if node.is_free() and node.has_job(): # single job 95 # print 'TD: ', nodes[id].name, nodes[id].is_free() ,nodes[id].has_job() 96 97 if nodes[id].is_free() and nodes[id].has_job(): # single job 98 98 # print 'TD: %s' % nodename, node 99 99 state_char = PBS_STATES[pbs_ND_single] 100 100 101 101 # print 'TD: %s %s' % (nodename, state_char) 102 dummy = string.split(node name, '-')102 dummy = string.split(nodes[id].name, '-') 103 103 node_dict[dummy[1]] = state_char 104 104
Note: See TracChangeset
for help on using the changeset viewer.