With python3.x, classes can use 'metaclass=' instead of
'six.add_metaclass', 'six.iteritems' and 'six.iterkeys' can
be replaced by 'items' and 'keys', 'six.moves.urllib.parse'
can be replaced by 'urllib.parse', 'six.StringIO' and
'six.moves.cStringIO' can be replaced by 'io.StringIO',
'six.text_type' and 'six.string_type' are just 'str'.
Change-Id: I84848c0bf8ab3c36dd821141191e2725e4e3b58b
This change adds support for tagging ports on creation
Co-Authored-By: Slawek Kaplonski <skaplons@redhat.com>
Change-Id: I3148a568664588eb2f529138f984859570c0fca1
Related-Bug: #1815933
Added port NUMA affinity policy parameter to "port create",
"port set" and "port unset" commands.
Change-Id: I48cacab275856af2911829f9b7176bb87fd039b3
Related-Bug: #1886798
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
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
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)
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
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
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
$namespace = openstack.network.v2
The subcommand documents for $namespace were hardcoded and thus prone to
drift over time. This commit removes the hardcoded content and uses the
autoprogram-cliff directive to generate them automatically from the
subcommand configuration classes.
This one turned out to be quite involved, because we support both
neutron and nova-network. When running in a real cloud, the command
classes detect whether the neutron service is present, assume
nova-network if that service is not found, and only add parser options
relevant to the detected service. But the docs need to present both sets
of options. This was easy enough when they were hardcoded, but required
a bit of additional infrastructure for generated docs.
Change-Id: I426261eb1d86bcc68656aabd61f10b7f082da402
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>
Add following commands:
floating ip port forwarding create
floating ip port forwarding delete
floating ip port forwarding list
floating ip port forwarding set
floating ip port forwarding show
Closes-Bug: #1811352
Change-Id: I6a5642e8acce28fc830410d4fa3180597b862761
Pick up newer versions of this library. Thankfully no serious changes
are needed.
Change-Id: I69e523844529fc1c8aa0c1ce764182dbe29cfeb6
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
neutron create-port API has extra_dhcp_opts parameter, this parameter
can set port with special extra dhcp options.
Change-Id: I199f17e95c509a33f809ac85c65f685a37acd198
When adding a security group rule, if no IP address is given
we will use '0.0.0.0/0', but if the ethertype is IPv6 we will
leave it as None. Change this to be '::/0' to match what we
do for IPv4 - use the "any" address. The neutron server
treats them both the same when checking for duplicates.
Because there are most likely entries in the DB using None
for the IP, print them as '0.0.0.0/0' or '::/0' so it is more
obvious what address they are actually referring to.
Also change to display the Ethertype column by default
instead of with --long, since easily knowing IPv4 or IPv6
is useful.
Change-Id: Ic396fc23caa66b6b0034c5d30b27c6ed499de5a6
Closes-bug: #1735575
The following were deprecated for several releases and can now be
removed:
* Remove ``port create|set`` options ``--device-id`` and ``--port-id``
* Remove ``router set`` option ``--clear-routes``
* Remove ``security group rule create`` options ``--src-group`` and ``--src-ip``
These are backwards incompatible changes and will require a major
version bump after they are merged.
Change-Id: Ieae74c14f6b3e263721a3146cf76f94a9ab792f6
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
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
The default protocol used to create a security rule was changed to
``tcp``, which was a regression from the neutron client. Change it
back to ``any``, which skips sending the protocol to the API
server entirely when using the Neutron v2 API.
Users that had been creating rules without specifying a protocol
and expecting ``tcp`` need to change to use ``--protocol tcp``
explicitly.
Change-Id: Iedaa027240e00dced551513d8fa828564386b79f
Closes-bug: #1716789
Currently, this only allows 'IPv4' or 'IPv6', but one can imagine a user
frequently typing e.g. 'ipv6' and getting frustrated. Allow any case,
while still keeping correct case for the choices and the value sent to
Neutron.
Change-Id: I70ce1f43d32aad01b174437d03c984a5b608b161
When neither of "--shared" and "--private" is input, we should not allow
to specify "--project". Defaulting the created network segment range to
shared is expected. Therefore, "project_id" attr should only be
populated on a private range creation.
Change-Id: Iab345e1651dd8b7904ff64a20633f194d719bb84
Story: 2005206
Task: 29980