Upgrade OSC security groups code

The openstack client new version added functionality that the
vmware_nsx code should also add.

Change-Id: Iac22f2204c5215f5d20dc9accdae2a5e75779de5
This commit is contained in:
Adit Sarfaty 2018-07-29 08:52:29 +03:00
parent e8e72a9e19
commit 4759889b5f
4 changed files with 9 additions and 3 deletions

View File

@ -113,7 +113,7 @@ python-keystoneclient==3.8.0
python-mimeparse==1.6.0
python-neutronclient==6.7.0
python-novaclient==9.1.0
python-openstackclient==3.12.0
python-openstackclient==3.16.0
python-subunit==1.0.0
pytz==2013.6
PyMySQL==0.7.6

View File

@ -12,7 +12,7 @@ six>=1.10.0 # MIT
stevedore>=1.20.0 # Apache-2.0
neutron-lib>=1.16.0 # Apache-2.0
osc-lib>=1.8.0 # Apache-2.0
python-openstackclient>=3.12.0 # Apache-2.0
python-openstackclient>=3.16.0 # Apache-2.0
oslo.concurrency>=3.26.0 # Apache-2.0
oslo.context>=2.19.2 # Apache-2.0
oslo.config>=5.2.0 # Apache-2.0

View File

@ -22,5 +22,5 @@ WebTest>=2.0.27 # MIT
bandit>=1.1.0 # Apache-2.0
tempest>=17.1.0 # Apache-2.0
pylint==1.7.6 # GPLv2
python-openstackclient>=3.12.0 # Apache-2.0
python-openstackclient>=3.16.0 # Apache-2.0
requests-mock>=1.2.0 # Apache-2.0

View File

@ -18,6 +18,7 @@
from osc_lib import utils as osc_utils
from openstackclient.identity import common as identity_common
from openstackclient.network.v2 import _tag
from openstackclient.network.v2 import security_group
from vmware_nsx._i18n import _
@ -100,6 +101,8 @@ class NsxCreateSecurityGroup(security_group.CreateSecurityGroup):
# Create the security group and display the results.
obj = client.create_security_group(**attrs)
# tags cannot be set when created, so tags need to be set later.
_tag.update_tags_for_set(client, obj, parsed_args)
display_columns, property_columns = security_group._get_columns(obj)
data = osc_utils.get_item_properties(
obj,
@ -139,6 +142,9 @@ class NsxSetSecurityGroup(security_group.SetSecurityGroup):
client.update_security_group(obj, **attrs)
# tags is a subresource and it needs to be updated separately.
_tag.update_tags_for_set(client, obj, parsed_args)
def update_parser_common(self, parser):
parser = super(NsxSetSecurityGroup, self).update_parser_common(parser)