17 Commits

Author SHA1 Message Date
Jenkins
42b607edf1 Merge "Use assert_not_called() in common tests" 2016-02-04 22:56:57 +00:00
Jenkins
e4c0d8583d Merge "Allow wait_for_delete to work for all clients" 2016-02-04 00:39:47 +00:00
Dean Troyer
38ff51baef Use assert_not_called() in common tests
In https://review.openstack.org/#/c/273653/ Bryan Jones made
a point about using mock_sleep.assert_not_called() rather than
self.assertFalse(mock_sleep.called), so let's make that change
throughout these tests.

Change-Id: I826d608836955383891b303355edcca7b62faa16
2016-02-03 15:47:07 -06:00
Richard Theis
981621e984 Add "os port show" command
Add "os port show" command.

Change-Id: Id87c81640e74c60ae8f247c722c64fdadff022a2
Partial-Bug: #1519909
Partially-Implements: blueprint neutron-client
2016-02-02 08:40:05 -06:00
Mark Vanderwiel
5903ffff8a Allow wait_for_delete to work for all clients
Allow the exception and error status
strings to be passed in such that other plugins can
make use of this function.

There is a comment in find_resource:
  The exception to catch here is dependent on which
  client library the manager passed in belongs to.
  Eventually this should be pulled from a common set
  of client exceptions.

Since I think that is a long ways off, this change will
work now and also work when a common exception is defined
and used.

Change-Id: Iab56cd1166028caed4f1e657e0b1ee81af3f48d8
2016-01-28 10:52:45 -06:00
Richard Theis
0e38ef8484 Improve output for "os security group show"
Improve the security group rules output when running the
"os security group show" command. Each security group rule
is now displayed on a separate line.

Current output example:
$ openstack security group show default
+-------------+------------------------- ... ---+
| Field       | Value                    ...    |
+-------------+------------------------- ... ---+
| description | Default security group   ...    |
| id          | 048a5fc3-3be1-407d-ae47-9...    |
| name        | default                  ...    |
| project_id  | 3b96bb2020c1459da76963f9e...    |
| rules       | [u"id='5d812367-9829-4340...t"] |
+-------------+------------------------- ... ---+

New output example:
+-------------+------------------------- ... ---+
| Field       | Value                    ...    |
+-------------+------------------------- ... ---+
| description | Default security group   ...    |
| id          | 048a5fc3-3be1-407d-ae47-9...    |
| name        | default                  ...    |
| project_id  | 3b96bb2020c1459da76963f9e...    |
| rules       | id='5d812367-9829-4340-95...lt' |
|             | id='ee451d1c-ade3-4975-8e...lt' |
+-------------+------------------------- ... ---+

Change-Id: I1386075310896c58a2b776e2bbec3603bd00eff1
Partial-Bug: #1519511
Related-To: blueprint neutron-client
2015-12-23 13:44:22 -06:00
Mark Vanderwiel
71e1adeaf0 Allow error status to be specified
For some apis, heat, the error status is "failed". This patch
changes the wait_for_status method to allow for the error
status to be passed in the same way as the success status.

Change-Id: I20db4051d3f5611a4b13fe23ea8798b82a40da81
2015-11-18 17:48:43 -06:00
Dean Troyer
97659adf53 Add tests for find_resource()
Add a couple of tests for utils.find_resource() for the odd resources
and managers without resource_class.

Change-Id: I2ed9b491d1361b5259b3a5f80b4fac787a7087c1
2015-10-01 11:46:16 -05:00
Roxana Gherle
5521e4c504 Add --os-endpoint-type cli optional argument
User should be able to specify the endpoint type through
a CLI optional argument/ENV variable setting. We will name this new
optional argument: --os-endpoint-type (Env: OS_ENDPOINT_TYPE) and
based on the value given, the service API will use that specific
endpoint type. Possible values: public, admin, internal.

DocImpact
Closes-Bug: #1454392
Change-Id: Ife3d4e46b44c0ddcd712b1130e27e362545a9a29
2015-07-02 10:10:46 -07:00
Matt Riedemann
224d375ef4 Add --wait to server delete
This allows the server delete command to wait for the server to be
deleted (obviously).

The wait method is the same model that Tempest uses, i.e. wait for a 404
on server GET (successful deletion), fail if the server went to ERROR
status, or fail if a timeout is reached.  The default timeout of 300
seconds is also what Tempest uses.

Closes-Bug: #1460112

Change-Id: I0e66c400903e82832944d1cad61e7eb30177c3e8
2015-05-29 14:32:51 -07:00
zhiyuan_cai
42cff38834 Add sort support to image list
Add sort support to image list by sorting items in the client side.
The parameter syntax follows this spec[1].

[1] https://review.openstack.org/#/c/145544/

Change-Id: I42b487d18f00f937db1938daa46487cea2a896ab
Closes-Bug: #1410251
2015-02-06 10:57:10 +08:00
wanghong
127af151ff fix the wrong order of assertEqual args
Let's fix them thoroughly.

Change-Id: I8a1f042fb614b05c9836a49041f3883638b870b0
2015-01-27 17:02:41 +08:00
Terry Howe
514ecc6e96 Unordered dicts and lists causes variable results
The unordered dict and lists causes variable results.  The user
may see different results and tests can fail.  Might as well make
this more consistent.

Change-Id: I7045b40b44cbf3ee0f2ca79c6ea0d279b6d8cfe3
2014-09-06 23:55:31 -04:00
Terry Howe
0b2987fef3 Fix find_resource for keystone and cinder
The find_resource method had two hacks in in to support cinder
and keystone and I have removed those in favor of a monkey patch
for cinder.

The find_resource method used to attempt to UUID parse the id, but
it would do a manager.get anyway.  I changed it to skip the UUID
parsing.  This will make things run minorly faster and it supports
LDAP for keystone.

The find_resource used to attempt to use display_name=name_or_id
when finding.  This was a hack for cinder support, but it breaks
keystone because keystone totally messes up with the bogus filter
and keystone refuses to fix it.

Change-Id: I66e45a6341f704900f1d5321a0e70eac3d051665
Closes-Bug: #1306699
2014-06-17 10:24:26 -06:00
Dean Troyer
0059f045a9 Ignore most of the new hacking 0.9.2 rules
So we can update requriements.txt.  But fix a couple of easy ones:
* Fix E251 (1 occurrance)
* Fix E131 (1 occurrance)

Change-Id: I62aaa423aa6da9e9f0ca026ec586b51cc6a6df03
2014-06-13 17:06:28 -05:00
Terry Howe
4900c64d09 Produce a useful error message for NoUniqueMatch
Most of the CLIs use a NoUniqueMatch, so produce a useful
error message if that happens.  Added some tests for
find_resource as well.

Change-Id: I85ba61d5f6d1be5bd336a1cc4b02501492905f33
Closes-Bug: #1293846
2014-03-17 17:32:41 -06:00
Terry Howe
033f27fe4d Add ability to prompt for passwords for user create and set
* Add get_password method to the utilities
* Add --password-prompt option
* Call the get_password method if a prompt is requested
* Various tests

Change-Id: I1786ad531e2a2fbcc21b8bc86aac0ccd7985995a
Closes-Bug: 1100116
2014-02-21 14:42:22 -07:00