3349 Commits

Author SHA1 Message Date
Zuul
d3691b81c6 Merge "Allow os quota list query to filter by project" 2020-06-29 22:22:25 +00:00
Zuul
abfca138d9 Merge "port: add --host to list command" 2020-06-26 01:13:35 +00:00
Mohammed Naser
307d23bb58 port: add --host to list command
This adds an option to allow filtering ports bound to a specific host
when listing them.

Change-Id: I747ed0f8b070074c51789576a158345f670fe733
2020-06-17 16:33:34 +00:00
Jens Harbott
8b7a2c8d59 Don't display Munch objects in the output
When the sdk gives us a resource that contains Munch columns, drop them
from the output as they are for programmatic usage only and have no use
in a CLI context.

Change-Id: Idd7306cd763b5a017a66e410e70e1adb02663c2a
2020-06-17 10:09:36 +00:00
Jens Harbott (frickler)
a04172969a Revert "Format location columns in network commands"
This reverts commit 6ee7b8d138e07bfc37c5cd887f7afa49cdabb02f.

Change-Id: I5f59959ba8a01aba49e29f4cb007397467344e58
2020-06-17 10:09:36 +00:00
Zuul
3e6874dc87 Merge "Remove os-client-config references" 2020-06-11 15:44:42 +00:00
Zuul
831dd3fe12 Merge "Make container list --all work" 2020-06-09 00:21:52 +00:00
Monty Taylor
7696593dc1 Remove os-client-config references
We've depended on openstacksdk for config for ages now, clean up
after ourselves and stop installing it in tests.

Change-Id: I66b3ec2a36bc462d2f1ac151e95ccbdc946076b8
2020-06-08 16:20:28 -05:00
Alfredo Moralejo
a15b1addb4 Replace assertItemsEqual with assertCountEqual
assertItemsEqual was removed from Python's unittest.TestCase in
Python 3.3 [1][2]. We have been able to use them since then, because
testtools required unittest2, which still included it. With testtools
removing Python 2.7 support [3][4], we will lose support for
assertItemsEqual, so we should switch to use assertCountEqual.

[1] - https://bugs.python.org/issue17866
[2] - https://hg.python.org/cpython/rev/d9921cb6e3cd
[3] - testing-cabal/testtools#286
[4] - testing-cabal/testtools#277

Change-Id: I1ad0da8deda3a8cbec384b5a9c88860a526eb48c
2020-06-01 16:39:54 +02:00
yanpuqing
533af9f1b2 Client should parse string to boolean for value 'is_domain'
When we use "--property" parameter, client get lists these the
value is string type, but the type of the value 'is_domain'
should be boolean, so we should judge it and parse it.
The patch parse string to boolean for value 'is_domain'.

Co-Authored-By: Lance Bragstad <lbragstad@gmail.com>

Change-Id: I37c9eb854524bde3a1530bfe2e3a03810fb1a676
Task: 30039
Story: 2005246
2020-05-29 07:53:13 -05:00
Pete Zaitcev
41a2e82939 Make container list --all work
The caller in openstackclient/object/v1/object.py passed a keyword
argument full_listing, but the eventual callee container_list()
expected all_data. So, --all did not work at all.

The issue passed undetected because --all did not have a test,
so we added a unit test.

In addition, exisiting tests were using a test set that did
not look like the real container listing, so we changed
LIST_CONTAINER_RESP to be realistic.

Change-Id: Id0604bcab25892e43c26cd6656b2b2eef5daa69b
2020-05-16 14:40:28 +00:00
Pete Zaitcev
f6ee42cd32 Cleanup: remove a useless reference to "object"
The method "object_list" does not have an argument "object",
so we were using a built-in class "object" by mistake.

Change-Id: I74687659223d31d3c3c119eee5874edff30634fd
2020-05-15 11:24:25 -05:00
Zuul
d394bac1de Merge "Resolve PEP8" 2020-05-15 07:27:35 +00:00
Pete Zaitcev
52ff421e3d Resolve PEP8
No idea how this happened, but reviews started failing the
pep8 gate job. The failures are legitimate, see the commit.
I guess the pep8 tests became smarter and found these issues.

Change-Id: Id9a0dad644134dafd68eed37fe8f41c583d7a619
2020-05-14 13:53:38 -05:00
Adam Harwell
ae67317109 Correct image lookup during server rebuild
The switch to using glance from the SDK accidentally used get_image
directly during a server rebuild, when it should have used find_image to
match existing functionality.

Bug introduced in: I36f292fb70c98f6e558f58be55d533d979c47ca7

Change-Id: I2005bd40a1bd6719670c7f7854316b4f9801b140
Story: 2007620
Task: 39643
2020-05-04 16:06:02 -07:00
Zuul
af1ffc456f Merge "Revert "Disallow setting default on internal network"" 2020-04-22 15:40:21 +00:00
Zuul
4886b02380 Merge "Use unittest.mock instead of third party mock" 2020-04-17 21:37:39 +00:00
Zuul
790ead00bb Merge "Add resource option immutable" 2020-04-17 10:25:30 +00:00
Zuul
92254bb0ac Merge "Add 'subnetpool' type support to rbac commands" 2020-04-15 08:44:49 +00:00
Zuul
347c5b9df4 Merge "Add 'address_scope' type support to network rbac commands" 2020-04-10 00:18:56 +00:00
Igor Malinovskiy
557e65d8eb Add 'subnetpool' type support to rbac commands
Change-Id: Id6e528ebd1bf21ca142e60052d28371f97f629ac
Partial-Bug: #1862032
Depends-On: https://review.opendev.org/710755
2020-04-09 19:50:38 +03:00
Vishakha Agarwal
7f66273d3f Add resource option immutable
This patch adds the --immutable and --no-immutable option to the
role, project and domain CLI.

