39 Commits

Author SHA1 Message Date
Josh Kearney
78086a8e89 Use install_venv_common.py from oslo.
This syncs install_venv_common.py from oslo and reworks the
tools/install_venv.py script to use the new library.

Change-Id: I3426a7f51b0018e074cc6f4b1d70b38e52464a38
2013-01-29 16:12:21 -06:00
Jenkins
d32cbac3fd Merge "Sync latest openstack-common updates." 2013-01-28 23:49:44 +00:00
Josh Kearney
078d9f461a Sync latest openstack-common updates.
Change-Id: I09adc9b5c01aa97ffba58dff8a696172e8654e3e
2013-01-24 14:44:54 -06:00
Josh Kearney
f77c3849ab Standardize on a copyright header and ensure all files have them.
Change-Id: I64812bca01ca655c9cf9239a0daea84907082a29
2013-01-24 12:02:23 -06:00
Josh Kearney
5526565ac4 Clean up test environment and remove unused imports.
First round of adding more complete unit test coverage.

Change-Id: Ic1979c499ca6fcb784892a95954a3527539c4e53
2013-01-22 11:44:18 -06:00
Josh Kearney
3da30ae01a Adds Glance API v2 support.
Change-Id: Ib0325e62a7e50aa94e852a73f9a2cb95daa8d5f6
2013-01-16 11:29:34 -06:00
Alessandro Pilotti
690b8214de Fixes setup compatibility issue on Windows
Fixes Bug #1052161

"python setup.py build" fails on Windows due to a hardcoded shell path:
/bin/sh

setup.py updated using openstack-common/update.py

Change-Id: I33d38e0f96b6d124248c4a31959952d61cf1eb16
2012-11-05 18:34:15 +02:00
Bhuvan Arumugam
b9936da0b6 Keyring support for openstackclient.
Bug: 1030440

If password is defined in keyring, use it; otherwise, prompt for the
password. Keying is configured using command line switch,
--os-use-keyring or env(OS_USE_KEYRING).

* openstackclient/common/openstackkeyring.py
  The abstract class for keyring, specifically for openstack. The
  class is used to store encrypted password in keyring, without
  prompting for keyring password. The encrypted password is
  stored in ~/.openstack-keyring.cfg file.

* openstack-common.py
  Update openstackkeyring library from openstack.common.

* openstackclient/shell.py
  OpenStackClient.build_option_parser(): New boolean argument,
   --os-use-keyring, default to env(OS_USE_KEYRING).
  OpenStackClient.authenticate_user(): Get password from keyring,
  if it is defined; otherwise, prompt for the password. If user
  enter a password and keyring is enabled, store it in keyring.
  OpenStackClient.init_keyring_backend(): New method to define
  openstack backend for keyring.
  OpenStackClient.get_password_from_keyring(): New method to
  get password from keyring.
  OpenStackClient.set_password_in_keyring(): New method go set
  password in keyring.

* toos/pip-requires
  Define keyring and pycrypto as one of dependent.

Change-Id: I36d3a63054658c0ef0553d68b38fefbc236930ef
2012-08-15 12:13:36 -07:00
Jenkins
384d674d04 Merge "If no password in env or command line, try prompting." 2012-07-05 16:56:35 +00:00
Ken Thomas
797ea75728 If no password in env or command line, try prompting.
Implements blueprint password-prompt

This logic was recently added to keystone as a short term fix. The long
term fix is to have that same logic here. Basically, if no password is
present in the env or command line and there's a tty available for us
to prompt, then attempt to use getpass.

Change-Id: Ia0eec800b96c8f6ca1c2540e21e0e03c3880c713
2012-06-29 22:29:46 +00:00
Monty Taylor
1628930978 Add read_versioninfo method.
Change-Id: Iba12b260a30cc1311967a833e26eaeb9bf3afb47
2012-06-26 21:06:04 -05:00
Monty Taylor
2d58c18d5c Add post-tag versioning.
Change-Id: I98e5f7aa788b1ab1a866b21e0a17a63b8d5efae3
2012-06-25 11:31:49 -05:00
Clark Boylan
1fece78a1d Fix pep8 issues.
Fix several pep8 issues and pin the pep8 test to pep8 version 1.1.
This should prevent future changes from being unmergable by the pep8
gate after a pep8 upgrade.

