commit python-neutronclient for openSUSE:Factory
Hello community, here is the log from the commit of package python-neutronclient for openSUSE:Factory checked in at 2015-08-31 22:59:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-neutronclient (Old) and /work/SRC/openSUSE:Factory/.python-neutronclient.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-neutronclient" Changes: -------- --- /work/SRC/openSUSE:Factory/python-neutronclient/python-neutronclient.changes 2015-08-27 08:55:02.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python-neutronclient.new/python-neutronclient.changes 2015-08-31 22:59:56.000000000 +0200 @@ -1,0 +2,16 @@ +Mon Aug 31 15:23:00 UTC 2015 - tbechtold@suse.com + +- update to 2.6.0: + * Updated from global requirements + * Allow setting router's external ip(s) + * Drop use of 'oslo' namespace package + * Updated from global requirements + * Add functional test for subnet create + * Fix Python client library for Neutron + * Update README to work with release tools + * Uncap library requirements for liberty + * Add --binding-profile to port-create + * Fix invalid error message in neutron-cli +- Adjust Requires according to requirements.txt + +------------------------------------------------------------------- Old: ---- python-neutronclient-2.4.0.tar.gz New: ---- python-neutronclient-2.6.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-neutronclient.spec ++++++ --- /var/tmp/diff_new_pack.qe7dzW/_old 2015-08-31 22:59:57.000000000 +0200 +++ /var/tmp/diff_new_pack.qe7dzW/_new 2015-08-31 22:59:57.000000000 +0200 @@ -19,7 +19,7 @@ %define component neutronclient Name: python-neutronclient -Version: 2.4.0 +Version: 2.6.0 Release: 0 Summary: Openstack Network (Quantum) API Client License: Apache-2.0 @@ -49,13 +49,13 @@ Requires: python-argparse Requires: python-cliff >= 1.10.0 Requires: python-iso8601 >= 0.1.9 -Requires: python-keystoneclient >= 1.1.0 +Requires: python-keystoneclient >= 1.3.0 Requires: python-netaddr >= 0.7.12 Requires: python-oslo.i18n >= 1.5.0 Requires: python-oslo.serialization >= 1.4.0 Requires: python-oslo.utils >= 1.4.0 -Requires: python-pbr >= 0.6 -Requires: python-requests >= 2.2.0 +Requires: python-pbr >= 0.11 +Requires: python-requests >= 2.5.2 Requires: python-simplejson >= 2.2.0 Requires: python-six >= 1.9.0 Provides: python-quantumclient = 2.2.3.1 @@ -85,7 +85,7 @@ Requires: python-mock >= 1.0 Requires: python-python-subunit >= 0.0.18 Requires: python-requests-mock >= 0.6.0 -Requires: python-tempest-lib >= 0.4.0 +Requires: python-tempest-lib >= 0.5.0 Requires: python-testrepository >= 0.0.18 Requires: python-testtools >= 0.9.36 ++++++ python-neutronclient-2.4.0.tar.gz -> python-neutronclient-2.6.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/AUTHORS new/python-neutronclient-2.6.0/AUTHORS --- old/python-neutronclient-2.4.0/AUTHORS 2015-04-09 21:59:16.000000000 +0200 +++ new/python-neutronclient-2.6.0/AUTHORS 2015-06-01 16:28:22.000000000 +0200 @@ -43,6 +43,7 @@ Dmitry Kulishenko <dmitryk@yahoo-inc.com> Doug Fish <drfish@us.ibm.com> Doug Hellmann <doug.hellmann@dreamhost.com> +Doug Hellmann <doug@doughellmann.com> Drew Thorstensen <thorst@us.ibm.com> Elena Ezhova <eezhova@mirantis.com> Eugene Nikanorov <enikanorov@mirantis.com> @@ -83,6 +84,7 @@ Maru Newby <marun@redhat.com> Maru Newby <mnewby@internap.com> Matt Riedemann <mriedem@us.ibm.com> +Matthew Treinish <mtreinish@kortar.org> Michael Johnson <johnsom@hp.com> Mitsuru Kanabuchi <kanabuchi.mitsuru@po.ntts.co.jp> Monty Taylor <mordred@inaugust.com> @@ -100,6 +102,7 @@ Robert Li <baoli@cisco.com> Roman Podolyaka <rpodolyaka@mirantis.com> Rudrajit Tapadar <rtapadar@cisco.com> +Russell Bryant <rbryant@redhat.com> Salvatore Orlando <salv.orlando@gmail.com> Salvatore Orlando <salvatore.orlando@eu.citrix.com> Salvatore Orlando <sorlando@nicira.com> @@ -149,6 +152,7 @@ liuweicai <liuuweicai@gmail.com> llg8212 <lilinguo@huawei.com> mathieu-rohon <mathieu.rohon@gmail.com> +preeti-mirji <preeti.sha.mirji@hp.com> ptoohill1 <phillip.toohill@rackspace.com> ronak <ronak.malav.shah@gmail.com> ronak-c <ronak@nuagenetworks.net> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/ChangeLog new/python-neutronclient-2.6.0/ChangeLog --- old/python-neutronclient-2.4.0/ChangeLog 2015-04-09 21:59:16.000000000 +0200 +++ new/python-neutronclient-2.6.0/ChangeLog 2015-06-01 16:28:22.000000000 +0200 @@ -1,10 +1,29 @@ CHANGES ======= +2.6.0 +----- + +* Updated from global requirements +* Allow setting router's external ip(s) +* Drop use of 'oslo' namespace package +* Updated from global requirements +* Add functional test for subnet create +* Fix Python client library for Neutron +* Update README to work with release tools + +2.5.0 +----- + +* Uncap library requirements for liberty +* Add --binding-profile to port-create +* Fix invalid error message in neutron-cli + 2.4.0 ----- * Fix one remaining E125 error and remove it from ignore list +* Add basic functional tests for client library * Add Neutron subnetpool API * Revert "Remove unused AlreadyAttachedClient" * Allow passing None for subnetpool diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/PKG-INFO new/python-neutronclient-2.6.0/PKG-INFO --- old/python-neutronclient-2.4.0/PKG-INFO 2015-04-09 21:59:16.000000000 +0200 +++ new/python-neutronclient-2.6.0/PKG-INFO 2015-06-01 16:28:22.000000000 +0200 @@ -1,12 +1,25 @@ Metadata-Version: 1.1 Name: python-neutronclient -Version: 2.4.0 +Version: 2.6.0 Summary: CLI and Client Library for OpenStack Networking Home-page: http://www.openstack.org/ Author: OpenStack Networking Project Author-email: openstack-dev@lists.openstack.org License: UNKNOWN -Description: This is the client API library for Neutron. +Description: Python bindings to the Neutron API + ================================== + + This is a client library for Neutron built on the Neutron API. It + provides a Python API (the ``neutronclient`` module) and a command-line tool + (``neutron``). + + Development takes place via the usual OpenStack processes as outlined in the + `developer guide <http://docs.openstack.org/infra/manual/developers.html>`_. + + * License: Apache License, Version 2.0 + * Documentation: http://docs.openstack.org/developer/python-neutronclient + * Source: http://git.openstack.org/cgit/openstack/python-neutronclient + * Bugs: http://bugs.launchpad.net/python-neutronclient Platform: UNKNOWN diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/README.rst new/python-neutronclient-2.6.0/README.rst --- old/python-neutronclient-2.4.0/README.rst 2015-04-09 21:58:39.000000000 +0200 +++ new/python-neutronclient-2.6.0/README.rst 2015-06-01 16:27:37.000000000 +0200 @@ -1 +1,14 @@ -This is the client API library for Neutron. +Python bindings to the Neutron API +================================== + +This is a client library for Neutron built on the Neutron API. It +provides a Python API (the ``neutronclient`` module) and a command-line tool +(``neutron``). + +Development takes place via the usual OpenStack processes as outlined in the +`developer guide <http://docs.openstack.org/infra/manual/developers.html>`_. + +* License: Apache License, Version 2.0 +* Documentation: http://docs.openstack.org/developer/python-neutronclient +* Source: http://git.openstack.org/cgit/openstack/python-neutronclient +* Bugs: http://bugs.launchpad.net/python-neutronclient diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/neutronclient/common/serializer.py new/python-neutronclient-2.6.0/neutronclient/common/serializer.py --- old/python-neutronclient-2.4.0/neutronclient/common/serializer.py 2015-04-09 21:58:39.000000000 +0200 +++ new/python-neutronclient-2.6.0/neutronclient/common/serializer.py 2015-06-01 16:27:37.000000000 +0200 @@ -17,7 +17,7 @@ from xml.etree import ElementTree as etree from xml.parsers import expat -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils import six from neutronclient.common import constants diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/neutronclient/common/utils.py new/python-neutronclient-2.6.0/neutronclient/common/utils.py --- old/python-neutronclient-2.4.0/neutronclient/common/utils.py 2015-04-09 21:58:39.000000000 +0200 +++ new/python-neutronclient-2.6.0/neutronclient/common/utils.py 2015-06-01 16:27:37.000000000 +0200 @@ -19,10 +19,11 @@ import argparse import logging +import netaddr import os -from oslo.utils import encodeutils -from oslo.utils import importutils +from oslo_utils import encodeutils +from oslo_utils import importutils import six from neutronclient.common import exceptions @@ -171,3 +172,11 @@ choices=['True', 'true', 'False', 'false'], default=default, **kwargs) + + +def is_valid_cidr(cidr): + try: + netaddr.IPNetwork(cidr) + return True + except Exception: + return False diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/neutronclient/i18n.py new/python-neutronclient-2.6.0/neutronclient/i18n.py --- old/python-neutronclient-2.4.0/neutronclient/i18n.py 2015-04-09 21:58:39.000000000 +0200 +++ new/python-neutronclient-2.6.0/neutronclient/i18n.py 2015-06-01 16:27:37.000000000 +0200 @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo import i18n +import oslo_i18n as i18n _translators = i18n.TranslatorFactory(domain='neutronclient') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/neutronclient/neutron/v2_0/__init__.py new/python-neutronclient-2.6.0/neutronclient/neutron/v2_0/__init__.py --- old/python-neutronclient-2.4.0/neutronclient/neutron/v2_0/__init__.py 2015-04-09 21:58:39.000000000 +0200 +++ new/python-neutronclient-2.6.0/neutronclient/neutron/v2_0/__init__.py 2015-06-01 16:27:37.000000000 +0200 @@ -24,7 +24,7 @@ from cliff.formatters import table from cliff import lister from cliff import show -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils import six from neutronclient.common import command @@ -288,6 +288,10 @@ _("Invalid values_specs %s") % ' '.join(values_specs)) _value_number += 1 + if _item.startswith('---'): + raise exceptions.CommandError( + _("Invalid values_specs %s") % ' '.join(values_specs)) + _values_specs.append(_item) # Deal with last one argument diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/neutronclient/neutron/v2_0/port.py new/python-neutronclient-2.6.0/neutronclient/neutron/v2_0/port.py --- old/python-neutronclient-2.4.0/neutronclient/neutron/v2_0/port.py 2015-04-09 21:58:39.000000000 +0200 +++ new/python-neutronclient-2.6.0/neutronclient/neutron/v2_0/port.py 2015-06-01 16:27:37.000000000 +0200 @@ -16,7 +16,7 @@ import argparse -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils from neutronclient.common import exceptions from neutronclient.common import utils @@ -222,6 +222,12 @@ '--vnic_type', choices=['direct', 'macvtap', 'normal'], help=argparse.SUPPRESS) + parser.add_argument( + '--binding-profile', + help=_('Custom data to be passed as binding:profile.')) + parser.add_argument( + '--binding_profile', + help=argparse.SUPPRESS) self.add_arguments_secgroup(parser) self.add_arguments_extradhcpopt(parser) @@ -242,6 +248,9 @@ body['port'].update({'tenant_id': parsed_args.tenant_id}) if parsed_args.vnic_type: body['port'].update({'binding:vnic_type': parsed_args.vnic_type}) + if parsed_args.binding_profile: + body['port'].update({'binding:profile': + jsonutils.loads(parsed_args.binding_profile)}) self.args2body_secgroup(parsed_args, body['port']) self.args2body_extradhcpopt(parsed_args, body['port']) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/neutronclient/neutron/v2_0/quota.py new/python-neutronclient-2.6.0/neutronclient/neutron/v2_0/quota.py --- old/python-neutronclient-2.4.0/neutronclient/neutron/v2_0/quota.py 2015-04-09 21:58:39.000000000 +0200 +++ new/python-neutronclient-2.6.0/neutronclient/neutron/v2_0/quota.py 2015-06-01 16:27:37.000000000 +0200 @@ -20,7 +20,7 @@ from cliff import lister from cliff import show -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils import six from neutronclient.common import exceptions diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/neutronclient/neutron/v2_0/router.py new/python-neutronclient-2.6.0/neutronclient/neutron/v2_0/router.py --- old/python-neutronclient-2.4.0/neutronclient/neutron/v2_0/router.py 2015-04-09 21:58:39.000000000 +0200 +++ new/python-neutronclient-2.6.0/neutronclient/neutron/v2_0/router.py 2015-06-01 16:27:37.000000000 +0200 @@ -18,7 +18,7 @@ import argparse -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils from neutronclient.common import exceptions from neutronclient.common import utils @@ -184,6 +184,11 @@ parser.add_argument( '--disable-snat', action='store_true', help=_('Disable source NAT on the router gateway.')) + parser.add_argument( + '--fixed-ip', action='append', + help=_('Desired IP and/or subnet on external network: ' + 'subnet_id=<name_or_id>,ip_address=<ip>. ' + 'You can repeat this option.')) return parser def run(self, parsed_args): @@ -197,6 +202,17 @@ router_dict = {'network_id': _ext_net_id} if parsed_args.disable_snat: router_dict['enable_snat'] = False + if parsed_args.fixed_ip: + ips = [] + for ip_spec in parsed_args.fixed_ip: + ip_dict = utils.str2dict(ip_spec) + subnet_name_id = ip_dict.get('subnet_id') + if subnet_name_id: + subnet_id = neutronV20.find_resourceid_by_name_or_id( + neutron_client, 'subnet', subnet_name_id) + ip_dict['subnet_id'] = subnet_id + ips.append(ip_dict) + router_dict['external_fixed_ips'] = ips neutron_client.add_gateway_router(_router_id, router_dict) print(_('Set gateway for router %s') % parsed_args.router, file=self.app.stdout) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/neutronclient/neutron/v2_0/subnet.py new/python-neutronclient-2.6.0/neutronclient/neutron/v2_0/subnet.py --- old/python-neutronclient-2.4.0/neutronclient/neutron/v2_0/subnet.py 2015-04-09 21:58:39.000000000 +0200 +++ new/python-neutronclient-2.6.0/neutronclient/neutron/v2_0/subnet.py 2015-06-01 16:27:37.000000000 +0200 @@ -16,7 +16,7 @@ import argparse -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils from neutronclient.common import exceptions from neutronclient.common import utils diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/neutronclient/neutron/v2_0/vpn/ipsec_site_connection.py new/python-neutronclient-2.6.0/neutronclient/neutron/v2_0/vpn/ipsec_site_connection.py --- old/python-neutronclient-2.4.0/neutronclient/neutron/v2_0/vpn/ipsec_site_connection.py 2015-04-09 21:58:39.000000000 +0200 +++ new/python-neutronclient-2.6.0/neutronclient/neutron/v2_0/vpn/ipsec_site_connection.py 2015-06-01 16:27:37.000000000 +0200 @@ -14,7 +14,7 @@ # under the License. # -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils from neutronclient.common import exceptions from neutronclient.common import utils diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/neutronclient/shell.py new/python-neutronclient-2.6.0/neutronclient/shell.py --- old/python-neutronclient-2.4.0/neutronclient/shell.py 2015-04-09 21:58:40.000000000 +0200 +++ new/python-neutronclient-2.6.0/neutronclient/shell.py 2015-06-01 16:27:37.000000000 +0200 @@ -33,7 +33,7 @@ from keystoneclient import discover from keystoneclient.openstack.common.apiclient import exceptions as ks_exc from keystoneclient import session -from oslo.utils import encodeutils +from oslo_utils import encodeutils import six.moves.urllib.parse as urlparse from cliff import app @@ -97,10 +97,25 @@ _argv = sub_argv[:index] values_specs = sub_argv[index:] known_args, _values_specs = cmd_parser.parse_known_args(_argv) + if(isinstance(cmd, subnet.CreateSubnet) and not known_args.cidr): + cidr = get_first_valid_cidr(_values_specs) + if cidr: + known_args.cidr = cidr + _values_specs.remove(cidr) cmd.values_specs = (index == -1 and _values_specs or values_specs) return cmd.run(known_args) +def get_first_valid_cidr(value_specs): + # Bug 1442771, argparse does not allow optional positional parameter + # to be separated from previous positional parameter. + # When cidr was separated from network, the value will not be able + # to be parsed into known_args, but saved to _values_specs instead. + for value in value_specs: + if utils.is_valid_cidr(value): + return value + + def env(*_vars, **kwargs): """Search for the first defined of possibly many env vars. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/neutronclient/tests/functional/test_clientlib.py new/python-neutronclient-2.6.0/neutronclient/tests/functional/test_clientlib.py --- old/python-neutronclient-2.4.0/neutronclient/tests/functional/test_clientlib.py 1970-01-01 01:00:00.000000000 +0100 +++ new/python-neutronclient-2.6.0/neutronclient/tests/functional/test_clientlib.py 2015-06-01 16:27:37.000000000 +0200 @@ -0,0 +1,88 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import os +import uuid + +from keystoneclient.auth.identity import v2 as v2_auth +from keystoneclient import discover +from keystoneclient import session +from tempest_lib import base +import testtools + +from neutronclient.common import exceptions +from neutronclient.v2_0 import client as v2_client + +# This module tests client library functionalities with +# Keystone client. Neutron client supports two types of +# HTTP clients (HTTPClient and SessionClient), +# so it is better to test both clients. + + +class LibraryTestBase(base.BaseTestCase): + + def setUp(self): + super(LibraryTestBase, self).setUp() + self.client = self._get_client() + + +class Libv2HTTPClientTestBase(LibraryTestBase): + + def _get_client(self): + return v2_client.Client(username=os.environ.get('OS_USERNAME'), + password=os.environ.get('OS_PASSWORD'), + tenant_name=os.environ.get('OS_TENANT_NAME'), + auth_url=os.environ.get('OS_AUTH_URL')) + + +class Libv2SessionClientTestBase(LibraryTestBase): + + def _get_client(self): + session_params = {} + ks_session = session.Session.construct(session_params) + ks_discover = discover.Discover(session=ks_session, + auth_url=os.environ.get('OS_AUTH_URL')) + # At the moment, we use keystone v2 API + v2_auth_url = ks_discover.url_for('2.0') + ks_session.auth = v2_auth.Password( + v2_auth_url, + username=os.environ.get('OS_USERNAME'), + password=os.environ.get('OS_PASSWORD'), + tenant_name=os.environ.get('OS_TENANT_NAME')) + return v2_client.Client(session=ks_session) + + +class LibraryTestCase(object): + + def test_list_network(self): + nets = self.client.list_networks() + self.assertIsInstance(nets['networks'], list) + + def test_post_put_delele_network(self): + name = str(uuid.uuid4()) + net = self.client.create_network({'network': {'name': name}}) + net_id = net['network']['id'] + self.assertEqual(name, net['network']['name']) + name2 = str(uuid.uuid4()) + net = self.client.update_network(net_id, {'network': {'name': name2}}) + self.assertEqual(name2, net['network']['name']) + self.client.delete_network(net_id) + with testtools.ExpectedException(exceptions.NetworkNotFoundClient): + self.client.show_network(net_id) + + +class LibraryHTTPClientTest(LibraryTestCase, Libv2HTTPClientTestBase): + pass + + +class LibrarySessionClientTest(LibraryTestCase, Libv2SessionClientTestBase): + pass diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/neutronclient/tests/functional/test_subnet_create.py new/python-neutronclient-2.6.0/neutronclient/tests/functional/test_subnet_create.py --- old/python-neutronclient-2.4.0/neutronclient/tests/functional/test_subnet_create.py 1970-01-01 01:00:00.000000000 +0100 +++ new/python-neutronclient-2.6.0/neutronclient/tests/functional/test_subnet_create.py 2015-06-01 16:27:37.000000000 +0200 @@ -0,0 +1,36 @@ +# Copyright 2015 Hewlett-Packard Development Company, L.P +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from neutronclient.tests.functional import base + + +class SubnetCreateNeutronClientCLITest(base.ClientTestBase): + + def test_create_subnet_net_name_first(self): + self.neutron('net-create', params='netwrk-1') + self.addCleanup(self.neutron, 'net-delete netwrk-1') + self.neutron('subnet-create netwrk-1', + params='--name fake --gateway 192.168.51.1 ' + '192.168.51.0/24') + self.addCleanup(self.neutron, 'subnet-delete fake') + subnet_list = self.parser.listing(self.neutron('subnet-list')) + self.assertTableStruct(subnet_list, ['id', 'name', 'cidr', + 'allocation_pools']) + found = False + for row in subnet_list: + if row.get('name') == 'fake': + found = True + break + if not found: + self.fail('Created subnet not found in list') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/neutronclient/tests/unit/test_auth.py new/python-neutronclient-2.6.0/neutronclient/tests/unit/test_auth.py --- old/python-neutronclient-2.4.0/neutronclient/tests/unit/test_auth.py 2015-04-09 21:58:39.000000000 +0200 +++ new/python-neutronclient-2.6.0/neutronclient/tests/unit/test_auth.py 2015-06-01 16:27:37.000000000 +0200 @@ -19,7 +19,7 @@ import uuid import fixtures -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils from requests_mock.contrib import fixture as mock_fixture import testtools diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/neutronclient/tests/unit/test_casual_args.py new/python-neutronclient-2.6.0/neutronclient/tests/unit/test_casual_args.py --- old/python-neutronclient-2.4.0/neutronclient/tests/unit/test_casual_args.py 2015-04-09 21:58:39.000000000 +0200 +++ new/python-neutronclient-2.6.0/neutronclient/tests/unit/test_casual_args.py 2015-06-01 16:27:37.000000000 +0200 @@ -78,6 +78,11 @@ self.assertEqual('value1', neutronV20.parse_args_to_dict(_specs)['arg1']) + def test_arg_invalid_syntax(self): + _specs = ['--tag=t', '---arg1', 'value1'] + self.assertRaises(exceptions.CommandError, + neutronV20.parse_args_to_dict, _specs) + def test_dict_arg(self): _specs = ['--tag=t', '--arg1', 'type=dict', 'key1=value1,key2=value2'] arg1 = neutronV20.parse_args_to_dict(_specs)['arg1'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/neutronclient/tests/unit/test_cli20.py new/python-neutronclient-2.6.0/neutronclient/tests/unit/test_cli20.py --- old/python-neutronclient-2.4.0/neutronclient/tests/unit/test_cli20.py 2015-04-09 21:58:40.000000000 +0200 +++ new/python-neutronclient-2.6.0/neutronclient/tests/unit/test_cli20.py 2015-06-01 16:27:37.000000000 +0200 @@ -20,7 +20,7 @@ import fixtures from mox3 import mox -from oslo.utils import encodeutils +from oslo_utils import encodeutils from oslotest import base import requests import six diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/neutronclient/tests/unit/test_cli20_agents.py new/python-neutronclient-2.6.0/neutronclient/tests/unit/test_cli20_agents.py --- old/python-neutronclient-2.4.0/neutronclient/tests/unit/test_cli20_agents.py 2015-04-09 21:58:39.000000000 +0200 +++ new/python-neutronclient-2.6.0/neutronclient/tests/unit/test_cli20_agents.py 2015-06-01 16:27:37.000000000 +0200 @@ -14,7 +14,7 @@ import sys -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils from neutronclient.neutron.v2_0 import agent from neutronclient.tests.unit import test_cli20 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/neutronclient/tests/unit/test_cli20_network.py new/python-neutronclient-2.6.0/neutronclient/tests/unit/test_cli20_network.py --- old/python-neutronclient-2.4.0/neutronclient/tests/unit/test_cli20_network.py 2015-04-09 21:58:39.000000000 +0200 +++ new/python-neutronclient-2.6.0/neutronclient/tests/unit/test_cli20_network.py 2015-06-01 16:27:37.000000000 +0200 @@ -17,7 +17,7 @@ import sys from mox3 import mox -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils from neutronclient.common import exceptions from neutronclient.neutron.v2_0 import network diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/neutronclient/tests/unit/test_cli20_port.py new/python-neutronclient-2.6.0/neutronclient/tests/unit/test_cli20_port.py --- old/python-neutronclient-2.4.0/neutronclient/tests/unit/test_cli20_port.py 2015-04-09 21:58:39.000000000 +0200 +++ new/python-neutronclient-2.6.0/neutronclient/tests/unit/test_cli20_port.py 2015-06-01 16:27:37.000000000 +0200 @@ -173,6 +173,25 @@ self._test_create_resource(resource, cmd, name, myid, args, position_names, position_values) + def test_create_port_with_binding_profile(self): + resource = 'port' + cmd = port.CreatePort(test_cli20.MyApp(sys.stdout), None) + name = 'myname' + myid = 'myid' + netid = 'netid' + args = ['--binding_profile', '{"foo":"bar"}', netid] + position_names = ['binding:profile', 'network_id'] + position_values = [{'foo': 'bar'}, netid] + self._test_create_resource(resource, cmd, name, myid, args, + position_names, position_values) + + # Test dashed options + args = ['--binding-profile', '{"foo":"bar"}', netid] + position_names = ['binding:profile', 'network_id'] + position_values = [{'foo': 'bar'}, netid] + self._test_create_resource(resource, cmd, name, myid, args, + position_names, position_values) + def test_create_port_tenant(self): """Create port: --tenant_id tenantid netid.""" resource = 'port' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/neutronclient/tests/unit/test_cli20_router.py new/python-neutronclient-2.6.0/neutronclient/tests/unit/test_cli20_router.py --- old/python-neutronclient-2.4.0/neutronclient/tests/unit/test_cli20_router.py 2015-04-09 21:58:39.000000000 +0200 +++ new/python-neutronclient-2.6.0/neutronclient/tests/unit/test_cli20_router.py 2015-06-01 16:27:37.000000000 +0200 @@ -244,6 +244,32 @@ "enable_snat": False}} ) + def test_set_gateway_external_ip(self): + """set external gateway for router: myid externalid --fixed-ip ...""" + resource = 'router' + cmd = router.SetGatewayRouter(test_cli20.MyApp(sys.stdout), None) + args = ['myid', 'externalid', '--fixed-ip', 'ip_address=10.0.0.2'] + self._test_update_resource(resource, cmd, 'myid', + args, + {"external_gateway_info": + {"network_id": "externalid", + "external_fixed_ips": [ + {"ip_address": "10.0.0.2"}]}} + ) + + def test_set_gateway_external_subnet(self): + """set external gateway for router: myid externalid --fixed-ip ...""" + resource = 'router' + cmd = router.SetGatewayRouter(test_cli20.MyApp(sys.stdout), None) + args = ['myid', 'externalid', '--fixed-ip', 'subnet_id=mysubnet'] + self._test_update_resource(resource, cmd, 'myid', + args, + {"external_gateway_info": + {"network_id": "externalid", + "external_fixed_ips": [ + {"subnet_id": "mysubnet"}]}} + ) + def test_remove_gateway(self): """Remove external gateway from router: externalid.""" resource = 'router' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/neutronclient/tests/unit/test_cli20_subnet.py new/python-neutronclient-2.6.0/neutronclient/tests/unit/test_cli20_subnet.py --- old/python-neutronclient-2.4.0/neutronclient/tests/unit/test_cli20_subnet.py 2015-04-09 21:58:39.000000000 +0200 +++ new/python-neutronclient-2.6.0/neutronclient/tests/unit/test_cli20_subnet.py 2015-06-01 16:27:37.000000000 +0200 @@ -34,12 +34,28 @@ name = 'myname' myid = 'myid' netid = 'netid' - cidr = 'cidrvalue' + cidr = '10.10.10.0/24' gateway = 'gatewayvalue' args = ['--gateway', gateway, netid, cidr] position_names = ['ip_version', 'network_id', 'cidr', 'gateway_ip'] position_values = [4, netid, cidr, gateway] self._test_create_resource(resource, cmd, name, myid, args, + position_names, position_values) + + def test_create_subnet_network_cidr_seperated(self): + # For positional value, network_id and cidr can be separated. + """Create subnet: --gateway gateway netid cidr.""" + resource = 'subnet' + cmd = subnet.CreateSubnet(test_cli20.MyApp(sys.stdout), None) + name = 'myname' + myid = 'myid' + netid = 'netid' + cidr = '10.10.10.0/24' + gateway = 'gatewayvalue' + args = [netid, '--gateway', gateway, cidr] + position_names = ['ip_version', 'network_id', 'cidr', 'gateway_ip'] + position_values = [4, netid, cidr, gateway] + self._test_create_resource(resource, cmd, name, myid, args, position_names, position_values) def test_create_subnet_with_no_gateway(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/neutronclient/tests/unit/test_utils.py new/python-neutronclient-2.6.0/neutronclient/tests/unit/test_utils.py --- old/python-neutronclient-2.4.0/neutronclient/tests/unit/test_utils.py 2015-04-09 21:58:39.000000000 +0200 +++ new/python-neutronclient-2.6.0/neutronclient/tests/unit/test_utils.py 2015-06-01 16:27:37.000000000 +0200 @@ -102,6 +102,11 @@ act = utils.get_item_properties(item, fields, formatters=formatters) self.assertEqual(('test_name', 'test_id', 'test', 'pass'), act) + def test_is_cidr(self): + self.assertTrue(utils.is_valid_cidr('10.10.10.0/24')) + self.assertFalse(utils.is_valid_cidr('10.10.10..0/24')) + self.assertFalse(utils.is_valid_cidr('wrong_cidr_format')) + class ImportClassTestCase(testtools.TestCase): def test_get_client_class_invalid_version(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/python_neutronclient.egg-info/PKG-INFO new/python-neutronclient-2.6.0/python_neutronclient.egg-info/PKG-INFO --- old/python-neutronclient-2.4.0/python_neutronclient.egg-info/PKG-INFO 2015-04-09 21:59:16.000000000 +0200 +++ new/python-neutronclient-2.6.0/python_neutronclient.egg-info/PKG-INFO 2015-06-01 16:28:22.000000000 +0200 @@ -1,12 +1,25 @@ Metadata-Version: 1.1 Name: python-neutronclient -Version: 2.4.0 +Version: 2.6.0 Summary: CLI and Client Library for OpenStack Networking Home-page: http://www.openstack.org/ Author: OpenStack Networking Project Author-email: openstack-dev@lists.openstack.org License: UNKNOWN -Description: This is the client API library for Neutron. +Description: Python bindings to the Neutron API + ================================== + + This is a client library for Neutron built on the Neutron API. It + provides a Python API (the ``neutronclient`` module) and a command-line tool + (``neutron``). + + Development takes place via the usual OpenStack processes as outlined in the + `developer guide <http://docs.openstack.org/infra/manual/developers.html>`_. + + * License: Apache License, Version 2.0 + * Documentation: http://docs.openstack.org/developer/python-neutronclient + * Source: http://git.openstack.org/cgit/openstack/python-neutronclient + * Bugs: http://bugs.launchpad.net/python-neutronclient Platform: UNKNOWN diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/python_neutronclient.egg-info/SOURCES.txt new/python-neutronclient-2.6.0/python_neutronclient.egg-info/SOURCES.txt --- old/python-neutronclient-2.4.0/python_neutronclient.egg-info/SOURCES.txt 2015-04-09 21:59:16.000000000 +0200 +++ new/python-neutronclient-2.6.0/python_neutronclient.egg-info/SOURCES.txt 2015-06-01 16:28:22.000000000 +0200 @@ -81,7 +81,9 @@ neutronclient/tests/__init__.py neutronclient/tests/functional/__init__.py neutronclient/tests/functional/base.py +neutronclient/tests/functional/test_clientlib.py neutronclient/tests/functional/test_readonly_neutron.py +neutronclient/tests/functional/test_subnet_create.py neutronclient/tests/functional/hooks/post_test_hook.sh neutronclient/tests/unit/__init__.py neutronclient/tests/unit/test_auth.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/python_neutronclient.egg-info/pbr.json new/python-neutronclient-2.6.0/python_neutronclient.egg-info/pbr.json --- old/python-neutronclient-2.4.0/python_neutronclient.egg-info/pbr.json 2015-04-09 21:59:16.000000000 +0200 +++ new/python-neutronclient-2.6.0/python_neutronclient.egg-info/pbr.json 2015-06-01 16:28:22.000000000 +0200 @@ -1 +1 @@ -{"is_release": true, "git_version": "aa1215a"} \ No newline at end of file +{"is_release": true, "git_version": "da39d9e"} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/python_neutronclient.egg-info/requires.txt new/python-neutronclient-2.6.0/python_neutronclient.egg-info/requires.txt --- old/python-neutronclient-2.4.0/python_neutronclient.egg-info/requires.txt 2015-04-09 21:59:16.000000000 +0200 +++ new/python-neutronclient-2.6.0/python_neutronclient.egg-info/requires.txt 2015-06-01 16:28:22.000000000 +0200 @@ -1,13 +1,13 @@ -pbr>=0.6,!=0.7,<1.0 +pbr>=0.11,<2.0 argparse -cliff>=1.10.0,<1.11.0 # Apache-2.0 +cliff>=1.10.0 # Apache-2.0 iso8601>=0.1.9 netaddr>=0.7.12 -oslo.i18n>=1.5.0,<1.6.0 # Apache-2.0 -oslo.serialization>=1.4.0,<1.5.0 # Apache-2.0 -oslo.utils>=1.4.0,<1.5.0 # Apache-2.0 -requests>=2.2.0,!=2.4.0 -python-keystoneclient>=1.1.0 +oslo.i18n>=1.5.0 # Apache-2.0 +oslo.serialization>=1.4.0 # Apache-2.0 +oslo.utils>=1.4.0 # Apache-2.0 +requests>=2.5.2 +python-keystoneclient>=1.3.0 simplejson>=2.2.0 six>=1.9.0 Babel>=1.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/requirements.txt new/python-neutronclient-2.6.0/requirements.txt --- old/python-neutronclient-2.4.0/requirements.txt 2015-04-09 21:58:39.000000000 +0200 +++ new/python-neutronclient-2.6.0/requirements.txt 2015-06-01 16:27:37.000000000 +0200 @@ -1,16 +1,16 @@ # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -pbr>=0.6,!=0.7,<1.0 +pbr>=0.11,<2.0 argparse -cliff>=1.10.0,<1.11.0 # Apache-2.0 +cliff>=1.10.0 # Apache-2.0 iso8601>=0.1.9 netaddr>=0.7.12 -oslo.i18n>=1.5.0,<1.6.0 # Apache-2.0 -oslo.serialization>=1.4.0,<1.5.0 # Apache-2.0 -oslo.utils>=1.4.0,<1.5.0 # Apache-2.0 -requests>=2.2.0,!=2.4.0 -python-keystoneclient>=1.1.0 +oslo.i18n>=1.5.0 # Apache-2.0 +oslo.serialization>=1.4.0 # Apache-2.0 +oslo.utils>=1.4.0 # Apache-2.0 +requests>=2.5.2 +python-keystoneclient>=1.3.0 simplejson>=2.2.0 six>=1.9.0 Babel>=1.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-neutronclient-2.4.0/test-requirements.txt new/python-neutronclient-2.6.0/test-requirements.txt --- old/python-neutronclient-2.4.0/test-requirements.txt 2015-04-09 21:58:39.000000000 +0200 +++ new/python-neutronclient-2.6.0/test-requirements.txt 2015-06-01 16:27:37.000000000 +0200 @@ -9,11 +9,11 @@ fixtures>=0.3.14 mox3>=0.7.0 mock>=1.0 -oslosphinx>=2.5.0,<2.6.0 # Apache-2.0 -oslotest>=1.5.1,<1.6.0 # Apache-2.0 +oslosphinx>=2.5.0 # Apache-2.0 +oslotest>=1.5.1 # Apache-2.0 python-subunit>=0.0.18 requests-mock>=0.6.0 # Apache-2.0 sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3 testrepository>=0.0.18 testtools>=0.9.36,!=1.2.0 -tempest-lib>=0.4.0 +tempest-lib>=0.5.0
participants (1)
-
root@hilbert.suse.de