git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
25acc56
)
fix bug in SliverStatus
author
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Thu, 16 Jun 2011 18:35:37 +0000
(14:35 -0400)
committer
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Thu, 16 Jun 2011 18:35:37 +0000
(14:35 -0400)
sfa/managers/slice_manager_pl.py
patch
|
blob
|
history
diff --git
a/sfa/managers/slice_manager_pl.py
b/sfa/managers/slice_manager_pl.py
index
1b98e6a
..
1077dcf
100644
(file)
--- a/
sfa/managers/slice_manager_pl.py
+++ b/
sfa/managers/slice_manager_pl.py
@@
-432,19
+432,13
@@
def SliverStatus(api, slice_xrn, creds, call_id):
# mmh, it is expected that all results carry the same urn
overall['geni_urn'] = results[0]['geni_urn']
# mmh, it is expected that all results carry the same urn
overall['geni_urn'] = results[0]['geni_urn']
-
- # consolidate geni_status - simple model using max on a total order
- states = [ 'ready', 'configuring', 'failed', 'unknown' ]
- # hash name to index
- shash = dict ( zip ( states, range(len(states)) ) )
- def combine_status (x,y):
- return shash [ max (shash(x),shash(y)) ]
- overall['geni_status'] = reduce (combine_status, [ result['geni_status'] for result in results], 'ready' )
-
- # {'ready':0,'configuring':1,'failed':2,'unknown':3}
+ overall['pl_login'] = results[0]['pl_login']
# append all geni_resources
overall['geni_resources'] = \
reduce (lambda x,y: x+y, [ result['geni_resources'] for result in results] , [])
# append all geni_resources
overall['geni_resources'] = \
reduce (lambda x,y: x+y, [ result['geni_resources'] for result in results] , [])
+ overall['status'] = 'unknown'
+ if overall['geni_resources']:
+ overall['status'] = 'ready'
return overall
return overall