Add the `description` field to Floating IP Port Forwardings
Depends-On: https://review.opendev.org/#/c/705038/
Change-Id: I6477368e32570c96cacddba4f86455262e533277
Implements: blueprint portforwarding-description
Closes-Bug: #1850818
Add support for stateful attribute of security groups,
using --stateful and --no-stateful flag on security group.
This allows a user to create security groups with stateful
false.
Change-Id: Ifd20b5fc47fd0ea0bb5aeda84820dcc0fb1e8847
Blueprint: stateless-security-groups
Depends-On: https://review.opendev.org/711513/
Add commands to osc to call the two new API methods introduced by
new Neutron extension: extraroute-atomic.
Bump our openstacksdk requirement to >=0.38.0 which contains
the corresponding sdk change.
The lower-constraints of dogpile.cache and keystoneauth1 are bumped
because of requirements bumps in openstacksdk.
The lower-constraint of decorator is bumped because of problem already
fixed by amotoki here: https://review.opendev.org/701706
Change-Id: Ia9b9c216f1d1161ebedac31594a2c464d77f4ae2
Depends-On: https://review.opendev.org/674324
Partial-Bug: #1826396 (rfe)
Related-Change: https://review.opendev.org/655680 (spec)
There is a much deeper and systemic issue going on here, but let's
start with fixing the immediate issue which is that adding a project
to an image fails trying to look up project information even if the
user passes the project id by id.
_is_uuid_like from sdk isn't perfect, but it'll be good enough
for this.
Change-Id: I541416d737b961c56aa2f584c172528632fd5537
In https://review.opendev.org/#/c/650374/ a work has been started to
switch image service support from glanceclient with all it's
dependencies to the SDK version. With this change version 1 (anyway
deprecated since ages) is also being switched to SDK.
Change-Id: Ic391500af02a73d81d64a9e9113cca85c9e24390
I'm guessing we should do this for everyone, but we have volume on
the brain right now. Rackspace is in the weird situation where
they do support v2 but only have v1 in the catalog (wut) So we
need to override the block-storage enpdoint by config. To do that,
we need to actually honor the config setting over here in OSC.
NOTE: We need to systemically overhaul how we're injesting config
over here - because there's too much variation. But we can leave
that for another day.
Story: 2007459
Task: 39137
Change-Id: Ifddf1ddd5abaa768ab18049c09d18bc269f3a4f5
This is a work to switch OSC from using glanceclient to OpenStackSDK.
With this change only v2 is using OpenStackSDK. V1 is still using
glanceclient and will be switched in a separate change.
Remove the direct depend on keystoneauth- let that flow through
openstacksdk.
Depends-on: https://review.opendev.org/#/c/698972
Change-Id: I36f292fb70c98f6e558f58be55d533d979c47ca7
This function should return an ordered set of ranges based on an
unordered list of numbers (int or str).
Change-Id: I918c8befc51236cc33d96a5c88fb6eafdd143e9c
Story: 2007341
Task: 38878
This new query parameter will allow to send a query sending the
"fields" parameter. This "fields" parameter contains the needed
API fields, translated into OVO fields in Neutron server, that
require to be retrieved from the DB.
As commented in the related bug, the OSC "list" command only
prints five parameters, none of them the security group rules. In
systems with a reasonable amount of security groups, skipping the
unnecessary rule load can save a lot of time.
Depends-On: https://review.opendev.org/#/c/710820/
Change-Id: I16f48e292997d029d68f66365db949b9f4b5a0c8
Closes-Bug: #1865223
The ``--default`` option should be only used for external network.
Default internal network is not currently supported so we disallow
it for now.
Change-Id: Ia9d39b40e1e041d7bda0f6a27d058e382b572e1a
Closes-Bug: #1745658
+ Add CLI option to specify swift storage policy
+ Add CLI flag to specify container uses public read ACLS
+ Show storage policy in container show data
Change-Id: I08ffa0d98bd39d467aa415771675f59bd77768ff
Added "qos_network_policy_id" to "port show" command. Because this is
just a read-only parameter and is read from the SDK port definition,
this patch only modifies the corresponding tests.
This patch is adding this new parameter to the test bench.
Change-Id: Ice7423e0e0b98a39cc36622b70eae5a8493a037c
Closes-Bug: #1851362
Does what it says on the tin. This action was added to osc-lib in change
If73cab759fa09bddf1ff519923c5972c3b2052b1.
Change-Id: I51efaa096bb26e297d99634c5d9cca34c0919074
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
The '--hint' option for 'server create' expects a key-value pair like so:
openstack server create --hint group=245e1dfe-2d0e-4139-80a9-fce124948896 ...
However, the command doesn't complain if this isn't the case, meaning
typos like the below aren't indicated to the user:
openstack server create --hint 245e1dfe-2d0e-4139-80a9-fce124948896
Due to how we'd implemented this here, this ultimately results in us
POSTing the following as part of the body to 'os-servers':
{
...
"OS-SCH-HNT:scheduler_hints": {
"245e1dfe-2d0e-4139-80a9-fce124948896": null
}
...
}
Which is unfortunately allowed and ignored by nova due to the use of
'additionalProperties' in the schema [1]
Do what we do for loads of other options and explicitly fail on invalid
values. This involves adding a new argparse action since none of those
defined in osc-lib work for us. This is included here to ease
backporting of the fix but will be moved to osc-lib in a future patch.
[1] https://github.com/openstack/nova/blob/19.0.0/nova/api/openstack/compute/schemas/servers.py#L142-L146
Change-Id: I9e96d2978912c8dfeadae4a782c481a17cd7e348
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Story: #2006628
Task: #36840
Related-Bug: #1845322
This commit introduces the --access-rules option for 'application
credential create' as well as new 'access rule' commands for listing,
showing, and deleting access rules.
bp whitelist-extension-for-app-creds
Change-Id: I04834b2874ec2a70da456a380b5bef03a392effa
This patch updates the network modules to use the new
osc_lib.utils.tags module and removes the in tree _tag.py version.
A previous patch[1] moves the _tag.py code to osc-lib to allow other
projects to leverage the code.
[1] https://review.opendev.org/662859
Change-Id: Id0c34029e327de50c5fd2732bae5fbf45bbd16ee
Follow-up to https://review.opendev.org/#/c/679834/ which
added the options and lacked both a release note and
minimal option-handling unit tests.
Change-Id: Ibb2820add9b2fedaf5a8b1a77babf043f6641724
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
We had this library capped at a release that is a few years old. Now
that we have dropped py2 testing, we can pick up the latest version.
This uncovered a few things to clean up. Mostly the fact that mock is
now a part of the StdLib unittest since Python 3.3.
Change-Id: I27484dd4c25378413ff16e97a35a1a46062357bc
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
1. As mentioned in [1], we should avoid using six.iteritems to achieve
iterators. We can use dict.items instead, as it will return iterators
in PY3 as well. And dict.items/keys will more readable.
2. In py2, the performance about list should be negligible,
see the link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I4b9edb326444264c0f6c4ad281acaac356a07e85
Implements: blueprint replace-iteritems-with-items
In case quota for the resource is set to zero "openstack quota show"
command will not map the resource name according to one of the
following dicts:
- COMPUTE_QUOTAS
- NOVA_NETWORK_QUOTAS
- VOLUME_QUOTAS
- NETWORK_QUOTAS
For example:
$ openstack quota set --secgroups 10 admin
$ openstack quota show admin -f json|egrep "(secgroups|security_groups)"
"secgroups": 10,
$ openstack quota set --secgroups 0 admin
$ openstack quota show admin -f json|egrep "(secgroups|security_groups)"
"security_groups": 0,
Change-Id: I94ed9e6b41b1cc692297c01e6c7582998dcacfda
This patch removes using the "name" option for a marker when
--deleted is also used. The find_resource() function
that is being called does not correctly handle using the marker
as the "name" in the search when also using deleted=True.
One simple way to fix this is force the marker to only be an ID
when --deleted is used. This is how the nova client works.
Using the --deleted option is available to users with the admin
role by default. If you're an admin listing --deleted servers
with a marker by name, find_resource() is going to fail to find
it since it doesn't apply the --deleted filter to find_resource().
The find_resource() function is trying to find the marker server
by name if it's not found by id, and to find it by name it's
listing servers with the given marker as the name, but not
applying the --deleted filter so it doesn't get back any results.
In the story it was suggested modifying find_resource to include
the deleted query param when it's specified on the command line but
that didn't work because it still results in something like this:
http://192.168.1.123/compute/v2.1/servers?deleted=True&name=4cecd49f-bc25-4a7e-826e-4aea6f9267d9
It seems like there are bugs in find_resource().
Restricting the marker to be the server ID when listing deleted servers
is probably OK since if you're using --deleted you're an admin and you could
be listing across all projects and if you're filtering by a server across all
projects anyway (not that you have to, I'm just saying if you are), or even
showing a server in another project, you have to do it by id rather than name
because find_resource() won't find the server in another project by name, only ID.
story: 2006761
Task: 37258
Change-Id: Ib878982b1d469212ca3483dcfaf407a8e1d2b417
The correct state name for a failing volume snapshot deletion is
'error_deleting' instead of 'error-deleting'. [1]
[1] 89d6a5042f/cinder/objects/fields.py (L126)
Task: #37844
Story: #2007037
Change-Id: Ia99900ece4f1cd29769b22ddaa3965789d719556
For negative tests that are asserting an argparse failure
it would be useful to assert the specific reason for the
failure in the test rather than just getting an exception,
especially to avoid false positives in the tests when what
is being tested and failing isn't the actual expected reason
for the failure.
This wraps the check_parser code that parses the args and
mocks sys.stderr so we can trap that output and put it in the
exception message that gets raised to the test.
As a result, we can tighten up a test that was passing before
for the wrong reason [1].
[1] https://review.opendev.org/#/c/673725/12/openstackclient/tests/unit/compute/v2/test_server.py@605
Change-Id: I0f1dc1215bdfb3eba98ccaf66a0041d220b93812
Added ``--disable-delete-on-termination`` and
``--enable-delete-on-termination`` options to the
``openstack server add volume`` command that enables users to mark
whether to delete the attached volume when the server is destroyed.
Depends-On: https://review.opendev.org/#/c/681267/
Part of blueprint support-delete-on-termination-in-server-attach-volume
Change-Id: I6b5cd54b82a1135335a71b9768a1a2c2012f755b
Until now-ish Volume v3 has been a pass-through to v2. In order
to prepare to make the Volume v3 commands stand-alone copy the
v2 functional tests to v3.
This is the first of a series of reviews to completely separate
Volume v2 and v3 commands. Once these are split we can begin to
implement v3 microversion support and/or start using the
OpenStack SDK as the REST library.
Change-Id: Iefd78d8ef6bb851d7360596337a88ee8f8476767
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
While investigating the referenced story/bug I noticed that
wait_for_status in
openstackclient.tests.functional.compute.v2.test_aggregate.AggregateTests
was doing a lot more than it should ever need to (it probably got copied
in from somewhere). The two places calling it only need to a) check the
output of `openstack aggregate show`, and b) try once -- since they just
got done creating the aggregate synchronously, there should never be a
need to delay/retry. So this commit removes the helper method and just
inlines the check.
At the same time, the addCleanup(aggregate delete) directives are moved
above their respective creates. This is a defensive best practice which
makes sure cleanup happens even if something fails very soon after the
actual back-end create (as was in fact the case with the referenced
bug/story).
It is unknown whether this will impact the referenced bug.
Change-Id: I0d7432f13642fbccd5ca79da9c76adfcbabb5fa9
Story: 2006811
Related-Bug: #1851391