None of these are actually supported by openstacksdk (intentionally so)
so we add our own manual implementations.
Change-Id: Ifd24f04ae4d1e56e0ce5ba0afe63828403bb7a6f
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This change is entirely automated save for the update of some mocks from
'io.open' to '__builtins__.open').
We are keeping this change separate from addition of the actual hook so
that we can ignore the commit later.
Change-Id: I0a9d8736632084473b57b57b693322447d7be519
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Black used with the '-l 79 -S' flags.
A future change will ignore this commit in git-blame history by adding a
'git-blame-ignore-revs' file.
Change-Id: I8048746dbc2ef0cb582f68934734db4c1153d779
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
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
$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
Add "dns-domain" parameter to Network class. Also check
backend extensions and send an error message in case of
an argument (like dns-domain) is sent and the extension is
missing (dns-integration in this case).
Change-Id: I7303658c27d9b9f2d8381ccea0b29e96909cab54
Closes-Bug: 1633214
Partial-Bug: 1547736
a)
/os-floating-ips was removed in Compute API 2.36 and from novaclient's
Python API in 10.0
Add to api.computev2:
floating_ip_add()
floating_ip_remove()
Convert add floating IP command to nova-net/neutron split:
"server add floating ip"
"server remove floating ip"
b)
/os-hosts was removed in Compute API 2.43 and from novaclient's
Python API in 10.0.
Add to api.computev2:
host_list()
host_set()
host_show()
Convert host commands to use intenal api:
"host list"
"host set"
"host show"
c)
The introduction of the Network-style commands into the server group
broke cliff's autoprogram directive as it executes the get_parser() methods
without fully initializing the Command object.
NOTE: This is really three reviews squashed to get through the gate in one pass.
Depends-on: Id6de87211d6c4ea8fd14aa9203d8d5b17e9e2f04
Change-Id: I5116086f9a9e4b2b31a744bf8f4558c79f0bfe59
This patch improves the error message by retrieving the more details
from the exception instance. Otherwise, the real error message won't
be displayed (unless using --debug in the command).
Change-Id: I8ba694bda86f7cc8362e301b2044d9b610dde49c
Problem: if a user issue the cmd 'openstack floating ip create public'
and has already maxed his quota for FIP, OSC exits with a not so useful
message:
>jordan@jordan-XPS13-9333:~ $ openstack floating ip create public
>HttpException: Conflict
This patches catch the HttpException earlier and prints a more
verbose message:
> jordan@jordan-XPS13-9333:~ $ openstack floating ip create public
> Error while executing command: Quota exceeded for resources: ['floatingip']
Change-Id: I7c87524d871d230d92f007c32e06439b34c7194a
Usually, the error message of multi delete is:
"'result' of 'total' 'objects' failed to delete"
the objects is a plural form.
To match the other multi delete error messages
in OSC, change the object in delete error message
in networkv2 to a plural form. Just add a 's' in
the message.
Change-Id: I17e0735d025bb61014db709d2639813565015b3d
Use file logger for all command specific logs.
This patch also fixes some usage that doesn't
follow rules in:
http://docs.openstack.org/developer/oslo.i18n/guidelines.html
After this patch, all self.log and self.app.log
will be standardized to LOG().
NOTE: In shell.py, we got the log in class OpenStackShell,
which is also known as self.app.log in other classes.
This logger is used to record non-command-specific logs.
So we leave it as-is.
Change-Id: I114f73ee6c7e84593d71e724bc1ad00d343c1896
Implements: blueprint log-usage
Use osc-lib directly for exceptions.
Leave openstackclient.common.exceptions for deprecation period.
Change-Id: Iea3e862302372e1b31ccd27f69db59b4953ca828
This patch rework "network delete" command following the
rules in doc/source/command-errors.rst.
In "network delete" command, there are multiple REST API
calls, and we should make as many of them as possible.
And log error for each one, give a better error message.
Also return a non-zero exit code.
Change-Id: I39ae087dd7bd08d049d513abfa6c5cab2bd13b2b
Partial-Bug: #1556719
This patch set introduces the NetworkAndComputeLister and
NetworkAndComputeShowOne classes which are related to the
NetworkAndComputeCommand class. These classes are for commands
that must support neutron and nova network. The new classes
allows both the parser and actions to be unique.
Change-Id: I1b59264cd40aaf1062f4e8db233ccb7fd0e95f0e
Partial-Bug: #1519511
Partial-Bug: #1519512
Related-to: blueprint neutron-client
Refactored the 'os security group rule delete' command to use the
SDK when neutron is enabled, but continue to use the nova client
when nova network is enabled.
This patch set also introduces new FakeSecurityGroupRule classes
for testing network and compute security group rules. And fixes
were made to the network FakeSecurityGroup class.
Change-Id: I8d0917925aa464e8255defae95a2a2adfb6cfb75
Partial-Bug: #1519512
Related-to: blueprint neutron-client
Refactored the 'os security group delete' command to use the SDK
when neutron is enabled, but continue to use the nova client when
nova network is enabled.
This patch set introduces a new NetworkAndComputeCommand class
to be used for commands that must support neutron and nova network.
The new class allows both the parser and actions to be unique.
The current DeleteSecurityGroup class is now a subclass of this
new class and has moved under the network v2 commands.
This patch set also introduces a new FakeSecurityGroup class for
testing security groups.
And finally, this patch set updates the command documentation
for security group and security group rule to indicate that
Network v2 is also used.
Change-Id: Ic21376b86b40cc6d97f360f3760ba5beed154537
Partial-Bug: #1519511
Related-to: blueprint neutron-client
The previous patches have migrate all network commands to
the new version using sdk. This patch will remove the
temporary method, and implement a new make_client() to
create sdk network client.
And also, find() in openstackclient/network/common.py must
support sdk. The logic of this function will become much
easier than before, so this patch also removes two useless
test cases of find().
This patch will also remove the patched methods in tests.
Change-Id: Ic2f7bca073beb9757172d16f95d9b82c48cbbc12
Implements: blueprint neutron-client
Co-Authored-By: Terry Howe <terrylhowe@gmail.com>
Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
Add the name_attr to the network find method so it can search
for things like floating_ip_address for floating IP addresses
rather than just id.
Change-Id: I827e3745b06397a54555d1286e477bf2e05bf789