21 Commits

Author SHA1 Message Date
Vishvananda Ishaya
1e4a778bf8 Store tenant_id from keystone and use for quotas
Some calls in nova require a tenant_id when it could be interpreted
from the current authentication data, so save the tenant id and
use it in the quotas command if tenant_id is not specified.

Change-Id: I89647cfe9da73bc474ef80a61a5678db42a5571c
2013-01-31 14:38:21 -08:00
Dean Troyer
aa1df04bad Use requests module for HTTP/HTTPS
* Implement correct certificate verification
* Add --os-cacert
* Rework tests for requests

Pinned requests module to < 1.0 as 1.0.2 is now current in pipi
as of 17Dec2012.

Blueprint: tls-verify

Change-Id: I9a25a94c8dfcaf483c4c8328439809d65cf10b38
2012-12-20 13:04:46 -06:00
Dan Prince
e483455a12 Adds --os-cache to replace old --no-cache.
Deprecates the old --no-cache option in favor of --os-cache.

The old CLI args (--no_cache and --no-cache) and ENV option
(OS_NO_CACHE) are still supported but no longer show up
in help.

The new option for --os-cache can also be set via the OS_CACHE ENV
variable... which now defaults to False. This should be much more user friendly.

Fixes LP Bug #1087776.

Change-Id: I3cea089c7e11ce75f22c2d7f3242b02b80441323
2012-12-11 12:58:37 -05:00
Chmouel Boudjnah
86c713b17a Allow different auth providers via plugin system.
- Remove the NOVA_RAX_AUTH hack and provide (temporary) compatibility
  with the new system.
- Example plugin for RAX and HP provided here :
    RAX - https://github.com/emonty/rackspace-auth-openstack
    HP - https://github.com/emonty/hpcloud-auth-openstack
- Plugin are allowed to specify their own auth_url directly.
- Thanks to mtaylor for helping on this.

Change-Id: Ie96835be617c6a20d9c3fc3bd1536083aecfdc0b
2012-08-06 09:10:00 +02:00
Sandy Walsh
0248ae78ec Whoops, the last changes to keyring introduced some problems with v1.1
auth tests.

Change-Id: I09605be563da5f026a45549d59bc0a6a1dd1d8a2
2012-06-28 13:00:56 -03:00
Vishvananda Ishaya
03f54c57e1 Makes novaclient use the volumes endpoint
* Depends on https://review.openstack.org/#change,4479
 * Adds support to change service type including tests
 * Adds decorator for methods that need to use another service type
 * Changes volume and snapshots to use the volume endpoint
 * These extensions will move into the volume client once it exists
 * Fixes bug 940017

Change-Id: I683e4ca6c67e278d8aa8a9acec3dc0f1872f43f2
2012-02-26 06:11:12 +00:00
Dean Troyer
87dab38b2b Fix bug 904364: Consistiently handle trailing '/' on URLs
novaclient used to require a trailing '/' on --auth-url and would
mysteriously break if it was not present.  This is mostly due to
urlparse.urljoin()'s behaviour; it was only used here for concatenation
so it was eliminated and trailing '/' chars consistiently stripped.
All url concatenation now requires the second element to begin
with '/'.

Change-Id: I99e95ea92682d917348201bc3190a1e77bbcbff0
2012-02-03 15:11:09 -08:00
Matt Stephenson
fe4fa9daef Add Accept: applicaton/json header to all service requests. Fixes bug 904436
Change-Id: I5f7c78f0ea516a7a96c32b1f745686e130c2b9af
2012-02-02 16:37:55 -08:00
Ziad Sawalha
38bc7ea570 Handle Ambiguous Endpoints Correctly
- Added --service_name argument to allow selecting
  endpoints by service name
- Renamed endpoint_name argument to endpoint_type (this breaks
  compatibility)
- Return AmbiguousEndpoints error if more than one endpoint
  matches filter
- Also addresses bug 924052

Use case:
  $ nova --projectid xxx --version 1.1 --password xxx --username xxx --url https://identity.openstackcloud.com/ image-list
  Found more than one valid endpoint. Use a more restrictive filter
  AmbiguousEndpoints: [
    {'serviceName': 'New Cloud', 'region': 'Test', 'publicURL': 'https://test.openstackcloud.com/v1.1/tttt', 'tenantId': 'tttt'},
    {'serviceName': 'Old Cloud', 'publicURL': 'https://servers.openstackcloud.com/v1.0/tttt', 'tenantId': 'tttt'}]

  $ nova --projectid tttt --version 1.1 --password xxx --username xxx --url https://identity.openstackcloud.com/ --service_name 'New Cloud' image-list
  +--------------------------------------+-----------------------------+--------+--------+
  |                  ID                  |             Name            | Status | Server |
  +--------------------------------------+-----------------------------+--------+--------+
  | 346f4039-a81e-4444-9223-4a3d13592a07 | Debian Squeeze (6.0)        | ACTIVE |        |
  | ac8985ea-c09e-4544-82af-eb459a02a6b2 | Fedora 15                   | ACTIVE |        |
  | ddddc02e-92fa-4f44-b36f-55b39bf66a67 | CentOS 5.6                  | ACTIVE |        |
  +--------------------------------------+-----------------------------+--------+--------+

Change-Id: I9a10b9ad5e5b9cf6e762659013496a93a79774db
2012-01-31 18:37:36 -06:00
Brian Waldon
a905e5fe07 Accept 1 and 2 as version choices
- removes all unused imports
- update .gitignore with new venv path

Change-Id: I3e8199b72dc83268115133d7c73335ffb6060f9a
2011-12-14 14:44:26 -05:00
Brian Waldon
596eb3c0a5 Fixing all remaining pep8 errors
Change-Id: Iaf50bce4a6d458b37bc5e790b7d3ee56085c3e36
2011-12-07 14:37:29 -05:00
Sandy Walsh
cdde0d22cd tests working 2011-11-09 07:10:46 -08:00
Sandy Walsh
42e726ffed now uses tenantName vs. tenantId to auth 2011-09-28 11:00:15 -07:00
Sandy Walsh
8491c76027 new service catalog implementation. 2011-09-26 12:28:43 -07:00
Sandy Walsh
2d5f6b2df6 change auth cred format for keystone 2011-09-26 07:41:42 -07:00
Nikolay Sokolov
5f241d9b8c Merge with trunk 2011-08-15 10:36:55 +04:00
Nikolay Sokolov
0ec2cbbe82 Added redirect tests, changed wrong status in test_authenticate_success. 2011-08-11 13:48:12 +04:00
Christopher MacGown
2d785404ed pep8 cleanups after the rebase 2011-08-08 13:25:29 -07:00
Christopher MacGown
0efc51ec9d pep8 in tests 2011-08-08 13:25:29 -07:00
Christopher MacGown
b1b2dee9bd Make it possible to authenticate against keystone 2011-08-05 23:17:35 -07:00
Brian Lamar
454daa2cba Tests working again...merged in some work we did earlier. 2011-08-03 17:41:33 -04:00