670 Commits

Author SHA1 Message Date
Steve Martinelli
070fa5091d Remove links from federation related commands in identity v3
We should remove the 'links' portion from the returned object
for the following commands:

* create/show federation protocol
* create/show mapping
* create/show identity provider

Change-Id: I55654cce1f89de8e532f9acd8092257be33efd85
2014-11-13 16:04:49 -05:00
Jenkins
b8d8e35a27 Merge "Tests work fine with random PYTHONHASHSEED" 2014-11-12 23:19:12 +00:00
Jenkins
89f485f605 Merge "Use fixtures from keystoneclient for static data" 2014-11-12 21:54:07 +00:00
Oleksii Chuprykov
ab89ef5876 Tests work fine with random PYTHONHASHSEED
Change-Id: Iba6fc87bbff289ae2572a7eb132f5c946dfa0956
Related-Bug: #1348818
2014-11-12 15:55:39 +02:00
Jenkins
c8ddfd8311 Merge "Swap remaining assertEqual arguments" 2014-11-10 19:01:52 +00:00
Jenkins
3001d602c5 Merge "Add --or-show option to user create" 2014-11-10 18:58:36 +00:00
OpenStack Proposal Bot
951ca3a6f3 Updated from global requirements
Change-Id: I778a0c00da51cdc52cd67d1b273d52e84d68992b
2014-11-08 14:25:05 +00:00
Dean Troyer
46f6df5f23 Swap remaining assertEqual arguments
Change-Id: I1abdebb298b93074657a7ba65a7186d814969780
2014-11-07 15:08:08 -06:00
Dean Troyer
42d0b20ebc Add --or-show option to user create
The --or-show option is added to create commands for the common case
of needing to ensure an object exists and getting its properties if
it does or creating a new one if it does not exist.

Note that if the object exists, any additional options that would
set values in a newly created object are ignored if the object
exists.

FakeResource needs the __name__ attribute to fall through utils.find_resource.

Prove the concept on v2 user create then propogate once we're happy with it...

