CLI-Reference generator requires
(openstack-doc-tools/bin/doc-tools-update-cli-reference)
that command line help and bash-completion running without authentication.
For this purpose, remove authentication check in command and its test.
Fix nova bash-completion works without authentication.
Fix nova bash-completion test without setting authentication infomation.
Define skip_auth for descriminate "nova bash-completion" and do_help.
Change-Id: Ic1a7f84b1b9cb7e8be6721c1b8096f49e9e9ab33
Closes-Bug: #1495424
Commit 8886590f30daf736ae30a95b3e4a77cb586d4f02 adds the v2.4
microversion to nova so that we can get back the reserved value of a
fixed IP.
This change adds support to novaclient to display the reserved status
from the fixed_ip resource if it's available in the response.
Related blueprint show-reserved-status-in-os-fixed-ips-api
Change-Id: Idf3df1728ba87006d1b0f82a1c01712202670e0a
shell.main() uses safe_encode() to encode the exception name and
exception message. On Python 3, it displays:
ERROR (b'Exception'): b'message'
instead of:
ERROR (Exception): message
Don't encode exception name and message on Python 3. Use
exception_to_unicode() of oslo_utils.encodeutils to get the exception
message as Unicode. On Python 2, let print() encodes the Unicode to
the encoding of sys.stderr.
Blueprint nova-python3
Change-Id: Ib5568546d2aedb2b28c05d840b9ba34f697384ec
This is a follow up patch to https://review.openstack.org/#/c/221488/
which added unit tests for 'nova -h' and 'nova --help' and commonized
some code. It was missed that a test for 'nova' without any options or
subcommands already existed as "test_help_no_options"
This patch also refactors "test_help_on_subcommand" use the common
"_test_help" function since that was also missed.
Change-Id: Iccaf91207ba35001c8f58abb550cd1c3be542b38
os_password is not set anywhere for auth_plugins. It is only set for
keystone sessions. This makes sure that it gets set before being passed
to Client.
Closes-Bug: #1493977
Change-Id: I94421fd6fa58be391dfe8a9a14479bb4c17c5231
`_parse_block_device_mapping` method was design to support both
bdm v1 and v2. The implementation is based on the fact that API side
ignores unknown/incorrect parameters, so `_parse_block_device_mapping` compose
equal parameter for bdm v1 and bdm v2. Since Nova V2.1 contains schema checks,
such implementation stoped working.
Despite the fact that novaclient.v2.servers contains separate logic for bdm v2,
we can make `_parse_block_device_mapping` works only with legacy bdm and
in future patches make it works for both bdm v1 and bdm v2.
Change-Id: I37c00ac77b1a3b500221d779533532e9f43e5277
Closes-Bug: #1491737
not all apis have the versions available
Rackspace api does not open up for querying versions. This causes it to
still break when using the rackspace-auth-plugin
add tests for api_version Unauthorized
make sure that the list can still run even if the api_version check is
unauthorized.
Closes-Bug: #1493974
Closes-Bug: #1491579
Change-Id: I038b84bad5b747a0688aef989f1337aee835b945
The RAX Repose environment is blocking access to the API version
information by local policy, returning a 401 before we even get to
Nova itself. While this in clearly incorrect behavior, it is behavior
in the field, and we should not break all our users on that cloud.
This catches the 401 and translates that so that it's the equivalent
of only supporting v2.0. We will be taking these API calls to defcore,
and intend to remove this work around once that is done.
Change-Id: I2072095c24b41efcfd58d6f25205bcc94f1174da
Related-Bug: #1491579
The paste pipeline that's "above" the /v2/ and /v2.1/ urls is the
oscomputeversions dispatcher, which should provide 300 redirects to
versions in question. Previously the code that was trying to discover
information about the current version did so via a GET of something
that looked like /v2. On an upstream compatible OpenStack this
actually triggers a 300 and redirect to /v2/ for the real answer.
On deployed public clouds, oscomputeversions is sometimes not deployed
at all, or front end blocking by the load balancer does
weirdness. Sometimes with a 401, sometimes a hang.
This fixes the way that first request is made that should avoid the
300 redirect entirely. The code probably should have done this
originally, but it was tested with upstream configuration that worked
fine in this case.
This fix is tested against HP Cloud (the only pub cloud I have creds
with). Before this fix "nova list" hangs trying to get the supported
versions, after the fix it works as expected.
Change-Id: I1692380fe8d340e5c044f46dd0b103c7550d2c7d
Closes-Bug: #1491579
The novaclient functional tests assumed computev21 as a type in the
service catalog. We're defaulting compute in devstack to v21 now, so
this no longer works. This is probably far too coupled to devstack
atm, however until we get to unversioned service catalog, this is what
we need to do.
Change-Id: Ifb0056924b20f62d75d13a7b4aae829df61a5396
Per:
http://lists.openstack.org/pipermail/openstack-dev/2015-August/072982.html
The location of subunit2html changed on the images in the gate
so update the path used in the post_test_hook.
Long-term we should just use what's in devstack-gate.
Change-Id: I5e50e7d7ad845aba26403df1df412c0a139a6dc7
Closes-Bug: #1491646
--------------
squashed with:
--------------
Don't pass null device when attaching a volume
The v2.1 API schema rejects null device values in an
os-volume_attachments request, so only include the device in the request
if one is specified on the command line.
Closes-Bug: #1491325
Change-Id: I4fa4019f19f9af6ff350db2fb6e524fa8570a6f3
The current behaviour of live evacuate is to naively request that all
servers on the hypervisor be evacuated. The more VMs are migrated
simultaneously, the more bandwidth is required. Once a certain number
of migrating VMs is reached, there is not enough bandwidth to cope
with the rate at which they dirty their memory. The migrations will
thus never complete.
The correct solution to this would be a whole lot of work on the Nova
side. As a stopgap measure, this patch introduces a --max-servers
option to host-evacuate-live. With this option, the user can control
the number of VMs that are live-migrated at the same time, thus
allowing the user to avoid the dirty memory scenario described above.
Change-Id: I17bad5f3253d6657fc1e6610159fc8e3921e6ea4
New method generates randomized name for entities.
This method allows to set prefix that explicitly shows
what kind of entity we have. This should be more useful than
UUID-only names.
Change-Id: Iafec7686f1b3b00cb21302ee0e5db40d74e77c81
This patch adds a loop to servers list, which makes calls to API side until
all resources will be listed.
Also, there are several functional tests are added with checks of markers
and limit.
Change-Id: Ic030a68867781cca25e723ab51986d87ecd3ab2e
Nova API side supports returns limited number of resources, option "marker" is
already supported by "novaclient as a lib" and allowes to list servers
after "marker".
Change-Id: I04c42858a19b2afed37f967c14234291203e6c1e
If a user doesn't specify for novaclient's Client neither credentials
nor auth token, but specifies http_log_debug=True, and requests Nova
version list, novaclient fails with AttributeError exception.
The reason is that obfuscation of auth token doesn't expect None value
of the token. This patch bypass obfuscation of None token.
Closes-Bug: #1488169
Change-Id: I3712d633719bc77310ce863da33b2eec59a7ce91
novaclient transforms its management_url to get an url for a request for
server versions list. Currently this transformation does not consider
that version part of an url can be complex and contain major and minor
parts. As a result versions.list does request on a wrong url and fails
with NotFound error.
This patch adds support of version formats like 'vN.N', 'vN.NN', etc.
Partial-Bug: #1483030
Change-Id: Ie105bec37ee41c6a77ffc5f1cf680bbf88846159
novaclient.api_versions.wraps decorator can be used in shell. Most of shell
function has cli arguments which are added via another decorator.
Currently, to keep this cli arguments, novaclient.api_versions.wraps
decorator should be used in the top of decorators. Something like:
@api_versions.wraps("123.456")
@cliutils.arg("name", help="Name of the something")
@cliutils.arg("action", help="Some action")
def do_something(cs, args):
pass
This patch adds ability to put api_versions.wraps decorator everywhere:
@api_versions.wraps("123.456")
@cliutils.arg("name", help="Name of the something")
@cliutils.arg("action", help="Some action")
def do_something_1(cs, args):
pass
@cliutils.arg("name", help="Name of the something")
@cliutils.arg("action", help="Some action")
@api_versions.wraps("123.456")
def do_something_2(cs, args):
pass
Related to bp api-microversion-support
Change-Id: I8d599b712b17dcfc0be940a61c537d2dfe1b715b
Currently, the display of server groups doesn't contain informations
about project-id. It is very difficult for admin to tell which
group belongs to which project when using command:
"nova server-group-list --all-projects".
This patch adds project-id to the display.
Change-Id: I010bf02f696396c404bc7a51ce93252c8c7f68a6
Partial-bug:#1481210
Extending Nova CLI to support forcing service to be set/unset as down,
as specified in blueprint mark-host-down.
Depends-On: I612582ba7b70bb6d167aa68bdfc47faa3b7b85ed
Depends-On: I39f1a84c100726f87a4dc464dd9922d66efdb53f
Implements: blueprint support-force-down-service
Change-Id: I2b80ac32a95fe80363b4ad95d8d89fff097935a3
Adds new parameter --key-type for novaclient for creating x509
certificates as keypairs. If no --key-type is specified, a ssh
keypair is created, for backwards compatibility.
Adds 'Type' column for keypair-list, displaying the keypair type.
This commit will have to merge after:
https://review.openstack.org/#/c/140313
Depends-On: I215662f2f92a01921a866c3218031787a9eaf915
Implements: blueprint keypair-x509-certificates
Co-Authored-By: Andrey Kurilin <andr.kurilin@gmail.com>
Co-Authored-By: Alex Xu <hejie.xu@intel.com>
Change-Id: I12bb13e24b660ffb6da0e5be275acbba7453d011
It would be nice to use "latest" version of api by default.
Related to bp api-microversion-support
Change-Id: Ife981c87d32011f01fcbdf871071a9d8273ebb92
This patch adds version discovery when user request with latest version.
The latest version means the most recently version between server and
client.
Related to bp api-microversion-support
Co-Authored-By: Alex Xu <hejie.xu@intel.com>
Change-Id: I0b7a95e77371aef6e349bf54b5dd6ce6c6d2732c
Choose first network from networks list and specify
it for nova boot. Otherwise nova can not boot instance
when more then one network available.
Change-Id: I4813f6fff3050e2141e3a5e8eb4d7d8919721703
Add method wait_for_volume_status to base.py to deduplicate code
in test_instances.py and test_volumes_api.py.
Removed volume_id_from_cli_create function as obsolete.
Change-Id: I44e35e181515923a677b336ed48bc705cf673134