mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
commit fix
This commit is contained in:
parent
cdceca6767
commit
a4a7d09e44
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user