Related-Patch: https://review.opendev.org/#/c/712182/

Change-Id: I9c3bdd741f28bf558267fb217818d947597ce13e
2020-04-08 13:51:01 +00:00
Zuul
78b18030b5 Merge "Support for stateless security groups" 2020-04-08 08:31:28 +00:00
Vasyl Saienko
bdaebeb508 Revert "Disallow setting default on internal network"
The original patch assumes that both --external and --is-default are set
in the same request and broke case when --is-default is set as an
network update. The validation logic have to be moved on API side to
avoid extra API calls from openstackclient.

This reverts commit 962efd949feb461283a9bb4a668fbd310f80ba40.

Related-Bug: #1745658

Change-Id: Idf08abb0e08a6880f89c3e9df9dd2ac82f36c432
2020-04-08 07:14:52 +00:00
Sean McGinnis
725e004d32
Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: Ibd39328c27b68190e2edbf1f52fcea52db3ae791
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-03 17:11:40 -05:00
pedro
74a7c1d9d6 Add description field to portforwarding NAT rules
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
2020-04-02 13:15:19 -03:00
Zuul
70f1ff375a Merge "Add command: router add/remove route --route" 2020-04-01 11:03:51 +00:00
Tom Stappaerts
5e62411e5f Support for stateless security groups
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/
2020-03-31 12:05:18 +02:00
Bence Romsics
dba57c85d5 Add command: router add/remove route --route
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)
2020-03-30 16:19:05 +02:00
Vishakha Agarwal
05da145eae Adding options to user cli
User options [1] can be set by making POST and PATCH
request for /v3/users API calls but cannot by openstack
CLI because of no user options defined in create and update
user CLI [2]. This patch adds the user options [1] in
create user and update user CLI.

[1] https://docs.openstack.org/keystone/latest/admin/resource-options.html#multi-factor-auth-rules
[2] https://docs.openstack.org/api-ref/identity/v3/#create-user

Change-Id: I4e41bae2e8cfbe92d52b14d856991bedcd44164f
2020-03-26 22:24:39 +05:30
Igor Malinovskiy
f03cb68ad8 Add 'address_scope' type support to network rbac commands
Change-Id: I6a4b7219934805c1bbd1e88fcc670ae231d9ac37
Partial-Bug: #1862968
Depends-On: https://review.opendev.org/709122
2020-03-26 12:40:12 +00:00
Zuul
c5719a12b5 Merge "Don't look up project by id if given id" 2020-03-25 22:10:25 +00:00
Zuul
74616cd235 Merge "Complete switch from glanceclient to SDK for image service" 2020-03-25 15:19:21 +00:00
Zuul
21c883b3d3 Merge "Switch image to use SDK" 2020-03-25 15:19:20 +00:00
Zuul
81dcc91214 Merge "Fix faulthy state argument choice" 2020-03-24 21:34:44 +00:00
Zuul
2c8d705a24 Merge "Add unit tests and release note for dns_publish_fixed_ip" 2020-03-24 21:24:52 +00:00
Zuul
77b364942a Merge "Honor endpoint override from config for volume" 2020-03-24 18:35:59 +00:00
Zuul
a0d7f98f18 Merge "Add "fields" parameter to ListSecurityGroup query" 2020-03-24 14:07:02 +00:00
Dmitriy Rabotyagov
042be7c7fe Don't look up project by id if given id
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
2020-03-24 13:13:12 +00:00
Artem Goncharov
768a64aac5 Complete switch from glanceclient to SDK for image service
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
2020-03-24 13:13:06 +00:00
Monty Taylor
cdac869412 Honor endpoint override from config for volume
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
2020-03-24 07:29:35 -05:00
Zuul
9e8960bad0 Merge "Fix network segment range "_get_ranges" function" 2020-03-23 21:41:45 +00:00
Artem Goncharov
60e7c51df4 Switch image to use SDK
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
2020-03-23 14:38:32 -05:00
Rodolfo Alonso Hernandez
27da238da2 Fix network segment range "_get_ranges" function
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
2020-03-23 14:17:14 +00:00
Zuul
fc12033f1d Merge "Now we can add description for role creation in OSC" 2020-03-20 18:59:44 +00:00
Daniel Strong
d2826e89e9 Allow setting floating IP description
Change-Id: If664bfe3c9fdcb69c7046eb16c5d32602d1b3262
Story: 2007439
Task: 39094
2020-03-18 18:10:17 +00:00
Zuul
045f133f16 Merge "Add storage policy option to create container command" 2020-03-13 22:53:48 +00:00
Zuul
37240b3b83 Merge "Add qos_network_policy_id to network port tests" 2020-03-13 22:34:37 +00:00
Jose Castro Leon
3e83e7471b Allow os quota list query to filter by project
In the os quota list command, project parameter is completely ignored
ending up in a request to all projects and then all quotas. This patch
enables back the parameter and does a single call to quotas if specified.

Change-Id: Ie17c256e2bdc307dcd94ad5be7abdbffa776d369
Story: 2007422
Task: 39043
2020-03-12 14:43:18 +01:00
Rodolfo Alonso Hernandez
711b9c9405 Add "fields" parameter to ListSecurityGroup query
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
2020-03-12 11:44:10 +00:00