LOG = logging.getLogger(__name__)
PLUM_DRIVER = 'neutron.plugins.plumgrid.drivers.plumlib.Plumlib'
-ERR_MESSAGE = _('PLUMgrid Director communication failed')
director_server_opts = [
cfg.StrOpt('director_server', default='localhost',
LOG.debug(_('PLUMgrid Library: create_network() called'))
self._plumlib.create_network(tenant_id, net_db)
- except Exception:
- LOG.error(ERR_MESSAGE)
- raise plum_excep.PLUMgridException(err_msg=ERR_MESSAGE)
+ except Exception as err_message:
+ raise plum_excep.PLUMgridException(err_msg=err_message)
# Return created network
return net_db
LOG.debug(_("PLUMgrid Library: update_network() called"))
self._plumlib.update_network(tenant_id, net_id)
- except Exception:
- LOG.error(ERR_MESSAGE)
- raise plum_excep.PLUMgridException(err_msg=ERR_MESSAGE)
+ except Exception as err_message:
+ raise plum_excep.PLUMgridException(err_msg=err_message)
# Return updated network
return net_db
LOG.debug(_("PLUMgrid Library: update_network() called"))
self._plumlib.delete_network(net_db, net_id)
- except Exception:
- LOG.error(ERR_MESSAGE)
- raise plum_excep.PLUMgridException(err_msg=ERR_MESSAGE)
+ except Exception as err_message:
+ raise plum_excep.PLUMgridException(err_msg=err_message)
def create_port(self, context, port):
"""Create Neutron port.
LOG.debug(_("PLUMgrid Library: create_port() called"))
self._plumlib.create_port(port_db, router_db)
- except Exception:
- LOG.error(ERR_MESSAGE)
- raise plum_excep.PLUMgridException(err_msg=ERR_MESSAGE)
+ except Exception as err_message:
+ raise plum_excep.PLUMgridException(err_msg=err_message)
# Plugin DB - Port Create and Return port
return self._port_viftype_binding(context, port_db)
LOG.debug(_("PLUMgrid Library: create_port() called"))
self._plumlib.update_port(port_db, router_db)
- except Exception:
- LOG.error(ERR_MESSAGE)
- raise plum_excep.PLUMgridException(err_msg=ERR_MESSAGE)
+ except Exception as err_message:
+ raise plum_excep.PLUMgridException(err_msg=err_message)
# Plugin DB - Port Update
return self._port_viftype_binding(context, port_db)
LOG.debug(_("PLUMgrid Library: delete_port() called"))
self._plumlib.delete_port(port_db, router_db)
- except Exception:
- LOG.error(ERR_MESSAGE)
- raise plum_excep.PLUMgridException(err_msg=ERR_MESSAGE)
+ except Exception as err_message:
+ raise plum_excep.PLUMgridException(err_msg=err_message)
def get_port(self, context, id, fields=None):
with context.session.begin(subtransactions=True):
try:
LOG.debug(_("PLUMgrid Library: create_subnet() called"))
self._plumlib.create_subnet(sub_db, net_db, ipnet)
- except Exception:
- LOG.error(ERR_MESSAGE)
- raise plum_excep.PLUMgridException(err_msg=ERR_MESSAGE)
+ except Exception as err_message:
+ raise plum_excep.PLUMgridException(err_msg=err_message)
return sub_db
try:
LOG.debug(_("PLUMgrid Library: delete_subnet() called"))
self._plumlib.delete_subnet(tenant_id, net_db, net_id)
- except Exception:
- LOG.error(ERR_MESSAGE)
- raise plum_excep.PLUMgridException(err_msg=ERR_MESSAGE)
+ except Exception as err_message:
+ raise plum_excep.PLUMgridException(err_msg=err_message)
def update_subnet(self, context, subnet_id, subnet):
"""Update subnet core Neutron API."""
LOG.debug(_("PLUMgrid Library: update_network() called"))
self._plumlib.update_subnet(org_sub_db, new_sub_db, ipnet)
- except Exception:
- LOG.error(ERR_MESSAGE)
- raise plum_excep.PLUMgridException(err_msg=ERR_MESSAGE)
+ except Exception as err_message:
+ raise plum_excep.PLUMgridException(err_msg=err_message)
return new_sub_db
# Add Router to VND
LOG.debug(_("PLUMgrid Library: create_router() called"))
self._plumlib.create_router(tenant_id, router_db)
- except Exception:
- LOG.error(ERR_MESSAGE)
- raise plum_excep.PLUMgridException(err_msg=ERR_MESSAGE)
+ except Exception as err_message:
+ raise plum_excep.PLUMgridException(err_msg=err_message)
# Return created router
return router_db
try:
LOG.debug(_("PLUMgrid Library: update_router() called"))
self._plumlib.update_router(router_db, router_id)
- except Exception:
- LOG.error(ERR_MESSAGE)
- raise plum_excep.PLUMgridException(err_msg=ERR_MESSAGE)
+ except Exception as err_message:
+ raise plum_excep.PLUMgridException(err_msg=err_message)
# Return updated router
return router_db
LOG.debug(_("PLUMgrid Library: delete_router() called"))
self._plumlib.delete_router(tenant_id, router_id)
- except Exception:
- LOG.error(ERR_MESSAGE)
- raise plum_excep.PLUMgridException(err_msg=ERR_MESSAGE)
+ except Exception as err_message:
+ raise plum_excep.PLUMgridException(err_msg=err_message)
def add_router_interface(self, context, router_id, interface_info):
self._plumlib.add_router_interface(tenant_id, router_id,
port_db, ipnet)
- except Exception:
- LOG.error(ERR_MESSAGE)
- raise plum_excep.PLUMgridException(err_msg=ERR_MESSAGE)
+ except Exception as err_message:
+ raise plum_excep.PLUMgridException(err_msg=err_message)
return int_router
self._plumlib.remove_router_interface(tenant_id,
net_id, router_id)
- except Exception:
- LOG.error(ERR_MESSAGE)
- raise plum_excep.PLUMgridException(err_msg=ERR_MESSAGE)
+ except Exception as err_message:
+ raise plum_excep.PLUMgridException(err_msg=err_message)
return del_int_router
LOG.debug(_("PLUMgrid Library: create_floatingip() called"))
self._plumlib.create_floatingip(net_db, floating_ip)
- except Exception:
- LOG.error(ERR_MESSAGE)
- raise plum_excep.PLUMgridException(err_msg=ERR_MESSAGE)
+ except Exception as err_message:
+ raise plum_excep.PLUMgridException(err_msg=err_message)
return floating_ip
LOG.debug(_("PLUMgrid Library: update_floatingip() called"))
self._plumlib.update_floatingip(net_db, floating_ip, id)
- except Exception:
- LOG.error(ERR_MESSAGE)
- raise plum_excep.PLUMgridException(err_msg=ERR_MESSAGE)
+ except Exception as err_message:
+ raise plum_excep.PLUMgridException(err_msg=err_message)
return floating_ip
LOG.debug(_("PLUMgrid Library: delete_floatingip() called"))
self._plumlib.delete_floatingip(net_db, floating_ip_org, id)
- except Exception:
- LOG.error(ERR_MESSAGE)
- raise plum_excep.PLUMgridException(err_msg=ERR_MESSAGE)
+ except Exception as err_message:
+ raise plum_excep.PLUMgridException(err_msg=err_message)
"""
Internal PLUMgrid Fuctions
"setting for network %s"), network_name)
except Exception:
err_message = _("Network Admin State Validation Falied: ")
- LOG.error(err_message)
raise plum_excep.PLUMgridException(err_msg=err_message)
return network