Merge "Fix logical switch name update"

This commit is contained in:
Jenkins 2017-02-12 06:48:52 +00:00 committed by Gerrit Code Review
commit 5d16f53c3b
1 changed files with 3 additions and 2 deletions

View File

@ -213,8 +213,9 @@ class NsxLibLogicalSwitch(utils.NsxLibApiBase):
def _do_update():
resource = "logical-switches/%s" % lswitch_id
lswitch = self.get(lswitch_id)
if name is not None:
lswitch['display_name'] = name
# Assign name to a local variable since 'name' is out of scope
ls_name = name or lswitch.get('display_name')
lswitch['display_name'] = ls_name
if admin_state is not None:
if admin_state:
lswitch['admin_state'] = nsx_constants.ADMIN_STATE_UP