Change-Id: I4678a9179579fb5c7afe795fb43a8a89a99ad717
2012-06-13 10:49:43 -07:00
Matt Joyce
3218849996 minor fixes
Change-Id: Ib5601e1a932e0bfaa0341909416415d1e81ee915
2012-05-29 14:31:00 -07:00
Dean Troyer
3ee4d59bb5 Add endpoint CRUD commands
* add {create|delete|list|show} endpoint commands

Change-Id: Ife9fa789d5818d63288b09687b43d802b1b97858
2012-05-18 10:35:20 -05:00
Dean Troyer
b26a8509c5 Update service commands
* add {create|delete} service
* allow 'service' arg to also search type attribute in show command

Change-Id: I992359dc95fab1fbdab0666d5cbb75e44ba6e0f3
2012-05-15 15:48:11 -05:00
Jenkins
363a373fb2 Merge "fix authentication setup in interactive mode and improve error handling so tracebacks are not printed twice" 2012-05-15 19:12:33 +00:00
Doug Hellmann
4f8798c944 fix authentication setup in interactive mode and improve error handling so tracebacks are not printed twice
Change-Id: I59fb07369edad3b2f2abddba3c0d0f6bbce1eab1
2012-05-14 10:50:57 -04:00
Dean Troyer
49099b6610 Revise command boolean flags
* use --enable|--disable form for boolean 'enabled' value
* clean up logging strings

Change-Id: Ib4016bbef1763c27ec5a9edf36b926dc0d0b265c
2012-05-11 17:27:03 -05:00
Dean Troyer
dffbcf5dd3 Move get_client_class() to common.utils
* add constants for API_NAME

Change-Id: I8ccf72f032227e0a452d96303181549b1b11a5d1
2012-05-11 13:49:45 -05:00
Dean Troyer
de59bda6c6 Add tenant CRUD commands
* add {create|delete|set} tenant commands

* move get_XXXX_properties() to common.utils.get_item_properties()
  add mixed_case_fields as an optional arg

Change-Id: I7b3bd9cefb08e39730886b31213cbe422b5a8453
2012-05-11 12:08:05 -05:00
Dean Troyer
806a202caf Add API versioning support
* Specific versions supported are managed in XXXXXX.client.py with a
  mapping from version to client class.  This is based on the scheme
  that is included in novaclient; none of the other client libs have
  that capability.

Change-Id: I930b197f1189e7f52c3b0096e73e0773cf925542
2012-05-10 15:52:15 -05:00
Doug Hellmann
698d6e6056 look at the command the user is going to run before trying to authenticate them
Change-Id: I4edc6a0f1e16be4cd80fe01f62869094b50ef120
2012-05-10 16:05:23 -04:00
Dean Troyer
e6191cf701 Add copyright notices and update dates
Change-Id: I54a7d99328143205ab97ea930aeeeb69fe92c76c
2012-05-10 14:58:16 -05:00
Dean Troyer
2696da2a1f More identity client config
* move auth option checking back to OpenStackShell() to keep the shell-level
  interaction at that level; add checking for token flow options

* make identity.client.make_client() configure keystoneclient.v2_0.Client()
  properly for both password flow and token flow auth

* eliminated ClientManager.init_token(), set _service_catalog in __init__()

* compute client handles token flow

Change-Id: I42481b5424489387798c4ec6d3e2a723ab1e6067
2012-05-10 13:54:58 -05:00
Dean Troyer
d70f92e18e Remove printt
Remove unused common.utils functions
prettyprint 0.6 removed printt at the last minute, our references
to it turned out to be in unused code; remove it.

Change-Id: I38a4d9a169beaecfd53eafc5b10f06201bac0c31
2012-05-07 14:05:22 -05:00
Dean Troyer
7c456b3857 Add Identity to ClientManager
* Make the Identity client in identity.client.make_client()
* Auth via ClientManager.identity
* Skip extra auth roundtrip in compute client

