mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
commit fix
This commit is contained in:
parent
06530b5461
commit
be41a400fa
1 changed files with 25 additions and 10 deletions
|
@ -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…
Add table
Reference in a new issue