384 Commits

Author SHA1 Message Date
Ruby Loo
aea764b451 Expose node's clean_step and bump default version
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
2015-07-07 23:08:34 +00:00
Jenkins
e144f4762a Merge "Also retry on HTTP 503 (service unavailable)" 2015-07-06 22:57:55 +00:00
Lucas Alvares Gomes
a15197f8ca Fix slow tests in RetriesTestCase
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
2015-07-02 17:06:15 +01:00
OpenStack Proposal Bot
2ebe3522c2 Updated from global requirements
Change-Id: I53dbd50ee19c7e48c8345631a079c1b57c53309e
2015-06-30 20:03:00 +00:00
OpenStack Proposal Bot
53bf34e491 Updated from global requirements
Change-Id: I80b7540052f4b3445cef374af8a13da39e5470a4
2015-06-29 20:33:48 +00:00
Jenkins
2420ec0900 Merge "Cache negotiated api microversion for server" 2015-06-29 15:24:39 +00:00
Dmitry Tantsur
24f016b69b Also retry on HTTP 503 (service unavailable)
The API returns this error when we lack free conductor workers.

Change-Id: I19903eb06b79d7f9721060ea1c615e610d40f91f
2015-06-29 15:36:32 +02:00
Michael Davies
44e6949b0c Cache negotiated api microversion for server
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
2015-06-23 08:55:12 +09:30
OpenStack Proposal Bot
4f42f1d4f8 Updated from global requirements
Change-Id: I8132815004dcd3be8e0a56a6c538dc766228c2bd
2015-06-22 08:27:45 +00:00
Jamie Lennox
3f4671a0b7 Cleanup session creation
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
2015-06-18 10:05:14 +08:00
OpenStack Proposal Bot
4f290a8d5e Updated from global requirements
Change-Id: I7dcf61927ffed0d69a68f77d71dc0f8b2fdd7e1b
2015-06-16 19:22:56 +00:00
Ben Nemec
e6ae41c537 Register global Keystone args first
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
2015-06-16 18:15:35 +00:00
Jenkins
01d2520788 Merge "Install the ironicclient into the 'venv' virtualenv" 2015-06-08 19:56:28 +00:00
John L. Villalovos
43d0516851 Install the ironicclient into the 'venv' virtualenv
Have the ironicclient program 'ironic' be installed in the 'venv'
virtualenv so that it can be used, if desired.

Change-Id: Ida07597bd21abe2303f2d3098012c57d9f018e12
2015-06-04 11:57:25 -07:00
OpenStack Proposal Bot
8001b76b37 Updated from global requirements
Change-Id: I1322619a7d5d3cd8189ff1b7d26d48328d7b622b
2015-06-04 16:24:22 +00:00
John L. Villalovos
30b01689f4 Refactor resource_fields.py
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
2015-05-28 10:28:57 -07:00
Jenkins
2ce7fd2e58 Merge "Disable meaningless sort keys in list command" 2015-05-27 04:09:15 +00:00
Kan
6e8d761688 Disable meaningless sort keys in list command
The sort keys are:
For ports: 'extra'
For chassis: 'extra'
For nodes: 'properties', 'driver_info', 'extra', 'instance_info', 'driver_internal_info

Change-Id: I6b9fce16893335b7e4fb0b663b21f2dff2cdbe8e
Depends-On: I340c88ea7d098ca5943d60adc73f63a0af79a405
Closes-Bug: #1446146
2015-05-27 02:12:58 +00:00
Jenkins
694628a2c3 Merge "Add node-show-states command" 2015-05-26 20:05:59 +00:00
Jenkins
301ba10164 Merge "Revert fix that issues Unauthorized exception" 2015-05-25 19:11:03 +00:00
Jenkins
136523c1f9 Merge "Consistent and more valid strings for Booleans" 2015-05-25 18:50:13 +00:00
John L. Villalovos
530bacab54 httpretty can fail in Python 3.4 with wrong LC_ALL
if LC_ALL is 'C' then installation in a tox environment fails [1].

[1] https://github.com/gabrielfalcao/HTTPretty/issues/223

