Commit Graph

1191 Commits

Author SHA1 Message Date
Tony Breeds 7dcd5a937e Retire Packaging Deb project repos
This commit is part of a series to retire the Packaging Deb
project. Step 2 is to remove all content from the project
repos, replacing it with a README notification where to find
ongoing work, and how to recover the repo if needed at some
future point (as in
https://docs.openstack.org/infra/manual/drivers.html#retiring-a-project).

Change-Id: I3b2becdf2cf9158c71f3d272171b27be50fd6acb
2017-09-12 16:04:35 -06:00
OpenStack Proposal Bot 47e28fabc3 Updated from global requirements
Change-Id: I4742b1dbdfeef37962c15de59f0c0a536006de99
2017-07-21 04:44:16 +00:00
Akihiro Motoki 8cbdcde607 Emit warnings to encourage cliff FormattableColumn
cliff has a concept of FormattableColumn which allows CLI implementors
to convert data into human-readable format only when a human-readable
format is requested and keep data unconverted for manchine-readable
formats like JSON or YAML.

Deprecation warnings is now emitted in favor of using FormattableColumn.

Partially implement blueprint osc-formattable-columns
Change-Id: Ia55bc950ecfc666d4a957507beab98eef74390aa
Related-Bug: #1687955
2017-07-08 21:18:04 +00:00
Jenkins 7e7cecbde3 Merge "Add test methods to compare formattable column values" 2017-07-05 21:03:13 +00:00
Jenkins 14b75d6ba7 Merge "Optimize find_resource: do not run the same query twice" 2017-07-05 19:44:26 +00:00
Jenkins 50cea39981 Merge "Deprecate --profile and remove after Apr 2017" 2017-07-05 19:23:27 +00:00
Jenkins 7487c51bb3 Merge "Make --os-profile load from environment variables" 2017-07-05 19:23:19 +00:00
Akihiro Motoki 596af360fb Add test methods to compare formattable column values
When formattable columns are used we cannot compare two items
just using assertEqual(item1, item2). We need to compare
two items column by column calling human_readable or
machine_readable methods.

This commit add convenient assert methods to encourage
the usage of cliff formattable columns in OSC.

An example of the usage of the new methods is found at:
https://review.openstack.org/#/c/462170/ or related reviews.

Related-Bug: #1687955
Related to blueprint osc-formattable-columns

Change-Id: Ib801f6204e7a694c597d93a3a6d40dc500212f65
2017-07-01 14:53:15 +09:00
Jenkins 6150e09202 Merge "use openstackdocstheme html context" 2017-06-27 21:55:56 +00:00
OpenStack Proposal Bot a5996213cf Updated from global requirements
Change-Id: Id3cb0e7141fe0c11424e431fa8a656bfd47aec13
2017-06-27 12:19:52 +00:00
Doug Hellmann 4a6883c5e6 use openstackdocstheme html context
Set some of the new config values and enable openstackdocstheme as an
extension so it will inject values into the page context as it writes
each documentation page. This ensures the pages link to the right bug
tracker, etc.

Change-Id: Ifee9dcb2982313210fd66479b32e3c1203ce14de
Depends-On: Icf3a40ed104cfd828f532f6f2b112ed02f996ff5
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-23 14:51:31 -04:00
Doug Hellmann 8f08eed13d update links to docs in readme
Change-Id: If2e320002452a014538e3f4ea82a6161020a5603
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-22 15:02:02 -04:00
Doug Hellmann 8e164af6bb switch from oslosphinx to openstackdocstheme
Change-Id: Ifa30f6c05cc2e6fd5467c4d3b20fd76218c3c90a
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-22 14:47:09 -04:00
Doug Hellmann 5b80552b11 turn on warning-is-error for sphinx
Update a docstring that had an rst formatting error and then turn on the
warning-is-error flag to prevent future issues with documentation.

Change-Id: I29fc90a2eb1599c9da88489415a9e080d88cc707
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-22 14:38:17 -04:00
Doug Hellmann bdfa70956f rearrange existing documentation to fit the new standard layout
Change-Id: I91657e96ef29f8b36b2089a11c9c4966418cfcdb
Depends-On: Ia750cb049c0f53a234ea70ce1f2bbbb7a2aa9454
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-22 14:36:41 -04:00
Ilya Shakhat ca5864d7e3 Optimize find_resource: do not run the same query twice
utils.find_resource tries to query the resource in multiple ways:
first as ID, second as name but with parameters and so on.
If no extra parameters are given, the second query would be
the same as the first and thus is not needed.

Change-Id: I37fd4c8c75d354df95cd7f9ce2af092c9ac6962c
2017-06-22 15:43:10 +02:00
Tovin Seven db9673f16f Make --os-profile load from environment variables
--os-profile argument can be loaded from OS_PROFILE environment variables
to avoid repeating --os-profile in openstack commands.

Change-Id: I8615a972e8a1e8a39e97c3d6e7f07add4b6ab599
2017-06-14 15:40:45 +07:00
Tovin Seven b0b03b2a17 Deprecate --profile and remove after Apr 2017
NOTE(dtroyer):
This global option should have been named --os-profile as --profile
interferes with at least one existing command option.
Deprecate --profile and remove after Apr 2017.

Change-Id: Icac979e0828e0b7bccecb97c806db8fe766f4652
2017-06-14 11:31:19 +07:00
OpenStack Proposal Bot 2c9d95912e Updated from global requirements
Change-Id: I5697430ab8af3119acc47c8cac42cf00cda63896
2017-05-23 11:57:41 +00:00
Jenkins 0dbf12d81c Merge "Remove log translations" 2017-05-04 19:58:49 +00:00
Jenkins 689c46461e Merge "Add endpoint hook to BaseAPI" 2017-05-04 13:47:44 +00:00
Jenkins 361789fb59 Merge "Fix shell saving OpenStackConfig object" 2017-05-04 06:19:37 +00:00
Jenkins 57b3f937cd Merge "Follow-up to headers handler to fix find_bulk()" 2017-05-04 00:33:38 +00:00
Dean Troyer 473f4fc32d Fix shell saving OpenStackConfig object
When this was brough over from OSC we did not save the OpenStackConfig
object created in shell.initialize_app().  Others have come to rely
on it being in shell.cloud_config so save it.

Change-Id: I1a82cd94febb1775bcd9fae05d5d5ed860c5baa7
2017-05-03 16:48:40 -05:00
Dean Troyer 6b5c27ea38 Follow-up to headers handler to fix find_bulk()
The headers keyword arg was missed on api.find_bulk() resulting
in no results being returned as it was handled as a filter attribute.

Change-Id: I703a0231046587d9ed546561fbf5dd7fa313c443
2017-05-03 16:15:59 -05:00
OpenStack Proposal Bot 538e431101 Updated from global requirements
Change-Id: I70bb7a58b1105b944ac279d835592e5813a8d0ad
2017-05-03 12:21:17 +00:00
OpenStack Proposal Bot 27117c6157 Updated from global requirements
Change-Id: I1b728ba964557f5935638cd08c36e07411867743
2017-05-01 14:06:02 +00:00
Dean Troyer ed8ef0df9f Tell ClientManager when auth is required
Commands that do not reuire authentication still call things that want
to check the service catalog; no auth means no service catalog.
(I'm looking at you OSC's is_networking_enabled())  Get more aggressive
at not doing auth when it is not required.

The cost of this is commands with auth_required=False need to be more
selective about what they do with ClientManager.auth_ref as it will
now happily return None when auth is not required _and_ no credentials
are present, rather than throw up all over the place.

Change-Id: I72ae6154268bdf26be6054c0fef6a4c67c71119c
2017-04-25 07:27:17 -05:00
Dean Troyer f0819efe6b Add endpoint hook to BaseAPI
Duplicate the basic endpoint cleanup (removing trailing '/') into
a method that can be overridden in subclasses to do additional things
like API-specific version handling.

Add more tests for the combinations of endpoint and url and some
corner-case checking.

Change-Id: I4b4f2abdec29e4d29b61338077f9c1320cec5bb8
2017-04-21 11:49:15 -05:00
Jenkins aa31cbb63d Merge "Add token auth test" 2017-04-20 20:18:16 +00:00
Jenkins a33b92613c Merge "Revert "Avoid to authenticate twice"" 2017-04-20 20:18:09 +00:00
Dean Troyer 897e623252 Add token auth test
Add a ClientManager test for Token authentication (specifically
keystoneauth's admin_token) that got dropped in the move from
OSC because OSC uses its own token_endpoint plugin loader, but
creates the same AdminToken object.

This would have prevented the issues seen with the merging of
https://review.openstack.org/452711 that were subsequently reverted
in https://review.openstack.org/458586.

Change-Id: I516682057d759d4becd8f6675cf7fa262d224eb9
2017-04-20 12:16:47 -05:00
Dean Troyer aec3f4a831 Revert "Avoid to authenticate twice"
This reverts commit ffd548c774.

Token plugin doesn't have get_access.

Change-Id: I624b1bc557a195bdf8a7c5a32dc0e72a6fa8b075
2017-04-20 16:35:29 +00:00
Jenkins c36c9a0600 Merge "Add more API support" 2017-04-19 14:39:01 +00:00
Jenkins 7cbadcbe86 Merge "Avoid to authenticate twice" 2017-04-19 14:30:02 +00:00
Jenkins 04a39bd0ab Merge "Add formattable column base classes" 2017-04-19 14:29:57 +00:00
Reedip 4d8fbe6949 Add MultiKeyValueCommaAction to osc-lib
Based on [1], the following class is transitioned to
osc-lib as it may be required in other scenarios as well.
[1]:https://review.openstack.org/#/c/356263/13

* Tests rewritten to be more straightforward in checking combinations
  and expected results.

Change-Id: I293b5b25adcf8ed6815608db4f280ee4e3da5da9
2017-04-18 21:46:38 -05:00
Dean Troyer 5f2ef31254 Add more API support
Support the OSC API changes:
* Pass headers through properly
* Add some common methods and exceptions

Change-Id: Ic1e21320c471a9cc07cefe51dba01f27f507bcb4
2017-04-18 10:47:10 -05:00
Rui Chen 17b1cf3454 Add formattable column base classes
Currently, we use utils.format_dict(), utils.format_list(),
utils.format_list_of_dicts to make column value can be easy to read by
human, but osc support to format the CLI output into several format,
like: json, shell, csv, yaml, most of these should be understand by
program and code, so keeping the column content as the original value
make sense, like {u'name': u'RuiChen'} than name='RuiChen'

Add some base formattable column classes into osc-lib in order to all
the osc plugins can use it.

Change-Id: I024a42bdd100d2541043bf4caf7b003b169be2a9
Implements: blueprint osc-formattable-columns
2017-04-18 03:33:52 +00:00
OpenStack Proposal Bot 18d869469a Updated from global requirements
Change-Id: I6c00cd5337bebcbc23f2b8f2c64d6776290d4953
2017-04-12 04:19:50 +00:00
OpenStack Proposal Bot a2f26962d4 Updated from global requirements
Change-Id: I5911974281816d66b66e3c643f7ad6030bef813e
2017-04-07 06:14:33 +00:00
Cedric Brandily ffd548c774 Avoid to authenticate twice
Currently osc-lib ClientManager[1] gets the auth_ref using get_auth_ref
method from the auth_plugin[2] but this method bypasses the auth plugin
memoize system in get_access method[2] and the auth_ref is not memoized
by the auth plugin. It implies osc-lib authenticates twice:
 - one auth to get an auth_ref in osc-lib
 - one auth to persist an auth_ref in the auth plugin[1] in order to
   perform authenticated requests.

This change updates the ClientManager in order to get the auth_ref using
get_access instead of get_auth_ref and to delegate auth_ref memoize to
the iauth plugin.

[1] osc_lib.clientmanager.ClientManager
[2] keystoneauth1.identity.base

Closes-Bug: #1679069
Change-Id: I4ba9188adcf1a05ad60283079262a9508a13b47f
2017-04-04 10:41:27 +02:00
Jenkins 52404a8b7d Merge "Change noauth strategy for plugin loading" 2017-03-30 23:30:23 +00:00
Dean Troyer 7881c8abd6 Change noauth strategy for plugin loading
Don't do it.

os-client-config's plugin loading has been causing this pain for a long
time, removing the KSC hack-around in o-c-c unmasked this again.  So when
auth is not reuired, just don't let o-c-c do any plugin loading at all.

Ever.

Change-Id: Ie68c82f7b073012685f0513b615ab1bf00bc0c3a
2017-03-27 15:58:33 -05:00
Huanxuan Ao 6face4c874 Nit: Reorder some util methods in alphabetic order
Change-Id: Iab7fdd62c658a6238c9ac3fa1966b12a1ce380c2
2017-03-24 12:28:51 +08:00
Jenkins 8d3333cc3c Merge "Util methods for column name backward compatibility" 2017-03-23 13:54:29 +00:00
Jenkins fdf9f0cd66 Merge "Pass ssl values through to OCC" 2017-03-23 13:49:09 +00:00
Jenkins 2a3881db53 Merge "The python 3.5 is added" 2017-03-23 13:45:27 +00:00
luqitao 9c60f85ff8 Using assertIsNone() instead of assertEqual(None)
TrivilalFix

Following OpenStack Style Guidelines:
[1] http://docs.openstack.org/developer/hacking/#unit-tests-and-assertraises
[H203] Unit test assertions tend to give better messages for more
specific assertions. As a result, assertIsNone(...) is preferred over
assertEqual(None, ...) and assertIs(..., None)

Change-Id: Ifcac62f400ec15017a1db06ba889ed5e2d6a07f0
2017-03-21 22:19:04 -04:00
Jenkins 2819834241 Merge "Updated from global requirements" 2017-03-21 23:53:51 +00:00