commit fix

This commit is contained in:
anthony-shaw 2016-05-26 08:42:13 +10:00 committed by rallytime
parent cdceca6767
commit a4a7d09e44

View File

@ -55,16 +55,31 @@ def node_state(id_):
'''
Libcloud supported node states
'''
states = {0: 'RUNNING',
1: 'REBOOTING',
2: 'TERMINATED',
3: 'PENDING',
4: 'UNKNOWN',
5: 'STOPPED',
6: 'SUSPENDED',
7: 'ERROR',
8: 'PAUSED'}
return states[id_]
states_int = {
0: 'RUNNING',
1: 'REBOOTING',
2: 'TERMINATED',
3: 'PENDING',
4: 'UNKNOWN',
5: 'STOPPED',
6: 'SUSPENDED',
7: 'ERROR',
8: 'PAUSED'}
states_str = {
'running': 'RUNNING',
'rebooting': 'REBOOTING',
'starting': 'STARTING',
'terminated': 'TERMINATED',
'pending': 'PENDING',
'unknown': 'UNKNOWN',
'stopping': 'STOPPING',
'stopped': 'STOPPED',
'suspended': 'SUSPENDED',
'error': 'ERROR',
'paused': 'PAUSED',
'reconfiguring': 'RECONFIGURING'
}
return states_str[id_] if isinstance(id_, string_types) else states_int[id_]
def check_libcloud_version(reqver=LIBCLOUD_MINIMAL_VERSION, why=None):