Change-Id: I340c88ea7d098ca5943d60adc73f63a0af79a405
2015-05-25 15:29:53 +01:00
Lucas Alvares Gomes
3d66fa1a1f Add node-show-states command
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
2015-05-14 22:37:24 +00:00
OpenStack Proposal Bot
720effdd4c Updated from global requirements
Change-Id: I090e80b072e6480ed95c21382ae88a14d9461ff9
2015-05-14 00:13:26 +00:00
Ruby Loo
7bc4afba48 Revert fix that issues Unauthorized exception
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
2015-05-11 20:39:17 +00:00
Ghe Rivero
9db3fbfdf0 Sync oslo.incubator
Clean old dependencies and sync with latest oslo.incubator

Change-Id: Iab799c8209872e2faa9ec6d33a426347b6478cce
2015-05-07 08:35:20 +02:00
Ruby Loo
8fd2ac3ba1 Consistent and more valid strings for Booleans
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
2015-05-07 01:29:57 +00:00
Doug Hellmann
d0987b3e65 Drop use of 'oslo' namespace package
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
2015-05-06 19:12:14 +00:00
Kan
b776e47d3c Disable invalid sort key in list command
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
2015-05-04 22:07:45 -07:00
Jenkins
4d1fdfe02c Merge "Updated from global requirements" 2015-04-30 16:28:34 +00:00
OpenStack Proposal Bot
9efabe4fe9 Updated from global requirements
Change-Id: If32d9017a79d869f80ba1058851659b98bb82aaf
2015-04-29 19:23:02 +00:00
Michael Davies
0bb42e908b Add in support for a tox pypy target
Since our gate has a gate-python-ironicclient-pypy job,
we should support it in our local test environments.

Change-Id: I825a1206e2c653981ceb2cd2ffe65033bc78a6c4
2015-04-29 13:26:49 +09:30
Jenkins
a68770bbb3 Merge "Ensure *-show input uuid is not empty" 2015-04-24 15:22:28 +00:00
Jenkins
5a3957eb9f Merge "Remove unneeded 'utf-8' coding lines" 2015-04-22 14:58:21 +00:00
Jenkins
27bd820095 Merge "Update README to work with release tools" 2015-04-22 08:00:20 +00:00
Haomeng, Wang
cec37d5a67 Ensure *-show input uuid is not empty
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
2015-04-22 02:48:49 +00:00
John L. Villalovos
2df670cf30 Remove unneeded 'utf-8' coding lines
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
2015-04-21 16:44:47 +00:00
Jenkins
e176083af3 Merge "Encode exception on cli for UnicodeDecodeError" 2015-04-21 15:40:16 +00:00
Doug Hellmann
26d90b2d40 Update README to work with release tools
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
2015-04-21 15:29:57 +00:00
jiangfei
8f476f47b1 Encode exception on cli for UnicodeDecodeError
cli did not handle output exception which is encoded,this patch
implements the shell encoding for exception output.

Change-Id: I7350c9be1bc0a7eafaaf2f992b7ef07bf84d44f8
Closes-Bug: 1437147
2015-04-21 00:10:08 +00:00
Jenkins
cbc1ce5b0a Merge "Uncap library requirements for liberty" 2015-04-17 17:54:00 +00:00
Dmitry Tantsur
28bdd0baeb Implement and enable retries on Conflict
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
2015-04-17 16:25:44 +02:00
Doug Hellmann
fba836494b Uncap library requirements for liberty
Change-Id: I70575137d962240c9e790b96aa0fbfad80e4c9a5
Depends-On: Ib948b756b8e6ca47a4c9c44c48031e54b7386a06
2015-04-16 18:13:06 +00:00
Jenkins
06a62bc60e Merge "Client should fall back to the lower versions if necessary" 2015-04-13 19:48:39 +00:00
Devananda van der Veen
8b453ff88a Client should fall back to the lower versions if necessary
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
2015-04-13 10:31:47 -07:00
Steve Martinelli
615ec1ad52 Upgrade hacking to latest release
Use the latest hacking release and make a few minor modifications
to the code base.

Change-Id: I8ce78a19c1973740e0641bc6022b657e0cb5eb5b
2015-04-09 10:15:02 -04:00
Devananda van der Veen
fe9a7b5628 Fix node_uuid option is required for port-create
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
2015-04-08 13:08:58 +00:00
John L. Villalovos
20117dca60 Force LANGUAGE=en_US in test runs
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
2015-03-30 11:09:56 -07:00
Jenkins
cf220c18cf Merge "Add unittests for resource_fields" 2015-03-30 15:05:50 +00:00
Jenkins
1aced4f7a2 Merge "Updated from global requirements" 2015-03-30 15:03:09 +00:00