diff options
| author | Corey Bryant <corey.bryant@canonical.com> | 2018-02-12 09:30:43 -0500 |
|---|---|---|
| committer | git-ubuntu importer <ubuntu-devel-discuss@lists.ubuntu.com> | 2018-02-12 20:59:09 +0000 |
| commit | 92fca0b819014f64faf2d08811b3fed9a9a4cd08 (patch) | |
| tree | 0188e2b184bf86c2843fd716cd655ecb2704f8fb | |
| parent | ddb85e0812c5c97f8cf9342c6ee47226c1e8cdd2 (diff) | |
3.14.0-0ubuntu1 (patches unapplied)import/3.14.0-0ubuntu1ubuntu/bionic
Imported using git-ubuntu import.
Notes
Notes:
* New upstream release.
* d/control: Align (Build-)Depends with upstream.
34 files changed, 468 insertions, 95 deletions
@@ -46,6 +46,7 @@ Carlos Goncalves <carlos.goncalves@neclab.eu> Carlos Konstanski <ckonstanski@pippiandcarlos.com> Cedric Brandily <zzelle@gmail.com> Chaozhe.Chen <chaozhe.chen@easystack.cn> +Chen Hanxiao <chenhx@certusnet.com.cn> Choe, Cheng-Dae <whitekid@gmail.com> Chris Johnson <wchrisjohnson@gmail.com> Christian Berendt <berendt@b1-systems.de> @@ -88,6 +89,7 @@ Ghe Rivero <ghe.rivero@hp.com> Gilles Dubreuil <gilles@redhat.com> Guang Yee <guang.yee@hpe.com> Guojian Shao <guojian@unitedstack.com> +Guoqiang Ding <dingguoqiang@cloudin.cn> Gábor Antal <antal@inf.u-szeged.hu> Ha Van Tu <tuhv@vn.fujitsu.com> Hangdong Zhang <hdzhang@fiberhome.com> @@ -149,6 +151,7 @@ Kenneth Chu <chukenne@ca.ibm.com> Kevin_Zheng <zhengzhenyu@huawei.com> Kristi Nikolla <knikolla@bu.edu> Kyrylo Romanenko <kromanenko@mirantis.com> +LIU Yulong <i@liuyulong.me> Lin Yang <lin.a.yang@intel.com> Lingxian Kong <anlin.kong@gmail.com> LiuNanke <nanke.liu@easystack.cn> @@ -167,6 +170,7 @@ Marek Aufart <maufart@redhat.com> Marek Denis <marek.denis@cern.ch> Mark Vanderwiel <vanderwl@us.ibm.com> Martin Schuppert <mschuppert@redhat.com> +Masayuki Igawa <masayuki@igawa.io> Matt Fischer <matt@mattfischer.com> Matt Joyce <matt.joyce@cloudscaling.com> Matt Riedemann <mriedem.os@gmail.com> @@ -176,6 +180,7 @@ Matthieu Huin <mhu@enovance.com> Michael Gugino <michael.gugino@walmart.com> Michael Johnson <johnsomor@gmail.com> Michael McCune <msm@redhat.com> +Mike Fedosin <mfedosin@redhat.com> Mikhail Feoktistov <mfeoktistov@virtuozzo.com> Min Min Ren <rminmin@cn.ibm.com> Mohan Muppidi <mkumar2301@gmail.com> @@ -1,6 +1,31 @@ CHANGES ======= +3.14.0 +------ + +* Updated from global requirements +* Fix use of new openstacksdk connection +* Rework Network client config for new SDK Connection +* Replace assert with condition +* Updated from global requirements +* Corrected spelling mistake +* Updated from global requirements +* Fix indentation in authentication.rst +* Partially Revert "Update new documentation PTI jobs" +* Use Zuul v3 fetch-subunit-output +* Updated from global requirements +* Updated from global requirements +* Add floating IP qos\_policy actions +* Updated from global requirements +* Check that Glance returns image data before processing it +* Allow ports filtering with device\_id +* Update new documentation PTI jobs +* flavor: clarify --swap description +* Switch to use stestr directly +* Fix func tests: Ensure to pass OS\_CLOUD envvar +* Updated from global requirements + 3.13.0 ------ @@ -15,6 +40,7 @@ CHANGES * Release note cleanup * Set correct designate endpoint in docs * Make osc-tox-unit-tips work on other repos +* Allow port list to shown undefined attributes * Updated from global requirements * Fix file mode on network-topology.rst * Add support for endpoing filter commands @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: python-openstackclient -Version: 3.13.0 +Version: 3.14.0 Summary: OpenStack Command-line Client Home-page: https://docs.openstack.org/python-openstackclient/latest/ Author: OpenStack diff --git a/debian/changelog b/debian/changelog index 3e43acf..009ce51 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +python-openstackclient (3.14.0-0ubuntu1) bionic; urgency=medium + + * New upstream release. + * d/control: Align (Build-)Depends with upstream. + + -- Corey Bryant <corey.bryant@canonical.com> Mon, 12 Feb 2018 09:30:43 -0500 + python-openstackclient (3.13.0-0ubuntu1) bionic; urgency=medium * New upstream release. diff --git a/debian/control b/debian/control index eb472d5..481129e 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Uploaders: gustavo panizzo <gfa@zumbi.com.ar>, Thomas Goirand <zigo@debian.org>, Build-Depends: - debhelper (>= 10), + debhelper (>= 10~), dh-python, openstack-pkg-tools (>= 52~), python-all, @@ -23,9 +23,9 @@ Build-Depends-Indep: python-aodhclient (>= 0.9.0), python-babel (>= 2.3.4), python-barbicanclient (>= 4.0.0), - python-cinderclient (>= 1:3.2.0), + python-cinderclient (>= 1:3.3.0), python-cliff (>= 2.8.0), - python-congressclient (>= 1.3.0), + python-congressclient (>= 1.9.0), python-coverage (>= 4.0), python-crypto, python-designateclient (>= 2.7.0), @@ -37,22 +37,22 @@ Build-Depends-Indep: python-ironic-inspector-client (>= 1.5.0), python-ironicclient (>= 1.14.0), python-keyring, - python-keystoneauth1 (>= 3.2.0), + python-keystoneauth1 (>= 3.3.0), python-keystoneclient (>= 1:3.8.0), python-mistralclient (>= 1:3.1.0), python-mock (>= 2.0.0), python-muranoclient (>= 0.8.2), python-neutronclient (>= 1:6.3.0), python-novaclient (>= 2:9.1.0), - python-openstackdocstheme (>= 1.17.0), + python-openstackdocstheme (>= 1.18.1), python-openstacksdk (>= 0.9.19), python-os-client-config (>= 1.28.0), python-os-testr (>= 1.0.0), - python-osc-lib (>= 1.7.0), + python-osc-lib (>= 1.8.0), python-oslo.i18n (>= 3.15.3), - python-oslo.utils (>= 3.31.0), + python-oslo.utils (>= 3.33.0), python-oslosphinx (>= 4.7.0), - python-oslotest (>= 1:1.10.0), + python-oslotest (>= 1:3.2.0), python-osprofiler (>= 1.4.0), python-requests (>= 2.14.2), python-requests-mock (>= 1.1.0), @@ -70,9 +70,9 @@ Build-Depends-Indep: python3-aodhclient (>= 0.9.0), python3-babel (>= 2.3.4), python3-barbicanclient (>= 4.0.0), - python3-cinderclient (>= 1:3.2.0), + python3-cinderclient (>= 1:3.3.0), python3-cliff (>= 2.8.0), - python3-congressclient (>= 1.3.0), + python3-congressclient (>= 1.9.0), python3-coverage (>= 4.0), python3-crypto, python3-designateclient (>= 2.7.0), @@ -84,22 +84,22 @@ Build-Depends-Indep: python3-ironic-inspector-client (>= 1.5.0), python3-ironicclient (>= 1.14.0), python3-keyring, - python3-keystoneauth1 (>= 3.2.0), + python3-keystoneauth1 (>= 3.3.0), python3-keystoneclient (>= 1:3.8.0), python3-mistralclient (>= 1:3.1.0), python3-mock (>= 2.0.0), python3-muranoclient (>= 0.8.2), python3-neutronclient (>= 1:6.3.0), python3-novaclient (>= 2:9.1.0), - python3-openstackdocstheme (>= 1.17.0), + python3-openstackdocstheme (>= 1.18.1), python3-openstacksdk (>= 0.9.19), python3-os-client-config (>= 1.28.0), python3-os-testr (>= 1.0.0), - python3-osc-lib (>= 1.7.0), + python3-osc-lib (>= 1.8.0), python3-oslo.i18n (>= 3.15.3), - python3-oslo.utils (>= 3.31.0), + python3-oslo.utils (>= 3.33.0), python3-oslosphinx (>= 4.7.0), - python3-oslotest (>= 1:1.10.0), + python3-oslotest (>= 1:3.2.0), python3-osprofiler (>= 1.4.0), python3-requests (>= 2.14.2), python3-requests-mock (>= 1.1.0), @@ -126,20 +126,20 @@ Package: python-openstackclient Architecture: all Depends: python-babel (>= 2.3.4), - python-cinderclient (>= 1:3.2.0), + python-cinderclient (>= 1:3.3.0), python-cliff (>= 2.8.0), python-crypto, python-glanceclient (>= 1:2.8.0), python-keyring, - python-keystoneauth1 (>= 3.2.0), + python-keystoneauth1 (>= 3.3.0), python-keystoneclient (>= 1:3.8.0), python-neutronclient (>= 1:6.3.0), python-novaclient (>= 2:9.1.0), python-openstacksdk (>= 0.9.19), python-os-client-config (>= 1.28.0), - python-osc-lib (>= 1.7.0), + python-osc-lib (>= 1.8.0), python-oslo.i18n (>= 3.15.3), - python-oslo.utils (>= 3.31.0), + python-oslo.utils (>= 3.33.0), python-pbr (>= 2.0.0), python-requests (>= 2.14.2), python-six (>= 1.10.0), @@ -187,20 +187,20 @@ Package: python3-openstackclient Architecture: all Depends: python3-babel (>= 2.3.4), - python3-cinderclient (>= 1:3.2.0), + python3-cinderclient (>= 1:3.3.0), python3-cliff (>= 2.8.0), python3-crypto, python3-glanceclient (>= 1:2.8.0), python3-keyring, - python3-keystoneauth1 (>= 3.2.0), + python3-keystoneauth1 (>= 3.3.0), python3-keystoneclient (>= 1:3.8.0), python3-neutronclient (>= 1:6.3.0), python3-novaclient (>= 2:9.1.0), python3-openstacksdk (>= 0.9.19), python3-os-client-config (>= 1.28.0), - python3-osc-lib (>= 1.7.0), + python3-osc-lib (>= 1.8.0), python3-oslo.i18n (>= 3.15.3), - python3-oslo.utils (>= 3.31.0), + python3-oslo.utils (>= 3.33.0), python3-pbr (>= 2.0.0), python3-requests (>= 2.14.2), python3-six (>= 1.10.0), diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 0000000..597b54e --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1,6 @@ +# 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. +openstackdocstheme>=1.18.1 # Apache-2.0 +reno>=2.5.0 # Apache-2.0 +sphinx!=1.6.6,>=1.6.2 # BSD diff --git a/doc/source/cli/authentication.rst b/doc/source/cli/authentication.rst index 43fcd88..b153f54 100644 --- a/doc/source/cli/authentication.rst +++ b/doc/source/cli/authentication.rst @@ -114,22 +114,22 @@ to tell the client in which domain the user and project exists. If using a user name and password to authenticate, specify either it's owning domain name or ID. - * ``--os-user-domain-name`` or ``OS_USER_DOMAIN_NAME`` +* ``--os-user-domain-name`` or ``OS_USER_DOMAIN_NAME`` - * ``--os-user-domain-id`` or ``OS_USER_DOMAIN_ID`` +* ``--os-user-domain-id`` or ``OS_USER_DOMAIN_ID`` If using a project name as authorization scope, specify either it's owning domain name or ID. - * ``--os-project-domain-name`` or ``OS_PROJECT_DOMAIN_NAME`` +* ``--os-project-domain-name`` or ``OS_PROJECT_DOMAIN_NAME`` - * ``--os-project-domain-id`` or ``OS_PROJECT_DOMAIN_ID`` +* ``--os-project-domain-id`` or ``OS_PROJECT_DOMAIN_ID`` If using a domain as authorization scope, set either it's name or ID. - * ``--os-domain-name`` or ``OS_DOMAIN_NAME`` +* ``--os-domain-name`` or ``OS_DOMAIN_NAME`` - * ``--os-domain-id`` or ``OS_DOMAIN_ID`` +* ``--os-domain-id`` or ``OS_DOMAIN_ID`` Note that if the user and project share the same domain, then simply setting ``--os-default-domain`` or ``OS_DEFAULT_DOMAIN`` to the domain ID is sufficient. diff --git a/doc/source/cli/command-objects/flavor.rst b/doc/source/cli/command-objects/flavor.rst index 6feb449..1cbd2df 100644 --- a/doc/source/cli/command-objects/flavor.rst +++ b/doc/source/cli/command-objects/flavor.rst @@ -44,7 +44,7 @@ Create new flavor .. option:: --swap <size-mb> - Swap space size in MB (default 0M) + Additional swap space size in MB (default 0M) .. option:: --vcpus <num-cpu> diff --git a/doc/source/cli/command-objects/floating-ip.rst b/doc/source/cli/command-objects/floating-ip.rst index f2f101d..d9ed230 100644 --- a/doc/source/cli/command-objects/floating-ip.rst +++ b/doc/source/cli/command-objects/floating-ip.rst @@ -18,6 +18,7 @@ Create floating IP [--floating-ip-address <ip-address>] [--fixed-ip-address <ip-address>] [--description <description>] + [--qos-policy <qos-policy>] [--project <project> [--project-domain <project-domain>]] <network> @@ -46,6 +47,12 @@ Create floating IP Set floating IP description *Network version 2 only* +.. option:: --qos-policy <qos-policy> + + QoS policy to attach to the floating IP (name or ID) + + *Network version 2 only* + .. option:: --project <project> Owner's project (name or ID) @@ -154,6 +161,7 @@ Set floating IP properties openstack floating ip set --port <port> [--fixed-ip-address <ip-address>] + [--qos-policy <qos-policy> | --no-qos-policy] <floating-ip> .. option:: --port <port> @@ -164,6 +172,14 @@ Set floating IP properties Fixed IP of the port (required only if port has multiple IPs) +.. option:: --qos-policy <qos-policy> + + Attach QoS policy to the floating IP (name or ID) + +.. option:: --no-qos-policy + + Remove the QoS policy attached to the floating IP + .. _floating_ip_set-floating-ip: .. describe:: <floating-ip> @@ -193,12 +209,17 @@ Unset floating IP Properties openstack floating ip unset --port + --qos-policy <floating-ip> .. option:: --port Disassociate any port associated with the floating IP +.. option:: --qos-policy + + Remove the QoS policy attached to the floating IP + .. _floating_ip_unset-floating-ip: .. describe:: <floating-ip> diff --git a/doc/source/cli/command-objects/port.rst b/doc/source/cli/command-objects/port.rst index cf29bb2..f8e8823 100644 --- a/doc/source/cli/command-objects/port.rst +++ b/doc/source/cli/command-objects/port.rst @@ -170,7 +170,7 @@ List ports openstack port list [--device-owner <device-owner>] - [--router <router> | --server <server>] + [--router <router> | --server <server> | --device-id <device-id>] [--network <network>] [--mac-address <mac-address>] [--fixed-ip subnet=<subnet>,ip-address=<ip-address>] @@ -192,6 +192,10 @@ List ports List only ports attached to this server (name or ID) +.. option:: --device-id <device-id> + + List only ports with the specified device ID + .. option:: --network <network> List only ports attached to this network (name or ID) diff --git a/openstackclient/compute/v2/flavor.py b/openstackclient/compute/v2/flavor.py index bf9921b..0f5dd74 100644 --- a/openstackclient/compute/v2/flavor.py +++ b/openstackclient/compute/v2/flavor.py @@ -91,7 +91,7 @@ class CreateFlavor(command.ShowOne): type=int, metavar="<size-mb>", default=0, - help=_("Swap space size in MB (default 0M)") + help=_("Additional swap space size in MB (default 0M)") ) parser.add_argument( "--vcpus", diff --git a/openstackclient/compute/v2/service.py b/openstackclient/compute/v2/service.py index b5b9bd5..7331d29 100644 --- a/openstackclient/compute/v2/service.py +++ b/openstackclient/compute/v2/service.py @@ -142,7 +142,7 @@ class SetService(command.Command): "--disable-reason", default=None, metavar="<reason>", - help=_("Reason for disabling the service (in quotas). " + help=_("Reason for disabling the service (in quotes). " "Should be used with --disable option.") ) up_down_group = parser.add_mutually_exclusive_group() diff --git a/openstackclient/image/v2/image.py b/openstackclient/image/v2/image.py index d793c45..7e6a7aa 100644 --- a/openstackclient/image/v2/image.py +++ b/openstackclient/image/v2/image.py @@ -17,6 +17,7 @@ import argparse import logging +import sys from glanceclient.common import utils as gc_utils from osc_lib.cli import parseractions @@ -649,6 +650,12 @@ class SaveImage(command.Command): ) data = image_client.images.data(image.id) + if data.wrapped is None: + msg = _('Image %s has no data.') % image.id + LOG.error(msg) + sys.stdout.write(msg + '\n') + raise SystemExit + gc_utils.save_image(data, parsed_args.file) @@ -1024,9 +1031,7 @@ class UnsetImage(command.Command): if parsed_args.properties: for k in parsed_args.properties: - try: - assert(k in image.keys()) - except AssertionError: + if k not in image: LOG.error(_("property unset failed, '%s' is a " "nonexistent property "), k) propret += 1 diff --git a/openstackclient/network/client.py b/openstackclient/network/client.py index 6f74303..5183cbd 100644 --- a/openstackclient/network/client.py +++ b/openstackclient/network/client.py @@ -41,28 +41,36 @@ API_VERSIONS = { def make_client(instance): """Returns a network proxy""" - if profile is None: - # New SDK - conn = connection.Connection( - config=instance._cli_options, - session=instance.session) - else: - prof = profile.Profile() - prof.set_region(API_NAME, instance.region_name) - prof.set_version(API_NAME, instance._api_version[API_NAME]) - prof.set_interface(API_NAME, instance.interface) - conn = connection.Connection(authenticator=instance.session.auth, - verify=instance.session.verify, - cert=instance.session.cert, - profile=prof) + if getattr(instance, "sdk_connection", None) is None: + if profile is None: + # If the installed OpenStackSDK is new enough to not require a + # Profile obejct and osc-lib is not new enough to have created + # it for us, make an SDK Connection. + # NOTE(dtroyer): This can be removed when this bit is in the + # released osc-lib in requirements.txt. + conn = connection.Connection( + config=instance._cli_options, + session=instance.session, + ) + else: + # Fall back to the original Connection creation + prof = profile.Profile() + prof.set_region(API_NAME, instance.region_name) + prof.set_version(API_NAME, instance._api_version[API_NAME]) + prof.set_interface(API_NAME, instance.interface) + conn = connection.Connection( + authenticator=instance.session.auth, + verify=instance.session.verify, + cert=instance.session.cert, + profile=prof, + ) + + instance.sdk_connection = conn + + conn = instance.sdk_connection LOG.debug('Connection: %s', conn) LOG.debug('Network client initialized using OpenStack SDK: %s', conn.network) - - # NOTE(dtroyer): Horrible ugly hack since we don't actually save - # the connection anywhere yet, so stash it in the - # instance directly from here for other uses - instance.sdk_connection = conn return conn.network diff --git a/openstackclient/network/v2/floating_ip.py b/openstackclient/network/v2/floating_ip.py index 05b688a..181f88c 100644 --- a/openstackclient/network/v2/floating_ip.py +++ b/openstackclient/network/v2/floating_ip.py @@ -67,6 +67,10 @@ def _get_attrs(client_manager, parsed_args): if parsed_args.fixed_ip_address: attrs['fixed_ip_address'] = parsed_args.fixed_ip_address + if parsed_args.qos_policy: + attrs['qos_policy_id'] = network_client.find_qos_policy( + parsed_args.qos_policy, ignore_missing=False).id + if parsed_args.description is not None: attrs['description'] = parsed_args.description @@ -170,6 +174,11 @@ class CreateFloatingIP(common.NetworkAndComputeShowOne): help=_("Fixed IP address mapped to the floating IP") ) parser.add_argument( + '--qos-policy', + metavar='<qos-policy>', + help=_("Attach QoS policy to the floating IP (name or ID)") + ) + parser.add_argument( '--description', metavar='<description>', help=_('Set floating IP description') @@ -462,6 +471,17 @@ class SetFloatingIP(command.Command): help=_("Fixed IP of the port " "(required only if port has multiple IPs)") ) + qos_policy_group = parser.add_mutually_exclusive_group() + qos_policy_group.add_argument( + '--qos-policy', + metavar='<qos-policy>', + help=_("Attach QoS policy to the floating IP (name or ID)") + ) + qos_policy_group.add_argument( + '--no-qos-policy', + action='store_true', + help=_("Remove the QoS policy attached to the floating IP") + ) return parser def take_action(self, parsed_args): @@ -479,6 +499,13 @@ class SetFloatingIP(command.Command): if parsed_args.fixed_ip_address: attrs['fixed_ip_address'] = parsed_args.fixed_ip_address + if parsed_args.qos_policy: + attrs['qos_policy_id'] = client.find_qos_policy( + parsed_args.qos_policy, ignore_missing=False).id + + if 'no_qos_policy' in parsed_args and parsed_args.no_qos_policy: + attrs['qos_policy_id'] = None + client.update_ip(obj, **attrs) @@ -549,6 +576,12 @@ class UnsetFloatingIP(command.Command): default=False, help=_("Disassociate any port associated with the floating IP") ) + parser.add_argument( + '--qos-policy', + action='store_true', + default=False, + help=_("Remove the QoS policy attached to the floating IP") + ) return parser def take_action(self, parsed_args): @@ -559,8 +592,11 @@ class UnsetFloatingIP(command.Command): parsed_args.floating_ip, ignore_missing=False, ) + attrs = {} if parsed_args.port: - attrs = { - 'port_id': None, - } + attrs['port_id'] = None + if parsed_args.qos_policy: + attrs['qos_policy_id'] = None + + if attrs: client.update_ip(obj, **attrs) diff --git a/openstackclient/network/v2/port.py b/openstackclient/network/v2/port.py index 4b23b33..032e178 100644 --- a/openstackclient/network/v2/port.py +++ b/openstackclient/network/v2/port.py @@ -499,6 +499,11 @@ class ListPort(command.Lister): metavar='<server>', help=_("List only ports attached to this server (name or ID)"), ) + device_group.add_argument( + '--device-id', + metavar='<device-id>', + help=_("List only ports with the specified device ID") + ) parser.add_argument( '--mac-address', metavar='<mac-address>', @@ -553,6 +558,8 @@ class ListPort(command.Lister): column_headers += ('Security Groups', 'Device Owner', 'Tags') if parsed_args.device_owner is not None: filters['device_owner'] = parsed_args.device_owner + if parsed_args.device_id is not None: + filters['device_id'] = parsed_args.device_id if parsed_args.router: _router = network_client.find_router(parsed_args.router, ignore_missing=False) @@ -584,9 +591,11 @@ class ListPort(command.Lister): data = network_client.ports(**filters) - return (column_headers, + headers, attrs = utils.calculate_header_and_attrs( + column_headers, columns, parsed_args) + return (headers, (utils.get_item_properties( - s, columns, + s, attrs, formatters=_formatters, ) for s in data)) diff --git a/openstackclient/tests/functional/network/v2/test_port.py b/openstackclient/tests/functional/network/v2/test_port.py index a705979..7357c0e 100644 --- a/openstackclient/tests/functional/network/v2/test_port.py +++ b/openstackclient/tests/functional/network/v2/test_port.py @@ -131,6 +131,16 @@ class PortTests(common.NetworkTagTests): self.assertNotIn(mac1, item_map.values()) self.assertIn(mac2, item_map.values()) + # Test list with unknown fields + json_output = json.loads(self.openstack( + 'port list -f json -c ID -c Name -c device_id' + )) + id_list = [p['ID'] for p in json_output] + self.assertIn(id1, id_list) + self.assertIn(id2, id_list) + # Check an unknown field exists + self.assertIn('device_id', json_output[0]) + def test_port_set(self): """Test create, set, show, delete""" name = uuid.uuid4().hex diff --git a/openstackclient/tests/functional/run_ostestr.sh b/openstackclient/tests/functional/run_stestr.sh index a6adad9..229b42b 100755 --- a/openstackclient/tests/functional/run_ostestr.sh +++ b/openstackclient/tests/functional/run_stestr.sh @@ -13,4 +13,4 @@ fi echo 'Running tests with:' env | grep OS -ostestr $* +stestr run $* diff --git a/openstackclient/tests/unit/image/v2/test_image.py b/openstackclient/tests/unit/image/v2/test_image.py index 383619e..e1a79d1 100644 --- a/openstackclient/tests/unit/image/v2/test_image.py +++ b/openstackclient/tests/unit/image/v2/test_image.py @@ -15,6 +15,7 @@ import copy +from glanceclient.common import utils as glanceclient_utils from glanceclient.v2 import schemas import mock from osc_lib import exceptions @@ -1505,3 +1506,53 @@ class TestImageUnset(TestImage): self.image.id, 'test' ) self.assertIsNone(result) + + +class TestImageSave(TestImage): + + image = image_fakes.FakeImage.create_one_image({}) + + def setUp(self): + super(TestImageSave, self).setUp() + + # Generate a request id + self.resp = mock.MagicMock() + self.resp.headers['x-openstack-request-id'] = 'req_id' + + # Get the command object to test + self.cmd = image.SaveImage(self.app, None) + + def test_save_data(self): + req_id_proxy = glanceclient_utils.RequestIdProxy( + ['some_data', self.resp] + ) + self.images_mock.data.return_value = req_id_proxy + + arglist = ['--file', '/path/to/file', self.image.id] + + verifylist = [ + ('file', '/path/to/file'), + ('image', self.image.id) + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + with mock.patch('glanceclient.common.utils.save_image') as mocked_save: + self.cmd.take_action(parsed_args) + mocked_save.assert_called_once_with(req_id_proxy, '/path/to/file') + + def test_save_no_data(self): + req_id_proxy = glanceclient_utils.RequestIdProxy( + [None, self.resp] + ) + self.images_mock.data.return_value = req_id_proxy + + arglist = ['--file', '/path/to/file', self.image.id] + + verifylist = [ + ('file', '/path/to/file'), + ('image', self.image.id) + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + # Raise SystemExit if no data was provided. + self.assertRaises(SystemExit, self.cmd.take_action, parsed_args) diff --git a/openstackclient/tests/unit/network/v2/fakes.py b/openstackclient/tests/unit/network/v2/fakes.py index bdc1c1f..a77cab8 100644 --- a/openstackclient/tests/unit/network/v2/fakes.py +++ b/openstackclient/tests/unit/network/v2/fakes.py @@ -1378,6 +1378,7 @@ class FakeFloatingIP(object): 'port_id': 'port-id-' + uuid.uuid4().hex, 'tenant_id': 'project-id-' + uuid.uuid4().hex, 'description': 'floating-ip-description-' + uuid.uuid4().hex, + 'qos_policy_id': 'qos-policy-id-' + uuid.uuid4().hex, } # Overwrite default attributes. diff --git a/openstackclient/tests/unit/network/v2/test_floating_ip_network.py b/openstackclient/tests/unit/network/v2/test_floating_ip_network.py index 4fbbc82..86f64cc 100644 --- a/openstackclient/tests/unit/network/v2/test_floating_ip_network.py +++ b/openstackclient/tests/unit/network/v2/test_floating_ip_network.py @@ -62,6 +62,7 @@ class TestCreateFloatingIPNetwork(TestFloatingIPNetwork): 'id', 'port_id', 'project_id', + 'qos_policy_id', 'router_id', 'status', ) @@ -76,6 +77,7 @@ class TestCreateFloatingIPNetwork(TestFloatingIPNetwork): floating_ip.id, floating_ip.port_id, floating_ip.project_id, + floating_ip.qos_policy_id, floating_ip.router_id, floating_ip.status, ) @@ -197,6 +199,28 @@ class TestCreateFloatingIPNetwork(TestFloatingIPNetwork): self.assertEqual(self.columns, columns) self.assertEqual(self.data, data) + def test_create_floating_ip_with_qos(self): + qos_policy = network_fakes.FakeNetworkQosPolicy.create_one_qos_policy() + self.network.find_qos_policy = mock.Mock(return_value=qos_policy) + arglist = [ + '--qos-policy', qos_policy.id, + self.floating_ip.floating_network_id, + ] + verifylist = [ + ('network', self.floating_ip.floating_network_id), + ('qos_policy', qos_policy.id), + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + columns, data = self.cmd.take_action(parsed_args) + + self.network.create_ip.assert_called_once_with(**{ + 'floating_network_id': self.floating_ip.floating_network_id, + 'qos_policy_id': qos_policy.id, + }) + self.assertEqual(self.columns, columns) + self.assertEqual(self.data, data) + class TestDeleteFloatingIPNetwork(TestFloatingIPNetwork): @@ -538,6 +562,7 @@ class TestShowFloatingIPNetwork(TestFloatingIPNetwork): 'id', 'port_id', 'project_id', + 'qos_policy_id', 'router_id', 'status', ) @@ -552,6 +577,7 @@ class TestShowFloatingIPNetwork(TestFloatingIPNetwork): floating_ip.id, floating_ip.port_id, floating_ip.project_id, + floating_ip.qos_policy_id, floating_ip.router_id, floating_ip.status, ) @@ -677,6 +703,76 @@ class TestSetFloatingIP(TestFloatingIPNetwork): self.network.update_ip.assert_called_once_with( self.floating_ip, **attrs) + @mock.patch( + "openstackclient.tests.unit.network.v2.test_floating_ip_network." + + "fip._find_floating_ip" + ) + def test_port_and_qos_policy_option(self, find_floating_ip_mock): + qos_policy = network_fakes.FakeNetworkQosPolicy.create_one_qos_policy() + self.network.find_qos_policy = mock.Mock(return_value=qos_policy) + find_floating_ip_mock.side_effect = [ + self.floating_ip, + ] + arglist = [ + "--qos-policy", qos_policy.id, + '--port', self.floating_ip.port_id, + self.floating_ip.id, + ] + verifylist = [ + ('qos_policy', qos_policy.id), + ('port', self.floating_ip.port_id), + ('floating_ip', self.floating_ip.id), + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + self.cmd.take_action(parsed_args) + + attrs = { + 'qos_policy_id': qos_policy.id, + 'port_id': self.floating_ip.port_id, + } + find_floating_ip_mock.assert_called_once_with( + mock.ANY, + self.floating_ip.id, + ignore_missing=False, + ) + self.network.update_ip.assert_called_once_with( + self.floating_ip, **attrs) + + @mock.patch( + "openstackclient.tests.unit.network.v2.test_floating_ip_network." + + "fip._find_floating_ip" + ) + def test_port_and_no_qos_policy_option(self, find_floating_ip_mock): + find_floating_ip_mock.side_effect = [ + self.floating_ip, + ] + arglist = [ + "--no-qos-policy", + '--port', self.floating_ip.port_id, + self.floating_ip.id, + ] + verifylist = [ + ('no_qos_policy', True), + ('port', self.floating_ip.port_id), + ('floating_ip', self.floating_ip.id), + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + self.cmd.take_action(parsed_args) + + attrs = { + 'qos_policy_id': None, + 'port_id': self.floating_ip.port_id, + } + find_floating_ip_mock.assert_called_once_with( + mock.ANY, + self.floating_ip.id, + ignore_missing=False, + ) + self.network.update_ip.assert_called_once_with( + self.floating_ip, **attrs) + class TestUnsetFloatingIP(TestFloatingIPNetwork): @@ -732,3 +828,36 @@ class TestUnsetFloatingIP(TestFloatingIPNetwork): self.floating_ip, **attrs) self.assertIsNone(result) + + @mock.patch( + "openstackclient.tests.unit.network.v2.test_floating_ip_network." + + "fip._find_floating_ip" + ) + def test_floating_ip_unset_qos_policy(self, find_floating_ip_mock): + find_floating_ip_mock.side_effect = [ + self.floating_ip, + ] + arglist = [ + self.floating_ip.id, + "--qos-policy", + ] + verifylist = [ + ('floating_ip', self.floating_ip.id), + ('qos_policy', True), + ] + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + result = self.cmd.take_action(parsed_args) + + attrs = { + 'qos_policy_id': None, + } + find_floating_ip_mock.assert_called_once_with( + mock.ANY, + self.floating_ip.id, + ignore_missing=False, + ) + self.network.update_ip.assert_called_once_with( + self.floating_ip, **attrs) + + self.assertIsNone(result) diff --git a/openstackclient/tests/unit/network/v2/test_port.py b/openstackclient/tests/unit/network/v2/test_port.py index 3f75181..908177c 100644 --- a/openstackclient/tests/unit/network/v2/test_port.py +++ b/openstackclient/tests/unit/network/v2/test_port.py @@ -759,6 +759,25 @@ class TestListPort(TestPort): self.assertEqual(self.columns, columns) self.assertEqual(self.data, list(data)) + def test_port_list_device_id_opt(self): + arglist = [ + '--device-id', self._ports[0].device_id, + ] + + verifylist = [ + ('device_id', self._ports[0].device_id) + ] + + parsed_args = self.check_parser(self.cmd, arglist, verifylist) + + columns, data = self.cmd.take_action(parsed_args) + + self.network.ports.assert_called_once_with(**{ + 'device_id': self._ports[0].device_id + }) + self.assertEqual(self.columns, columns) + self.assertEqual(self.data, list(data)) + def test_port_list_device_owner_opt(self): arglist = [ '--device-owner', self._ports[0].device_owner, diff --git a/playbooks/osc-devstack/post.yaml b/playbooks/osc-devstack/post.yaml index db7ca7d..a198364 100644 --- a/playbooks/osc-devstack/post.yaml +++ b/playbooks/osc-devstack/post.yaml @@ -1,4 +1,3 @@ - hosts: all roles: - - fetch-tox-output - - fetch-stestr-output + - fetch-subunit-output diff --git a/playbooks/osc-devstack/run.yaml b/playbooks/osc-devstack/run.yaml index 22f8209..d1101dd 100644 --- a/playbooks/osc-devstack/run.yaml +++ b/playbooks/osc-devstack/run.yaml @@ -1,3 +1,5 @@ - hosts: all + environment: + OS_CLOUD: devstack-admin roles: - tox diff --git a/python_openstackclient.egg-info/PKG-INFO b/python_openstackclient.egg-info/PKG-INFO index 332976b..896b10e 100644 --- a/python_openstackclient.egg-info/PKG-INFO +++ b/python_openstackclient.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: python-openstackclient -Version: 3.13.0 +Version: 3.14.0 Summary: OpenStack Command-line Client Home-page: https://docs.openstack.org/python-openstackclient/latest/ Author: OpenStack diff --git a/python_openstackclient.egg-info/SOURCES.txt b/python_openstackclient.egg-info/SOURCES.txt index 36b87a7..6cabe44 100644 --- a/python_openstackclient.egg-info/SOURCES.txt +++ b/python_openstackclient.egg-info/SOURCES.txt @@ -16,6 +16,7 @@ setup.py test-requirements.txt tox.ini doc/Makefile +doc/requirements.txt doc/source/conf.py doc/source/index.rst doc/source/_extra/.htaccess @@ -265,7 +266,7 @@ openstackclient/object/v1/object.py openstackclient/tests/__init__.py openstackclient/tests/functional/__init__.py openstackclient/tests/functional/base.py -openstackclient/tests/functional/run_ostestr.sh +openstackclient/tests/functional/run_stestr.sh openstackclient/tests/functional/common/__init__.py openstackclient/tests/functional/common/test_availability_zone.py openstackclient/tests/functional/common/test_configuration.py @@ -558,6 +559,7 @@ python_openstackclient.egg-info/requires.txt python_openstackclient.egg-info/top_level.txt releasenotes/notes/.placeholder releasenotes/notes/add-auto-and-none-as-nic-parameter-ed23a6e7f99f250d.yaml +releasenotes/notes/add-device_id-to-port-list-0c658db51ce43c9e.yaml releasenotes/notes/add-disable-reason-6e0f28459a09a60d.yaml releasenotes/notes/add-dns-nameserver-overwrite-option-b866baeae12f9460.yaml releasenotes/notes/add-ha-to-router-update-6a38a73cc112b2fc.yaml @@ -620,6 +622,7 @@ releasenotes/notes/bp-neutron-client-metering-1ee703a48343ece1.yaml releasenotes/notes/bp-neutron-client-metering-6f8f9527c2a797fd.yaml releasenotes/notes/bp-neutron-client-rbac-bbd7b545b50d2bdf.yaml releasenotes/notes/bp-neutron-client-tag-ff24d13e5c70e052.yaml +releasenotes/notes/bp-neutron-floating-ip-rate-limit-8387c040a6fb9acd.yaml releasenotes/notes/bp-routed-networks-3b502faa5cd96807.yaml releasenotes/notes/bp-routed-networks-3eea4978c93aa126.yaml releasenotes/notes/bp-routed-networks-86a24f34d86fca53.yaml @@ -858,6 +861,7 @@ releasenotes/notes/bug-1731848-71d0a5fdb1a34a8b.yaml releasenotes/notes/bug-1732216-b41bfedebff911e1.yaml releasenotes/notes/bug-1732938-e4d91732ef777f9a.yaml releasenotes/notes/bug-1735836-9be6d777a6e6410b.yaml +releasenotes/notes/bug-1741223-7a5c5b6e7f232628.yaml releasenotes/notes/bug-volume-list-with-project-2dc867c5e8346a66.yaml releasenotes/notes/change-098377fd53cce7a0.yaml releasenotes/notes/cliff-2.3.0-7ead18fae9ceea80.yaml diff --git a/python_openstackclient.egg-info/pbr.json b/python_openstackclient.egg-info/pbr.json index 971d43e..805ad31 100644 --- a/python_openstackclient.egg-info/pbr.json +++ b/python_openstackclient.egg-info/pbr.json @@ -1 +1 @@ -{"git_version": "8c5f755", "is_release": true}
\ No newline at end of file +{"git_version": "fbee4eb", "is_release": true}
\ No newline at end of file diff --git a/python_openstackclient.egg-info/requires.txt b/python_openstackclient.egg-info/requires.txt index e7a10a2..8225ea2 100644 --- a/python_openstackclient.egg-info/requires.txt +++ b/python_openstackclient.egg-info/requires.txt @@ -2,12 +2,12 @@ pbr!=2.1.0,>=2.0.0 six>=1.10.0 Babel!=2.4.0,>=2.3.4 cliff!=2.9.0,>=2.8.0 -keystoneauth1>=3.2.0 +keystoneauth1>=3.3.0 openstacksdk>=0.9.19 -osc-lib>=1.7.0 +osc-lib>=1.8.0 oslo.i18n>=3.15.3 -oslo.utils>=3.31.0 +oslo.utils>=3.33.0 python-glanceclient>=2.8.0 python-keystoneclient>=3.8.0 python-novaclient>=9.1.0 -python-cinderclient>=3.2.0 +python-cinderclient>=3.3.0 diff --git a/releasenotes/notes/add-device_id-to-port-list-0c658db51ce43c9e.yaml b/releasenotes/notes/add-device_id-to-port-list-0c658db51ce43c9e.yaml new file mode 100644 index 0000000..05dae9e --- /dev/null +++ b/releasenotes/notes/add-device_id-to-port-list-0c658db51ce43c9e.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Add ``--device-id`` option to the ``port list`` command. diff --git a/releasenotes/notes/bp-neutron-floating-ip-rate-limit-8387c040a6fb9acd.yaml b/releasenotes/notes/bp-neutron-floating-ip-rate-limit-8387c040a6fb9acd.yaml new file mode 100644 index 0000000..d0aa9cd --- /dev/null +++ b/releasenotes/notes/bp-neutron-floating-ip-rate-limit-8387c040a6fb9acd.yaml @@ -0,0 +1,11 @@ +--- +features: + - | + Add support for attaching and removing qos policy to floating IPs. + + Add option ``--qos-policy`` to the ``floating ip create`` and + ``floating ip set`` commands to add qos policy to a floating IP. + + Add option ``--no-qos-policy`` to the ``floating ip set`` and option + ``--qos-policy`` to the ``floating ip unset`` command to remove the + qos policy from a floating IP. diff --git a/releasenotes/notes/bug-1741223-7a5c5b6e7f232628.yaml b/releasenotes/notes/bug-1741223-7a5c5b6e7f232628.yaml new file mode 100644 index 0000000..2c3a0ef --- /dev/null +++ b/releasenotes/notes/bug-1741223-7a5c5b6e7f232628.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + 'NoneType' object is not iterable when Glance cannot find image data in its + backend. + [Bug `1741223 <https://bugs.launchpad.net/ironic/+bug/1741223>`_] diff --git a/requirements.txt b/requirements.txt index 9299891..a1c48a5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,12 +6,12 @@ six>=1.10.0 # MIT Babel!=2.4.0,>=2.3.4 # BSD cliff!=2.9.0,>=2.8.0 # Apache-2.0 -keystoneauth1>=3.2.0 # Apache-2.0 +keystoneauth1>=3.3.0 # Apache-2.0 openstacksdk>=0.9.19 # Apache-2.0 -osc-lib>=1.7.0 # Apache-2.0 +osc-lib>=1.8.0 # Apache-2.0 oslo.i18n>=3.15.3 # Apache-2.0 -oslo.utils>=3.31.0 # Apache-2.0 +oslo.utils>=3.33.0 # Apache-2.0 python-glanceclient>=2.8.0 # Apache-2.0 python-keystoneclient>=3.8.0 # Apache-2.0 python-novaclient>=9.1.0 # Apache-2.0 -python-cinderclient>=3.2.0 # Apache-2.0 +python-cinderclient>=3.3.0 # Apache-2.0 diff --git a/test-requirements.txt b/test-requirements.txt index fcd7bc7..b1ef7d6 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,16 +7,12 @@ coverage!=4.4,>=4.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD flake8-import-order==0.13 # LGPLv3 mock>=2.0.0 # BSD -openstackdocstheme>=1.17.0 # Apache-2.0 -oslotest>=1.10.0 # Apache-2.0 -reno>=2.5.0 # Apache-2.0 +oslotest>=3.2.0 # Apache-2.0 requests>=2.14.2 # Apache-2.0 requests-mock>=1.1.0 # Apache-2.0 -sphinx>=1.6.2 # BSD stevedore>=1.20.0 # Apache-2.0 os-client-config>=1.28.0 # Apache-2.0 -os-testr>=1.0.0 # Apache-2.0 -testrepository>=0.0.18 # Apache-2.0/BSD +stestr>=1.0.0 # Apache-2.0 testtools>=2.2.0 # MIT tempest>=17.1.0 # Apache-2.0 osprofiler>=1.4.0 # Apache-2.0 @@ -27,7 +23,7 @@ wrapt>=1.7.0 # BSD License aodhclient>=0.9.0 # Apache-2.0 gnocchiclient>=3.3.1 # Apache-2.0 python-barbicanclient!=4.5.0,!=4.5.1,>=4.0.0 # Apache-2.0 -python-congressclient<2000,>=1.3.0 # Apache-2.0 +python-congressclient<2000,>=1.9.0 # Apache-2.0 python-designateclient>=2.7.0 # Apache-2.0 python-heatclient>=1.10.0 # Apache-2.0 python-ironicclient>=1.14.0 # Apache-2.0 @@ -36,11 +32,11 @@ python-karborclient>=0.6.0 # Apache-2.0 python-mistralclient>=3.1.0 # Apache-2.0 python-muranoclient>=0.8.2 # Apache-2.0 python-neutronclient>=6.3.0 # Apache-2.0 -python-octaviaclient>=1.0.0 # Apache-2.0 +python-octaviaclient>=1.3.0 # Apache-2.0 python-rsdclient>=0.1.0 # Apache-2.0 python-saharaclient>=1.4.0 # Apache-2.0 python-searchlightclient>=1.0.0 #Apache-2.0 python-senlinclient>=1.1.0 # Apache-2.0 python-troveclient>=2.2.0 # Apache-2.0 python-zaqarclient>=1.0.0 # Apache-2.0 -python-zunclient>=0.2.0 # Apache-2.0 +python-zunclient>=1.0.0 # Apache-2.0 @@ -14,8 +14,8 @@ deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -r{toxinidir}/test-requirements.txt -r{toxinidir}/requirements.txt -commands = ostestr {posargs} -whitelist_externals = ostestr +commands = stestr run {posargs} +whitelist_externals = stestr [testenv:fast8] # Use same environment directory as pep8 env to save space and install time @@ -63,20 +63,20 @@ commands = pip install -q -U -e "git+file://{toxinidir}/../os-client-config#egg=os_client_config" pip install -q -e "git+file://{toxinidir}/../python-openstacksdk#egg=openstacksdk" pip freeze - ostestr {posargs} -whitelist_externals = ostestr + stestr run {posargs} +whitelist_externals = stestr [testenv:functional] setenv = OS_TEST_PATH=./openstackclient/tests/functional passenv = OS_* -whitelist_externals = openstackclient/tests/functional/run_ostestr.sh +whitelist_externals = openstackclient/tests/functional/run_stestr.sh commands = - {toxinidir}/openstackclient/tests/functional/run_ostestr.sh {posargs} + {toxinidir}/openstackclient/tests/functional/run_stestr.sh {posargs} [testenv:functional-tips] setenv = OS_TEST_PATH=./openstackclient/tests/functional passenv = OS_* -whitelist_externals = openstackclient/tests/functional/run_ostestr.sh +whitelist_externals = openstackclient/tests/functional/run_stestr.sh commands = pip install -q -U -e "git+file://{toxinidir}/../cliff#egg=cliff" pip install -q -U -e "git+file://{toxinidir}/../keystoneauth#egg=keystoneauth" @@ -84,15 +84,20 @@ commands = pip install -q -U -e "git+file://{toxinidir}/../os-client-config#egg=os_client_config" pip install -q -U -e "git+file://{toxinidir}/../python-openstacksdk#egg=openstacksdk" pip freeze - {toxinidir}/openstackclient/tests/functional/run_ostestr.sh {posargs} + {toxinidir}/openstackclient/tests/functional/run_stestr.sh {posargs} [testenv:venv] commands = {posargs} [testenv:cover] +setenv = + VIRTUAL_ENV={envdir} + PYTHON=coverage run --source openstackclient --parallel-mode commands = - python setup.py test --coverage --testr-args='{posargs}' - coverage report + stestr -q run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:debug] passenv = OS_* @@ -100,10 +105,19 @@ commands = oslo_debug_helper -t openstackclient/tests {posargs} [testenv:docs] +deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} + -r{toxinidir}/requirements.txt + -r{toxinidir}/doc/requirements.txt commands = python setup.py build_sphinx [testenv:releasenotes] -commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html +deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} + -r{toxinidir}/requirements.txt + -r{toxinidir}/doc/requirements.txt +commands = + sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [flake8] show-source = True |