Change-Id: I6268566514840c284e6a1d44b409a81d6699ef99
2014-11-07 12:28:42 -06:00
Colleen Murphy
59735bf10d Add cliff-tablib to requirements
cliff-tablib gives cliff the ability to format list and show output in
html, json, or yaml (http://cliff-tablib.readthedocs.org/). This patch
adds cliff-tablib to requirements.txt so that it can be installed along
with cliff.

Change-Id: I4daab97642482e6f40cd8209ff5edd9c680092c0
2014-11-07 15:48:40 +01:00
Jamie Lennox
b193793636 Use fixtures from keystoneclient for static data
We should use the fixture generation code from keystoneclient rather
than keep our own copies of the token and discovery structure.

Change-Id: I53c1d2935d1d65c39b8abea89427af2fc3edd181
2014-10-31 15:15:54 +01:00
Matthieu Huin
631ed3c802 Unscoped federated user-specific commands
A federated user can authenticate with the v3unscopedsaml plugin and
list the domains and projects she is allowed to scope to.
This patch introduces the new commands 'federation domain list' and
'federation project list'.
Note that for these commands -and plugin- to be available, the lxml
library must be installed.

Change-Id: I2707b624befcfb0a01b40a094e12fd68a3ee7773
Co-Authored-By: Florent Flament <florent.flament-ext@cloudwatt.com>
2014-10-30 17:27:28 +01:00
Dean Troyer
2c9d263611 Fix server create for boot-from-volume
* server create required --image even when booting the server from a
  volume.  Change options to require either --image or --volume to
  specify the server boot disk.  Using --volume currently uses device
  'vda' for the block mapping and ignores any other block mappings
  given in --block-device-mapping.
* server create and server show are both affected by bug 1378842 where
  an excepion was thrown when no image ID was present in the returned
  server object, which is the case for a server booted from a volume.
* Fix the remaining assertEqual() order problems in test_server.py

Closes-Bug: 1378842
Closes-Bug: 1383338
Change-Id: I5daebf4e50a765d4920088dfead95b6295af6a4d
2014-10-24 17:55:44 -05:00
Dean Troyer
8ba74451ee Adjust some logging levels
* Promote select messages to INFO so lower logging levels can be useful
* Help more modules not say so much all the time

Change-Id: I814023c1489595998ae74efe40ef439b3522ee74
2014-10-24 13:16:41 -05:00
Jenkins
d07ae4236a Merge "Close files on image create" 2014-10-24 16:16:04 +00:00
Jenkins
d140d8940f Merge "Close files on server create, add tests" 2014-10-24 16:12:06 +00:00
Jenkins
747a62494c Merge "Change --os-auth-plugin to --os-auth-type" 2014-10-24 16:11:42 +00:00
Jenkins
6a4b673e88 Merge "Update use of open() in object API" 2014-10-24 06:38:22 +00:00
Dean Troyer
f079b5b9c4 Change --os-auth-plugin to --os-auth-type
User's don't know what a plugin is.

* Internally, os_auth_type and/or auth_type represents what the
  user supplied.
* auth_plugin_name is the name of the selected plugin
* auth_plugin is the actual plugin object

Plugin selection process:
* if --os-auth-type is supplied:
  * if it matches against an available plugin, done
  * (if it can map to an availble plugin type, done; TODO in a followup)
* if --os-auth-type is not supplied:
  * if --os-url and --os-token are supplied, select 'token_endpoint'
  * if --os-username supplied, select identity_api_version + 'password'
  * if --os-token supplied, select identity_api_version + 'token'

Change-Id: Ice4535214e311ebf924087cf77f6d84d76f5f3ee
2014-10-23 15:37:44 -05:00
Jenkins
7153ff41fb Merge "Include support for using oslo debugger in tests" 2014-10-22 23:29:30 +00:00
Jenkins
b5bee429a4 Merge "Clean up shell authentication" 2014-10-22 20:04:28 +00:00
Steve Martinelli
e7bba3211a Include support for using oslo debugger in tests
Simply run `tox -e debug <test_name>` to get an interactive
debugging prompt

Change-Id: I09e5b844a33c2f0fd4230f01fbc6c0aa8d752545
2014-10-22 14:29:36 -04:00
Dean Troyer
e063246b97 Clean up shell authentication
* Remove the auth option checks as the auth plugins will validate
  their own options
* Move the initialization of client_manager to the end of
  initialize_app() so it is always called.  Note that no attempts
  to actually authenticate occur until the first use of one of the
  client attributes in client_manager.  This leaves
  initialize_clientmanager() (formerly uathenticate_user()) empty
  so remove it.
* Remove interact() as the client_manager has already been created
  And there is nothing left.
* prepare_to_run_command() is reduced to trigger an authentication
  attempt for the best_effort auth commands, currently the only
  one is 'complete'.
* Add prompt_for_password() to ask the user to enter a password
  when necessary.  Passed to ClientManager in a new kward pw_func.

Bug: 1355838
Change-Id: I9fdec9144c4c84f65aed1cf91ce41fe1895089b2
2014-10-21 23:16:16 -05:00
Jenkins
5b7d3ba9dc Merge "Fix token issue after auth changeup" 2014-10-21 19:56:59 +00:00
Dean Troyer
cd368bb816 Fix token issue after auth changeup
IssueToken.take_action() was missed in updating the structure of
the ClientManager.

Also, TOKEN_WITH_TENANT_ID in v3 is just wrong...

Closes-Bug: #1383396

Change-Id: If2dd82a26af1d743ee9df73e0c1aebce497bf22e
2014-10-20 18:21:51 +00:00
wanghong
f600c0eafb only generate one clientmanager instance in interactive mode
Currently, we repeated to generate clientmanager instance when run
command in interactive mode. This should be avoided.

Change-Id: I0536a690bc173be38af08a2e4443115532041efd
Closes-Bug: #1383083
2014-10-20 15:29:53 +08:00
Dean Troyer
2166d7d3af Remove ClientManager._service_catalog
Anything that needs a service catalog can get it directly from
auth_ref.service_catalog, no need to carry the extra attribute.

ClientManager.get_endpoint_for_service_type() reamins the proper
method to get an endpoint for clients that still need one directly.

Change-Id: I809091c9c71d08f29606d7fd8b500898ff2cb8ae
2014-10-18 00:01:52 -05:00
Dean Troyer
0de67016c7 Remove now-unnecessary client creation hacks
Clients that can use ksc Session don't need the old junk to
fake auth anymore:
* compute
* volume

Clients that still need to be fed credentials can pick directly
from the auth object in clientmanager.  The _token attribute is
removed, the token can be retrieved from the auth object:

  openstackclient/tests/common/test_clientmanager.py

This change will break any plugin that relies on getting a token
from instance._token. They should be updated to use the above, or
preferable, to use keystoneclient.session.Session to create its
HTTP interface object.

Change-Id: I877a29de97a42f85f12a14c274fc003e6fba5135
2014-10-18 00:01:45 -05:00
Jenkins
68130fa921 Merge "Add plugin to support token-endpoint auth" 2014-10-17 23:27:28 +00:00
Jenkins
efc572efc1 Merge "use jsonutils in oslo.serialization instead of keystoneclient" 2014-10-17 22:33:53 +00:00
Jenkins
b40fa49809 Merge "Move plugin stuff to clientmanager" 2014-10-17 20:13:55 +00:00
wanghong
deda023314 use jsonutils in oslo.serialization instead of keystoneclient
keystoneclient/openstack/common/jsonutils.py is removed in this patch
https://review.openstack.org/#/c/128454/
Now, we should use jsonutils in oslo.serialization package.

Change-Id: I7c8e8e6d5dffa85244368fd578616c9b19f4fd21
2014-10-17 14:13:32 +08:00
Jenkins
fa9cdef874 Merge "Add 'command list' command" 2014-10-14 22:23:20 +00:00
Dean Troyer
89217a6557 Close files on server create, add tests
The files opened for the --files and --user-data options were never
closed, potentially leaking memory in a long-running client. Close
them if they are file objects.

Add a couple of basic tests for server create.

Change-Id: I1658b0caa2d6af17308149cb52196ee28266ddf2
2014-10-14 15:45:20 -05:00
Dean Troyer
ca783f4659 Close files on image create
The file opened for --file was never closed.  Close it if it is a
file object.

Change-Id: I7bd120a2413de42339771d01e8fd1894d38c3011
2014-10-14 15:37:23 -05:00
Jenkins
1d9194d4cb Merge "Put pbr and six first in requirements list" 2014-10-14 05:40:50 +00:00
Jenkins
87f5da02c3 Merge "Fix operation on clouds with availability-zones" 2014-10-14 04:11:24 +00:00
Dean Troyer
897418edca Move plugin stuff to clientmanager
The OSC plugins work by adding an object as an attribute to a
ClientManager instance.  The initialization and management of
thos plugins belongs in clientmanager.py.

At this point the only part not moved is the API version dict
initialization bcause the timing and connection to the
CommandManager initialization.  It gets refactored anyway when
API discovery becomes operational.

Change-Id: If9cb9a0c45a3a577082a5cdbb793769211f20ebb
2014-10-13 23:02:34 -05:00
Dean Troyer
bcf4b3caec Update use of open() in object API
* Switch to use io.open() for py3 compatibility and simpler testing.
* Open files in 'rb' mode to avoid translation on Windows

Previously tests simply relied on files that were present in the
repository to run tests using open().  Change the filenames to ensure
that no longer happens.

requests_mock doesn't have a way to match against the request body for
PUT/POST; an attempt to add a new Matcher to do that worked but it
needs to subclass the currently private adapter._Matcher class or
duplicate most of its functionality.

Change-Id: I8c30b41db20af8ecafe67e760e872fc08adec905
2014-10-13 10:34:11 -05:00
Jenkins
79a9331f95 Merge "Remove 'links' section from several v3 Identity objects" 2014-10-13 03:26:27 +00:00
Monty Taylor
a388ce40f4 Put pbr and six first in requirements list
Each of them have scenarios where it's important that they install
first.

Change-Id: Ia9fff6e94651693f9fa74ca676771b19144bcd8b
2014-10-12 17:10:07 -05:00
Jenkins
36212c43d8 Merge "Updated from global requirements" 2014-10-12 21:52:07 +00:00
Dean Troyer
c3c6edbe8a Add plugin to support token-endpoint auth
The ksc auth plugins do not have support for the original
token-endpoint (aka token flow) auth where the user supplies
a token (possibly the Keystone admin_token) and an API endpoint.
This is used for bootstrapping Keystone but also has other uses
when a scoped user token is provided.

The api.auth:TokenEndpoint class is required to provide the
same interface methods so all of the special-case code branches
to support token-endpoint can be removed.

Some additional cleanups related to ClientManager and creating
the Compute client also were done to streamline using sessions.

Change-Id: I1a6059afa845a591eff92567ca346c09010a93af
2014-10-12 16:48:43 -05:00
Jenkins
49c74229b4 Merge "Mark identity v2 resources for translation" 2014-10-12 18:50:27 +00:00
Jenkins
4a34e7d0e6 Merge "Update compute server messages for translation" 2014-10-12 07:30:33 +00:00
Jenkins
5fcd462ead Merge "Add translation markers for user v2 actions" 2014-10-12 07:20:09 +00:00
Jenkins
c39867f980 Merge "Fix issue token for v3" 2014-10-12 07:11:20 +00:00
Steve Martinelli
a8d4b0eebb Remove 'links' section from several v3 Identity objects
The links field in the returned objects from the v3 Identity
API aren't really useful, so let's remove them.
Managed to remove most of them from the core API.
I'll likely remove the extension/contribution (oauth/federation)
related ones in another patch.

Also in this patch the code for setting services and projects
was changed. Though not incorrect, it was not needed to copy
the entire returned object, we should just need to pass in
the fields we want to update.

Change-Id: I164ca9ad8b28fa10b291e9115ef40753e387c547
2014-10-11 22:35:12 -04:00
Steve Martinelli
1b3c7ec122 Fix issue token for v3
Currently the code is broken as it references a part of
keystoneclient that does not exist.

Change-Id: I7fbc754537fbb4acffb166b5854840acfaef1fb8
Closes-Bug: #1379871
2014-10-11 20:34:09 -04:00
OpenStack Proposal Bot
7b046f9511 Updated from global requirements
Change-Id: I2ac5b9ac545c1bb6ec6279ecbe74e3301eb07a25
2014-10-11 22:37:59 +00:00