reword "except Error as e:" into "except Error, e:" to be compatible with Python 2.5 (#5852)

This commit is contained in:
Timur Batyrshin
2014-02-02 21:33:27 +04:00
committed by James Cammarata
parent 2d0e9cd75d
commit 658c15930e
27 changed files with 118 additions and 118 deletions

View File

@@ -128,7 +128,7 @@ def _get_ksclient(module, kwargs):
password=kwargs.get('login_password'),
tenant_name=kwargs.get('login_tenant_name'),
auth_url=kwargs.get('auth_url'))
except Exception as e:
except Exception, e:
module.fail_json(msg = "Error authenticating to the keystone: %s" %e.message)
global _os_keystone
_os_keystone = kclient
@@ -138,7 +138,7 @@ def _get_ksclient(module, kwargs):
def _get_endpoint(module, ksclient):
try:
endpoint = ksclient.service_catalog.url_for(service_type='network', endpoint_type='publicURL')
except Exception as e:
except Exception, e:
module.fail_json(msg = "Error getting network endpoint: %s " %e.message)
return endpoint
@@ -152,7 +152,7 @@ def _get_neutron_client(module, kwargs):
}
try:
neutron = client.Client('2.0', **kwargs)
except Exception as e:
except Exception, e:
module.fail_json(msg = " Error in connecting to neutron: %s " %e.message)
return neutron
@@ -178,7 +178,7 @@ def _get_net_id(neutron, module):
}
try:
networks = neutron.list_networks(**kwargs)
except Exception as e:
except Exception, e:
module.fail_json(msg = "Error in listing neutron networks: %s" % e.message)
if not networks['networks']:
return None
@@ -216,7 +216,7 @@ def _create_network(module, neutron):
try:
net = neutron.create_network({'network':network})
except Exception as e:
except Exception, e:
module.fail_json(msg = "Error in creating network: %s" % e.message)
return net['network']['id']
@@ -224,7 +224,7 @@ def _delete_network(module, net_id, neutron):
try:
id = neutron.delete_network(net_id)
except Exception as e:
except Exception, e:
module.fail_json(msg = "Error in deleting the network: %s" % e.message)
return True