This exposes the node's clean_step field by bumping the default version
from 1.6 to 1.7 and adding clean_step to various lists.
Change-Id: I2d9f2e58ed198bc8cb5bab67a6f8baf85bbbf972
Closes-Bug: #1466693
This patch mock the time.sleep function in RetriesTestCase class so we
don't spend time sleeping on the tests.
Closes-Bug: #1470914
Change-Id: Ia1e5e9da929fe1544333e4b609b94ea1506f85f8
If we negotiate an API microversion in the ironiccclient, cache
this value so that we don't need to re-negotiate it again for the
next API call, if the user doesn't specify a version.
We cache the version for a particular ironic instance in a
temporary file, one per server, in a multi-user, multi-server
safe-way - deleting old files once they expire, so only the
latest is kept.
Depends-On: Icb29fdc92ecd54e388b7c16899070572458308da
Change-Id: I0232bc611789fb96491d855020042e23ba0c4fab
Blueprint: version-caching
When using the session object we want to pass through unknown kwargs to
the adapter so that keystoneclient can add new parameters as required.
This requires fixing the old options so that we can restrict what is
passed and showing a warning when there are values that are being
ignored.
Change-Id: Ia795dfc8e16c60a08df1636816daefe2ebbd0b03
As described in the referenced bug, registering the Keystone args
last causes their default values to be ignored. Registering them
first seems to prevent the problem.
Change-Id: I8eb7882a0153fedbd6591dde2157df13fa2e5ba3
Closes-Bug: 1463581
Have the ironicclient program 'ironic' be installed in the 'venv'
virtualenv so that it can be used, if desired.
Change-Id: Ida07597bd21abe2303f2d3098012c57d9f018e12
Refactor the resource_fields.py file to remove some (but not all) of the
duplication that is occurring.
* Created a class Resource to contain the fields and label values
* Added test cases for the new Resource class
* Use the new Resource class to hold data for Chassis, Node, and
Ports.
* Have logic to support a 'sort_fields' and 'sort_labels' property
which removes fields/labels which can not be used for sorting.
Change-Id: I846517a3714b1a86ef7ed7f52e911376e1915bb5
The Ironic API exposes an endpoint that can be used to get information
about the node's state (v1/nodes/<uuid>/states). This was implemented in
the Ironic library but we didn't have a command in the CLI to invoke it,
this patch is adding this command.
Depends-On: I340c88ea7d098ca5943d60adc73f63a0af79a405
Change-Id: Ia42775a2ca484c7e4c3bd91f60e7c71a2a3d8ff9
This reverts the fix to properly issue an Unauthorized
exception [1] because it was a workaround, and the proper fix
was made in oslo.incubator [2] and has been sync'd [3].
[1] I930fd61a896f62a2984cca1e4d40e5d89644aa3f
[2] I3b9a20174da482f570d02319e68f46dcaa10ca9c
[3] Iab799c8209872e2faa9ec6d33a426347b6478cce
Change-Id: Ia3f5695f73bfff19a9f24117fa881e8d9ed039d3
Closes-Bug: #1402840
The set of valid input strings for Boolean values was inconsistent among
the subcommands of the Ironic CLI. egs:
-for node-set-console-mode: 'true', 'false'
-for node-set-maintenance: 'on', 'off', 'true', 'false', 'True', 'False'
This change allows the same set of valid values for all the subcommands:
'0', '1', 'f', 'false', 'n', 'no', 'off', 'on', 't', 'true', 'y', 'yes'.
For invalid strings, we output the subcommand usage along with the
argument, invalid string, and valid string choices.
At the API level, if NodeManager.set_maintenance() is passed an invalid
state (maintenance mode) value, an InvalidAttribute exception is raised.
Change-Id: I541695388489cdc640265df8ee6a9999e1442870
Closes-Bug: #1415943
The Oslo libraries have moved all of their code out of the 'oslo'
namespace package into per-library packages. The namespace package was
retained during kilo for backwards compatibility, but will be removed by
the liberty-2 milestone. This change removes the use of the namespace
package, replacing it with the new package names.
The patches in the libraries will be put on hold until application
patches have landed, or L2, whichever comes first. At that point, new
versions of the libraries without namespace packages will be released as
a major version update.
Please merge this patch, or an equivalent, before L2 to avoid problems
with those library releases.
Blueprint: remove-namespace-packages
https://blueprints.launchpad.net/oslo-incubator/+spec/remove-namespace-packages
Change-Id: Ic21066211a071591854280a93a53bb2255cb8ad3
The 'node_uuid' is an invalid sort key in port list command, as
well as 'chassis_uuid' in node list command.
Remove them from sort keys in corresponding list commands.
Change-Id: I10caf5d99d9c8cc7b03dedc9b5cf0546351c6657
Closes-Bug: #1443003
Since our gate has a gate-python-ironicclient-pypy job,
we should support it in our local test environments.
Change-Id: I825a1206e2c653981ceb2cd2ffe65033bc78a6c4
Ironic *-show does not ensure that uuid are not empty.
This patch adds checks to the client to ensure that command line
arguments are not empty strings or only whitespace. It will raise
a command exception if *-show command line argument is an empty
string or only whitespace.
Change-Id: Ia34957922006da5ecbbfc7483040d67ac51f0ada
Closes-Bug: 1442436
This is basically a revert of commit:
af741ec2236619880fa902d68aef4a6ae6cef534
It was decided that only files that need to have the line:
# -*- coding: utf-8 -*-
Should have the line[1] as a general principle
This patch removes the 'utf-8' coding line from files that consist
entirely of ASCII characters.
[1]
http://eavesdrop.openstack.org/meetings/ironic/2015/ironic.2015-04-20-17.00.html
Partial-bug: #1325193
Change-Id: I88c1c37f7b580aa805eae9d4a1e66d33302a325f
The README file needs to have links to the project documentation and bug
tracker in a parsable format in order for some of the release tools
scripts to work (particularly the one that prints the release note
email).
Change-Id: I37e0acc5ed8e1af565359290fa622456901c735e
cli did not handle output exception which is encoded,this patch
implements the shell encoding for exception output.
Change-Id: I7350c9be1bc0a7eafaaf2f992b7ef07bf84d44f8
Closes-Bug: 1437147
Getting Conflict errors is pretty annoying, especially when writing
automation scripts. Nova and ironic-discoverd already have their
own logic for retrying on such errors.
This patch adds 'max_retries' and 'retry_interval' arguments to
get_client for tuning or disabling retries.
Change-Id: Id9720c87ce3846faec61eb40ccf00970ca798ad2
The python client should catch 406 Not Acceptable errors when talking to
older versions of the server. If the user did not request a specific
version, the client should negotiate (fall back to) a mutually supported
API version with the server.
If there is no mutually supported version, or if the user specified a
version in which the requested feature is unavailable, the client should
raise an error.
This patch is a partial implementation of the client side of
auto-negotiation. It catches the 406 error and attempts to determine
what version the server is based on the returned headers. It does NOT
actually change what values are sent or returned by the client, aside
from the version headers.
Without this fix, the client fails to connect to any server version
between commit 41595327 (when v1.1 was introduced) and commit 6ecee368
(when v1.6 was introduced), because it is requesting API version 1.6
and not handling the 406 Not Acceptable response.
Note that API server versions prior to commit 32fb6e99 did not return
any version information in the header of a 406 Not Acceptable response.
To work around this, when the client receives a 406 response that does
not contain any version header, the client performs an extra GET request
to the root /v1/ URL to retrieve the supported versions. This allows the
client to work with API services that might be running unreleased
mid-kilo code as well as both stable/juno and the latest kilo code.
Co-Authored-By: Dmitry Tantsur <dtantsur@redhat.com>
Co-Authored-By: John L. Villalovos <john.l.villalovos@intel.com>
Change-Id: Iab6a0814f0db6dd6e7bfc00da28baf8403a6b1db
Blueprint: api-microversions
Partial-bug: #1441170
A previous commit separated the -n/--node option from the --node_uuid
option on the "port-create" command. This meant that, even when the user
specified --node_uuid, the client required -n/--node as well and would
error out.
This moves these options onto a single CLI argument.
Change-Id: Idcc3217e07f9600f7db18182e9b1bc8b2ae356d3
Closes-bug: #1441374
Basically copying commit bf6d966756d3745d2facd5ac39444646dcfae6de from
the ironic project.
If your native locale is not en_US and you run tests, some could fail
due to the message translation that happens since the assertion messages
are in en_US (not translated, just hard-coded in the tests).
Note that setting LANG=en_US had no effect.
Change-Id: I812a296ea6c9be303f40346c6db06673fefda8d5