Change-Id: I0190639e38f83997c233195f6cc27ff3afdfba10
2012-05-04 16:37:18 -05:00
Doug Hellmann
3a17779a2f Fix "help" command and implement "list server" and "show server"
blueprint client-manager
blueprint nova-client
bug 992841

Move the authentication logic into a new ClientManager class so that only commands that need to authenticate will trigger that code.
Implement "list server" and "show server" commands as examples of using the ClientManager, Lister, and ShowOne classes.

Change-Id: I9845b70b33bae4b193dbe41871bf0ca8e286a727
2012-05-04 09:35:40 -04:00
Bhuvan Arumugam
6d7035611b Auto generate AUTHORS for python-openstackclient.
Bug: 976267

Now that git commits are gated by CLA, we shouldn't enforce
committers to add an entry in AUTHORS file. The AUTHORS file
should be generated automatically, based on git commits.

This commit fixes the problem.

* AUTHORS
  Remove this file.

* tests/test_authors.py
  Remove this test case.

* .gitignore
  Add AUTHORS file.

* openstackclient/openstack/common/setup.py
  generate_authors(): New method to create AUTHORS file. If
  AUTHORS.in file exists, append it's content to AUTHORS file.

* setup.py
  Import the new method.
  Generate AUTHORS file before creating the package.

Change-Id: Ia5488a43f88e13a0fb1f7a5d8d10a576b9034dc8
2012-05-01 16:31:23 -07:00
Dean Troyer
0274c7f8de Shell init & logging
* Split global app init to initialize_app()
* Set up logging & eliminate debug prints

Change-Id: I7c1e1f6fa336a4ff828007e240c890282cbd3015
2012-05-01 15:04:26 -05:00
James E. Blair
5ad84ff294 Add openstack-common and test infrastructure.
Fix pep8 errors (project is pep8 clean now).

Update setup.py to use openstack-common style dependencies.

Remove the unused novaclient dependency.

Change the keystoneclient dependency to a git URL.

Add test-requires, and move some pip-requires dependencies
into it.

Remove the test_utils unit test which wasn't testing anything
that is actually present in the project.

Add the test_authors unit test.

Use tox for running tests locally.

See: http://wiki.openstack.org/ProjectTestingInterface

Tox can manage virtualenvs, and is currently doing so for running
tests in Jenkins. It's just as, or more, useful for running tests
locally, so this starts the migration from the run_tests system to
tox. The goal is to reduce duplicate testing infrastructure, and
get what's running locally on developer workstations as close to
what is run by Jenkins as possible.

Run_tests.sh will now call tox to facilitate the transition for
developers used to typing "run_tests.sh".

Developers will need tox installed on their workstations. It can
be installed from PyPI with "pip install tox". run_tests.sh outputs
those instructions if tox is not present.

New facilities are available using tox directly, including:

tox -e py26 # run tests under python 2.6
tox -e py27 # run tests under python 2.7
tox -e pep8 # run pep8 tests
tox # run all of the above
tox -e venv foo # run the command "foo" inside a virtualenv

The OpenStack nose plugin is used when running tox from the
command line, so the enhanced, colorized output is visible to
developers running the test suite locally. However, when Jenkins
runs tox, xunit output will be used instead, which is natively
understood by jenkins and much more readable in that context.

Change-Id: Ib627be3b37b5a09d3795006d412ddcc35f8c6c1e
2012-04-28 22:27:34 +00:00
Dean Troyer
f4d032ab8a Cleanup auth client path 2012-04-27 12:25:25 -05:00
Dean Troyer
db0ff40d60 Add 'list service' command and common modules 2012-04-27 11:53:06 -05:00
Dean Troyer
4cee9bca79 Add token auth to shell and README 2012-04-27 11:49:15 -05:00
Dean Troyer
efc38ed579 Begin to add Keystone auth 2012-04-27 10:18:47 -05:00
Dean Troyer
685becca8a Change to argparse to match cliff 0.2 2012-04-26 15:58:31 -05:00
Dean Troyer
a9446dcfc8 Use cliff 2012-04-25 16:48:19 -05:00
Dean Troyer
2d53e4677c Set up common utils 2012-04-25 16:10:05 -05:00
Dean Troyer
882a76790b Add openstackclient bits 2012-04-19 22:41:44 -05:00