Merge "NSX-v3| Update router description on backend"
This commit is contained in:
commit
0a8428f279
@ -2537,7 +2537,9 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
|
|||||||
try:
|
try:
|
||||||
result = self._router_client.create(
|
result = self._router_client.create(
|
||||||
display_name=utils.get_name_and_uuid(
|
display_name=utils.get_name_and_uuid(
|
||||||
router['name'] or 'router', router['id']), tags=tags)
|
router['name'] or 'router', router['id']),
|
||||||
|
description=router.get('description'),
|
||||||
|
tags=tags)
|
||||||
except nsx_lib_exc.ManagerError:
|
except nsx_lib_exc.ManagerError:
|
||||||
with excutils.save_and_reraise_exception():
|
with excutils.save_and_reraise_exception():
|
||||||
LOG.error(_LE("Unable to create logical router for "
|
LOG.error(_LE("Unable to create logical router for "
|
||||||
@ -2553,7 +2555,7 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
|
|||||||
"router %s"), router['id'])
|
"router %s"), router['id'])
|
||||||
self.delete_router(context, router['id'])
|
self.delete_router(context, router['id'])
|
||||||
|
|
||||||
if gw_info != const.ATTR_NOT_SPECIFIED:
|
if gw_info and gw_info != const.ATTR_NOT_SPECIFIED:
|
||||||
try:
|
try:
|
||||||
self._update_router_gw_info(context, router['id'], gw_info)
|
self._update_router_gw_info(context, router['id'], gw_info)
|
||||||
except (db_exc.DBError, nsx_lib_exc.ManagerError):
|
except (db_exc.DBError, nsx_lib_exc.ManagerError):
|
||||||
@ -2688,6 +2690,13 @@ class NsxV3Plugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
|
|||||||
"Reason: %(e)s"),
|
"Reason: %(e)s"),
|
||||||
{'port_id': nsx_port_id,
|
{'port_id': nsx_port_id,
|
||||||
'e': e})
|
'e': e})
|
||||||
|
if 'description' in router_data:
|
||||||
|
nsx_router_id = nsx_db.get_nsx_router_id(context.session,
|
||||||
|
router_id)
|
||||||
|
self._router_client.update(
|
||||||
|
nsx_router_id,
|
||||||
|
description=router_data['description'])
|
||||||
|
|
||||||
return self._update_router_wrapper(context, router_id, router)
|
return self._update_router_wrapper(context, router_id, router)
|
||||||
except nsx_lib_exc.ResourceNotFound:
|
except nsx_lib_exc.ResourceNotFound:
|
||||||
with context.session.begin(subtransactions=True):
|
with context.session.begin(subtransactions=True):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user