Patch [0] dropped mapping the tenant_id attribute to project_id.
However, the Neutron API still returns the tenant_id attribute in
addition to the project_id and so we still need to discard it from
the output.
[0] I5f62f2a76592eaaaed6703624e959df41a6ecc8f
Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: Iba1e003bf587802f28928cb44d160b3b3fb1f840
There were a number of 'get_osc_show_columns_for_sdk_resource' defined
in-tree. However, osc-lib has provided this method for some time (since
2.2.0, June 2020 [1] - our minimum version is currently 2.3.0) so
there's no need to provide our own copies. Remove them.
[1] https://github.com/openstack/osc-lib/commit/29a0c5a5
Change-Id: I25695f4f9a379dd691b7eaa1e3247164668ae77e
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
To deprecate and drop support for neutronclient CLI and use only
OSC we need feature parity between OSC and neutronclient.
Last missing piece here is possibility to send in POST/PUT requests
unknown parameters to the Neutron server.
This patch adds such possibility to the OSC.
Change-Id: Iba09297c2be9fb9fa0be1b3dc65755277b79230e
When the openstacksdk is patched to properly support defining prefix
lengths when creating subnets, the resulting subnet show output
reveals a prefix_length column with a value of 'none'. This patch
hides the prefix_length column.
Change-Id: I59dfb0b1585ed624f9d82b3557df2ff5ff9d1b3e
Partial-Bug: 1754062
Depends-On: https://review.openstack.org/#/c/550558/
The neutron API supports filtering subnets by subnet
pool id, but the CLI was missing support for it.
Change-Id: Ic230c2c5cda8255d8f2c422880aeac81670b2df3
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
These return a Munch from the SDK, which can be handled exactly
like a dict so do that.
Note that the location column has a nested project dict in the
return value, this is addressed separately in osc_lib.format_columns
in https://review.opendev.org/#/c/679474/.
Change-Id: I99a6d192749a4ac76777f72be8118261c0521cb0
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
Use cliff formattable columns not to convert complex fields
into a string when a machine readable format like JSON or YAML
is requested.
Partial-Bug: #1687955
Partially implement blueprint osc-formattable-columns
Change-Id: I9878f327e39f56852cc0fb6e4eee9105b7141da9
If a required service is not enabled then we skip the test.
The discovery is done by tests/functional/base.py:is_service_enabled
but this method is broken, credentials are not passed to the
'openstack service show' command so every call will fail and every test
that relies on it will be skipped. This commit fixed that method and
the issues that popped up when re-enabling tests.
Network segment range:
- issue where we assumed network-segment-range extension is always
present
- issue where we compare integers and string representations of numbers
Subnet:
- issue where we try to deepcopy an uncopyable object in UnsetSubnet
Change-Id: Id3cc907c1ed2a25b49cf6f4a7233e0401a02383a
Story: 2005169
Task: 29908
Most network commands use str() on name argument, which fails on python
2 with Unicode characters. This comes from parsed arguments so does not
actually need this call.
Sample command failing with current code:
openstack network create test_unicode™
Change-Id: Ie10b67864c912ee5c33e90b10c3d9705ee8307e7
Story: 2004356
Task: 27955
When updating subnet with "no-host-route" option, set host_routes to an empty list as neutron_lib.api.validators expected.
Change-Id: I6fe039793d813758429c7a104fd40172b4f8122b
Closes-Bug: #1747101
To enable the possibility to migrate a non-routed network to a
routed network allow updating the segment_id of a subnet.
Change-Id: I3ebae2ff28d5d4e5373ebd1f52194f8c52071b88
Partial-Bug: bug/1692490
Depends-On: I1aee29dfb59e9769ec0f1cb1f5d2933bc5dc0dc5
The use_default_subnet_pool column is never returned by the API, it is
only being used in the request to create a subnet. So make sure that we
do not show it when displaying a subnet.
Change-Id: Ie021149cceb8f89b779ad0f3c13ac60420509671
Related-Bug: 1668223
This commit now allows user to specify 'prefix_delegation'
as a Subnetpool during Subnet creation by using the new
--use-prefix-delegation option so that the IPv6
prefixes can be delegated to routers set up by the
cloud admins.
Change-Id: I67e5d81c4155db2e3c5c41ee1df77f2d77a17689
Closes-Bug: #1513894
Neutron tag mechanism now supports network, subnet, port,
subnetpool and router. Tag support for more resources is planned.
This commit introduces a common mixin class to implement
tag operation and individual resource consumes it.
To support tag remove, network unset command is added.
Implements blueprint neutron-client-tag
Change-Id: Iad59d052f46896d27d73c22d6d4bb3df889f2352
Cleanup help strings and docs for clarity and to keep things consistent:
* --limit metavar should be <num-resource> to indicate what is being counted
* --marker metavar should be <resource> or <resource-id> to indicate the
type of value being specified
* <*-ip-address> metavars should be just <ip-address> as there is no difference
in format between fixed and floating IPs
* Move all occurances of '(name or ID)' to end of help text
Change-Id: I2c31746ed6ded3845244e03e57d809f8bc0e6b9d
The attribute formerly wasn't working because it is lacking support in
the SDK. The patch to add it[1] introduced a modified spelling, so we
should be matching this here.
Also make sure that the attribute is not shown when displaying subnet
objects, as it is meant to be invisible[2].
[1] I72c0be77d96f3891748cdd69c382211dc20dbf5e
[2] http://git.openstack.org/cgit/openstack/neutron/tree/neutron/extensions/default_subnetpools.py#n23
Change-Id: Ic125b818a6082d76a1114fe89e0b1fcf4c7356b0
Partial-Bug: 1668223
The overwrite functionality allows user to overwrite
the dns-nameservers of a specific subnet.
Change-Id: I421808a3bdeb4565668f627b7929c4762cf40212
partially-implements: blueprint allow-overwrite-set-options
partially-implements: blueprint network-commands-options
Prepare the OSC "subnet" commands for the SDK refactor.
See [1] for details.
[1] https://etherpad.openstack.org/p/osc-network-command-sdk-support
Partially-Implements: blueprint network-command-sdk-support
Change-Id: I5d58b189e822b2ee61c9c95ccf909113ff59de46
Leverage the new cliff command class attribute (_description)
to get the help of a command, this allows us to mark strings
for translation. We could not do this before since the help
was grabbed from the docstring.
This also depends on a new release of cliff and a bump to the
minimum level in osc's requirements.
Closes-Bug: 1636209
Depends-On: Id915f6aa7d95a0ff3dc6e2ceaac5decb3f3bf0da
Change-Id: I8673080bb5625e8e3c499feaefd42dfc7121e96f
the sdk expects subnet allocation pools to be reset to an empty array,
not an empty string.
Currently this results in an error message:
"Invalid input for allocation_pools. Reason: Invalid data format
for IP pool"
Change-Id: I7cc84b9c8e4abdbd2c91e5d591ad31f0849c1a83
Closes-Bug: #1634672
With Ocata development opened, neutron network segments are no
longer beta resources.
Change-Id: I25be51c30df17c746136471b88840f64a03187b9
Partially-Implements: blueprint routed-networks
This patch adds the overwrite/clear functionality
for allocation-pool and host-routes in subnets.
Change-Id: Idfa41173d0c054c5bfb4eda8c5f614928012555a
implements: blueprint allow-overwrite-set-options
This patch adds the following filtering options:
'--project' and '--project-domain', '--network', '--gateway',
'--name', '--subnet-range' to the command.
Change-Id: I575739486b9548492bd00f50130181b825534226
Partially-Implements: blueprint network-commands-options
Closes-Bug: #1610883
Update port unset based on review comments in [1].
[1] https://review.openstack.org/#/c/306236/
Change-Id: Icae6e3869516f2d53f90ad46efc03f897c00b0e5
Implements: blueprint network-property-unset
Add '--service-type' to subnet arguments to support
Subnet service-types.
Change-Id: I215d83e4d4cf53e03fa35041c5e41a328641b3a9
Partially-implements: blueprint service-subnets
This patch adds '--dhcp' and '--no-dhcp' options to filter
subnets resulted by os subnet list command.
Change-Id: Ib574cc54594845bc5c5afc38bf44e3b224d33b17
Partial-Bug: #1610883
The dhcp is setting with True by default and progress always
jump into the first if check.
So the no-dhcp option always ignored there.
Check the no-dhcp option first and then the dhcp option value
to avoid this.
Change-Id: Ide640e2cab3936d419ca62105304ff5d4a8a2074
Closes-Bug: #1602588
This patch introduces the ``subnet unset`` command to
clear the host-routes, allocation-pools and dns-nameservers
from subnets.
Implements: blueprint network-property-unset
Change-Id: I31324a2423f6d2315eed27445dfdcfe863e0b550
This patch support bulk deletion for delete commands below:
1.subnet delete
2.subnet pool delete
Up to now, all the delete commands in networkv2 support bulk deletion.
Change-Id: I63f6d1d02bad1fcc26e72b7028b53958a68ce2dc
Partially-Implements: blueprint multi-argument-network
Partial-Bug: #1592906