Adding start and stop actions to os_server_actions

Also making the os_server module allow a server in the possible new
states from the os_server_actions changes
This commit is contained in:
Tony Kinsley
2015-08-23 11:51:28 -07:00
committed by Matt Clay
parent 9ed0a5a920
commit 79f98bffcf
2 changed files with 27 additions and 7 deletions

View File

@@ -368,7 +368,7 @@ def _get_server_state(module, cloud):
state = module.params['state']
server = cloud.get_server(module.params['name'])
if server and state == 'present':
if server.status != 'ACTIVE':
if server.status not in ('ACTIVE', 'SHUTOFF', 'PAUSED', 'SUSPENDED'):
module.fail_json(
msg="The instance is available but not Active state: "
+ server.status)