Merge "Add 'shared' option to neutron address-scope-update"

This commit is contained in:
Jenkins
2016-08-12 03:07:48 +00:00
committed by Gerrit Code Review
2 changed files with 11 additions and 1 deletions

View File

@@ -15,6 +15,7 @@
#
from neutronclient._i18n import _
from neutronclient.common import utils
from neutronclient.neutron import v2_0 as neutronV20
@@ -77,8 +78,12 @@ class UpdateAddressScope(neutronV20.UpdateCommand):
def add_known_arguments(self, parser):
parser.add_argument('--name',
help=_('Updated name of the address scope.'))
utils.add_boolean_argument(
parser, '--shared',
help=_('Set sharing of address scope. '
'(True means shared)'))
def args2body(self, parsed_args):
body = {}
neutronV20.update_dict(parsed_args, body, ['name'])
neutronV20.update_dict(parsed_args, body, ['name', 'shared'])
return {self.resource: body}

View File

@@ -114,6 +114,11 @@ class CLITestV20AddressScopeJSON(test_cli20.CLITestV20Base):
['myid', '--name', 'newname-address-scope'],
{'name': 'newname-address-scope'}
)
# Update address_scope: myid --shared
self._test_update_resource(resource, cmd, 'myid',
['myid', '--shared', 'True'],
{'shared': "True"}
)
def test_list_address_scope(self):
# address_scope-list.