Merge pull request #2805 from Shrews/fix_os_server_exc

Fix OpenStack module failure output
This commit is contained in:
Brian Coca 2016-01-18 20:46:22 -05:00
commit 0d1a154fac
24 changed files with 24 additions and 24 deletions

View file

@ -60,7 +60,7 @@ def main():
auth_token=cloud.auth_token, auth_token=cloud.auth_token,
service_catalog=cloud.service_catalog)) service_catalog=cloud.service_catalog))
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py # this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import * from ansible.module_utils.basic import *

View file

@ -176,7 +176,7 @@ def main():
module.exit_json(changed=True, floating_ip=f_ip) module.exit_json(changed=True, floating_ip=f_ip)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message, extra_data=e.extra_data) module.fail_json(msg=str(e), extra_data=e.extra_data)
# this is magic, see lib/ansible/module_common.py # this is magic, see lib/ansible/module_common.py

View file

@ -183,7 +183,7 @@ def main():
module.exit_json(changed=changed) module.exit_json(changed=changed)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message, extra_data=e.extra_data) module.fail_json(msg=str(e), extra_data=e.extra_data)
# this is magic, see lib/ansible/module_common.py # this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import * from ansible.module_utils.basic import *

View file

@ -148,7 +148,7 @@ def main():
openstack_image=image)) openstack_image=image))
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py # this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import * from ansible.module_utils.basic import *

View file

@ -338,7 +338,7 @@ def main():
module.exit_json(changed=False, result="Server not found") module.exit_json(changed=False, result="Server not found")
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py # this is magic, see lib/ansible/module_common.py

View file

@ -324,7 +324,7 @@ def main():
"maintenance, off") "maintenance, off")
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py # this is magic, see lib/ansible/module_common.py

View file

@ -162,7 +162,7 @@ def main():
module.exit_json(changed=False) module.exit_json(changed=False)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py # this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import * from ansible.module_utils.basic import *

View file

@ -159,7 +159,7 @@ def main():
module.exit_json(changed=True) module.exit_json(changed=True)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py # this is magic, see lib/ansible/module_common.py

View file

@ -132,7 +132,7 @@ def main():
openstack_networks=networks)) openstack_networks=networks))
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py # this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import * from ansible.module_utils.basic import *

View file

@ -232,7 +232,7 @@ def main():
module.exit_json(changed=False) module.exit_json(changed=False)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py # this is magic, see lib/ansible/module_common.py

View file

@ -117,7 +117,7 @@ def main():
module.exit_json(changed=changed) module.exit_json(changed=changed)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py # this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import * from ansible.module_utils.basic import *

View file

@ -383,7 +383,7 @@ def main():
module.exit_json(changed=changed) module.exit_json(changed=changed)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py # this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import * from ansible.module_utils.basic import *

View file

@ -352,7 +352,7 @@ def main():
module.exit_json(changed=True) module.exit_json(changed=True)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py # this is magic, see lib/ansible/module_common.py

View file

@ -134,7 +134,7 @@ def main():
module.exit_json(changed=changed) module.exit_json(changed=changed)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py # this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import * from ansible.module_utils.basic import *

View file

@ -317,7 +317,7 @@ def main():
module.exit_json(changed=changed) module.exit_json(changed=changed)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py # this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import * from ansible.module_utils.basic import *

View file

@ -606,7 +606,7 @@ def main():
_get_server_state(module, cloud) _get_server_state(module, cloud)
_delete_server(module, cloud) _delete_server(module, cloud)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message, extra_data=e.extra_data) module.fail_json(msg=str(e), extra_data=e.extra_data)
# this is magic, see lib/ansible/module_common.py # this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import * from ansible.module_utils.basic import *

View file

@ -204,7 +204,7 @@ def main():
module.exit_json(changed=True) module.exit_json(changed=True)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message, extra_data=e.extra_data) module.fail_json(msg=str(e), extra_data=e.extra_data)
# this is magic, see lib/ansible/module_common.py # this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import * from ansible.module_utils.basic import *

View file

@ -89,7 +89,7 @@ def main():
openstack_servers=openstack_servers)) openstack_servers=openstack_servers))
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py # this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import * from ansible.module_utils.basic import *

View file

@ -146,7 +146,7 @@ def main():
) )
except (shade.OpenStackCloudException, shade.OpenStackCloudTimeout) as e: except (shade.OpenStackCloudException, shade.OpenStackCloudTimeout) as e:
module.fail_json(msg=e.message) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_utils/common.py # this is magic, see lib/ansible/module_utils/common.py
from ansible.module_utils.basic import * from ansible.module_utils.basic import *

View file

@ -315,7 +315,7 @@ def main():
module.exit_json(changed=changed) module.exit_json(changed=changed)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py # this is magic, see lib/ansible/module_common.py

View file

@ -145,7 +145,7 @@ def main():
openstack_subnets=subnets)) openstack_subnets=subnets))
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py # this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import * from ansible.module_utils.basic import *

View file

@ -202,7 +202,7 @@ def main():
module.exit_json(changed=changed) module.exit_json(changed=changed)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message, extra_data=e.extra_data) module.fail_json(msg=str(e), extra_data=e.extra_data)
from ansible.module_utils.basic import * from ansible.module_utils.basic import *
from ansible.module_utils.openstack import * from ansible.module_utils.openstack import *

View file

@ -106,7 +106,7 @@ def main():
module.exit_json(changed=changed) module.exit_json(changed=changed)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message, extra_data=e.extra_data) module.fail_json(msg=str(e), extra_data=e.extra_data)
from ansible.module_utils.basic import * from ansible.module_utils.basic import *

View file

@ -153,7 +153,7 @@ def main():
if state == 'absent': if state == 'absent':
_absent_volume(module, cloud) _absent_volume(module, cloud)
except shade.OpenStackCloudException as e: except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message) module.fail_json(msg=str(e))
# this is magic, see lib/ansible/module_common.py # this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import * from ansible.module_utils.basic import *