Commit Graph

12 Commits

Author SHA1 Message Date
Stephen Finucane d3f4a3d7f5 Blacken everything else
Black used with the '-l 79 -S' flags.

A future change will ignore this commit in git-blame history by adding a
'git-blame-ignore-revs' file.

Change-Id: I356643d06b2cd408ccaedfe02b858aea55388949
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-10 10:51:30 +01:00
Monty Taylor 8c47b67e83 Build utility image for using osc
python-openstackclient currently has a non-zero number of dependencies,
so for admins who would like to run it on laptops or similar it can
get tricky. In opendev, for instance, admins have it installed into
a venv on a jump host, but it's really wonky to keep up with.

Use the opendev/python-builder opendev/python-base pair to make a
minimal image that contains an install of python-openstackclient
and publish it to the osclient org on dockerhub. There is an overall
policy against having binary artifacts such as this appear to be
official deliverables of the OpenStack project, which this is not.
It's also only publishing images based on master, so no warranties
should be implied. But if this makes life easier for a user somewhere,
cool.

Change-Id: I9a8bfc27c127e92b6856cb6a3e45b32c818db16c
2020-03-14 17:15:46 -05:00
Dean Troyer d324530532 osc-lib: api.auth
Move auth plugin checking to osc-lib.

Change-Id: I673d9c2d6e8bbf724c3000459a729e831d747814
2016-06-30 08:57:59 -05:00
Dean Troyer bf090c69c2 Switch to ksa Session
* Change session imports to keystoneauth1
* Change keystoneclient.exception imports to keystoneauth1
* Change exceptions raised from internal API from keystoneclient to openstack.common

Change-Id: I046d89f561d6fe04baae53726f9749d2e7fe2056
2015-12-02 01:55:14 +00:00
TerryHowe 700048a1e0 Fix examples with cacert
Change-Id: I2a4f758ef11caf51d0c47cb5632e59245d631d3d
Closes-Bug: #1470272
2015-07-01 05:11:45 -06:00
Dean Troyer a05cbf4c99 Rework shell tests
This is the first step in reworking the shell argument handling,
clean up and add tests to ensure functionality doesn't change.

* Rework shell tests to break down global options and auth options.
* Make tests table-driven
* Remove 'os_' from 'cacert' and 'default_domain' internal option names

Change-Id: Icf69c7e84f3f44b366fe64b6bbf4e3fe958eb302
2015-06-02 09:49:17 -05:00
Dean Troyer 5649695c65 Add --os-cloud support
This adds a new option --os-cloud that allows the configuration values
for multiple clouds to be stored in a local file and selected with
a single option.

Internal option names have had 'os_' removed to be comptible with
the options returned from OpenStackConfig().get_one_cloud().

The config file is ~/.config/openstack/clouds.yaml:

Sample
------
clouds:
  devstack:
    auth:
      auth_url: http://192.168.122.10:35357/
      project_name: demo
      username: demo
      password: 0penstack
    region_name: RegionOne
  devstack:
     auth:
       auth_url: http://192.168.122.10:35357/
       project_name: demo
       username: demo
       password: 0penstack
     region_name: RegionOne

Co-Authored-By: Monty Taylor <mordred@inaugust.com>
Change-Id: I4939acf8067e44ffe06a2e26fc28f1adf8985b7d
Depends-On: I45e2550af58aee616ca168d20a557077beeab007
2015-04-18 23:04:51 -05:00
Dean Troyer 749920bc65 Move OSC auth plugins so they can be found
The plugin detection at the top of openstackclient.api.auth did not
detect the plugins at the bottom of that file because, surprise,
they had not been declared yet so the entry points were ignored.

Move both plugin subclasses into openstackclient.api.auth_plugin.

Fix a problem with the password callback that was otherwise made
worse with this change.

Closes-Bug: 1428912
Change-Id: Idc3b72534071e0013c8922884a8bc14137509a0f
2015-03-10 03:16:12 +00:00
Dean Troyer 505fa14cd6 Fix auth-required for help command
When we got picky with the auth arguments we broke using help without
any auth config supplied.  This rearranges things a bit to do the argument
checking when the deferred auth request to Identity occurs so commands
that do not need auth have a chance to live short but useful lives.

Closes-Bug: #1399588
Change-Id: I8ceac491cf65e25eddb62ab2713f471fe686756d
2015-02-27 17:27:17 -06:00
Steve Martinelli 1d75edb167 Default user domain id and project domain id
If either of OS_USER_DOMAIN_ID or OS_USER_DOMAIN_NAME are present
then we don't tinker with anything. Otherwise, we should set
the USER_DOMAIN_ID to 'OS_DEFAULT_DOMAIN', as this provides a better UX,
since the end user doesn't have to specify these arguments.

Same logic applies for OS_PROJECT_DOMAIN_ID.

Closes-Bug: #1385338

Change-Id: I8a4034c16a1dd50d269f809abab8e960d5de20f7
2015-01-16 02:52:15 -05:00
Dean Troyer 01a5ff6d32 Add more session/api examples
* examples/object_api.py - Example of using the Object_Store API
* examples/osc-lib.py - Minimal client to use ClientManager as a library

Also add matching functional tests

Change-Id: I4243a21141a821420951d4b6352d41029cdcccbc
2014-11-15 16:29:14 -06:00
Steve Martinelli 126b2c5436 Add an API example base and functional test base
Add examples/common.py, which is a basic common setup that mimics OSC's
configuration options and logging without the rest of the CLI.

Also add the functional test tooling for examples to prevent bit rot.

Co-Authored-By: Dean Troyer <dtroyer@gmail.com>
Change-Id: Ie92b675eafd93482ddc9a8ce0b0588e23ed50c35
2014-11-15 16:29:08 -06:00