45 Commits

Author SHA1 Message Date
Ilya Shakhat
700ab6f282 Fix formatting in readme file
Change-Id: Ifa37d38b3c7689f703c7129459b15a367e2aafff
2016-04-22 18:01:17 +03:00
Monty Taylor
7c439073f3 Flesh out netowrk config list
Add support for indicating default_interface. Also, add some validation
and normalization code, some interface methods and, shockingly,
documentation.

Change-Id: Ib45b68894585ac02821d5d2376510fd7a8e8ee40
2016-04-02 09:09:54 -05:00
Monty Taylor
278a761df6 Change network info indication to a generic list
Networks can have more information than just internal or external. Notably,
if you have two private networks and you're trying to assign floating
ips, you need to know which network should be the recipient.

This should be backwards compatible with existing external_network and
internal_network options.

Change-Id: I0d469339ba00486683fcd3ce2995002fa0a576d1
2016-03-30 16:15:49 -07:00
Monty Taylor
03d5659d8b Update the README a bit
Cleaned up example references to now-not-existing HP Public Cloud. Also
added a named-cloud entry to the make_client section.

Change-Id: I398c438e22eb84d6079a5c45f068753c3bcaa216
2016-02-22 09:29:22 -08:00
Monty Taylor
7a4993da41 Allow session_client to take the same args as make_client
make_client is a great, simple yet flexible way to get a fully featured
Client object. simple_client is similar for Session objects, but lacks
the argparse and arbitrary kwargs that make_client - plus it has a weird
name. Since adding those two features to make_client did not make it too
confusing - do the same for simple_client. Also, rename it to
session_client (with a backwards-compat alias) and add it to the README
docs.

In the process of doing this, extract the "get me a cloud config"
functinality into an additional helper function - get_config.

Change-Id: Iadd24dfa021f870b3e5858bab8cd91fc96a373c2
2016-02-22 09:29:18 -08:00
Yuriy Taraday
9688f8ebd1 Fix README.rst, add a check for it to fit PyPI rules
README.rst doesn't appear right on PyPI currently. This commit fixes the
issue and expands "docs" environment in tox.ini to use readme tool [0]
to verify that README.rst is good for PyPI.

[0] https://github.com/pypa/readme

Change-Id: I6025bb6c661d8a4a7cd9802a1298928662278f2d
2015-12-31 15:40:58 +03:00
Doug Hellmann
f3678f03de add URLs for release announcement tools
The release announcement scripts expects to find URLs for the bug
tracker, documentation, etc. by looking for patterns in the README.rst
file. This change adds the URLs in a format consistent with other
OpenStack projects and that works with the release announcement
generator.

Change-Id: I88151008cca91da3fed7e4c0ec6dfb641a0062b6
2015-12-30 19:06:38 +00:00
Tim Burke
7be6db82d3 Fix some README typos
Change-Id: I3ebec661d1b02da0c940cde63ab862871dca11c5
2015-12-28 16:43:38 -08:00
Monty Taylor
d0c70cc962 Add support for generalized per-region settings
Internap creates a public and a private network for each customer for
each region on region activation. This means there is a per-region
external network that the user may want to specify. Also, conoha has
per-region auth-urls. Per-region config is still
overridden by argparse or kwargs values.

Change-Id: Ie2f3d2ca3ccbe7e3dd674983136b42c323544997
2015-12-07 15:35:04 -05:00
Jenkins
eab0f48340 Merge "Fix a README typo - hepler is not actually a thing" 2015-12-07 20:17:54 +00:00
Jenkins
4de73f0550 Merge "Make client constructor optional" 2015-12-07 20:09:35 +00:00
Monty Taylor
1221ea7fca Fix a README typo - hepler is not actually a thing
Change-Id: Ie8c267e75171b88bd3a1a3a684e85869e75843d7
2015-12-07 17:38:23 +00:00
Monty Taylor
8eced67abe Make client constructor optional
Turns out we know the mapping of service name to constsructor, so we can
try the import for the user without actually importing. Keep the
argument though, because this method should be usable by just about any
random openstack client lib. Also, because backwards compat.

Change-Id: I7e9672e3bf61b8b7b92d55903f4596382f18b515
2015-12-07 17:38:15 +00:00
Monty Taylor
b90f53bbf4 Updated README to clarify legacy client usage
Also, update it to use code-block - which makes things look much nicer.

Change-Id: I930ab63a5d159cf4cea27b4e2c4d6fd933de04fc
2015-12-06 21:49:29 -05:00
Monty Taylor
5beaeef2c3 Add simple helper function for client construction
Often times you don't want to take advantage of all the flexibility, you
simple want the basic works-like-it-should thing. Add a warpper around
get_legacy_client to do tht one thing.

Change-Id: I086dc4a8e762d4e8e56e01cabe2386577f2ceec8
2015-12-07 02:42:47 +00:00
Monty Taylor
ed2f34b06a Add method for registering argparse options
keystoneauth knows about a bunch of argparse options that users
from a command line will want. We do a good job of processing them
once they've been collected, but an os-client-config user doesn't
have a great way to make sure that they register all of the options,
especially when once considers that you really want to peek at the
args to see which auth plugin has been selected so that the right
arguments can be registered and displayed.

Depends-On: Ifea90b981044009c3642b268dd639a703df1ef05
Change-Id: Ic196f65f89b3ccf92ebec39564f5eaefe8a4ae4b
2015-12-06 21:39:49 -05:00
Monty Taylor
b17bbcdef9 Add support for secure.yaml file for auth info
Almost nothing in clouds.yaml is secret, but the file has to be treated
as if it were because of the passwords or other secrets contained in it.
This makes it difficult to put clouds.yaml into a public or broadly
accessible config repository. Add support for having a second optional
file, secure.yaml, which can contain any value you can put in
clouds.yaml and which will be overlayed on top of clouds.yaml values.

Most people probably do not need this, but for folks with complex cloud
configs with teams of people working on them, this reduces the amount of
things that have to be managed by the privileged system.

Change-Id: I631d826588b0a0b1f36244caa7982dd42d9eb498
2015-11-22 14:56:09 -05:00
Monty Taylor
790fac9854 Clean up cache interface, add support for services
We just added an unreleased interface method to the CloudConfig object -
but maybe that should have been more aligned with dogpile words.

SO - change the docs to reference the dogpile words and add support for
that, while keeping backwards compat support for people using max_age.
Also, do the -/_ transform on the cache config like elsewhere.

Then, while we're in there, add support for per-service cache timings.
We need this in nodepool and shade is adding support, so ability to
configure it will be important.

Change-Id: I31190a31ab0b79fc080db3611c0cd584076387d4
2015-10-17 11:47:20 -04:00
Monty Taylor
f6681a8319 Fix documentation around regions
It turns out region_name is an important parameter - it's not
just another kwarg that will get passed through.

Change-Id: I5cca8d324a1dcd1355991df793fe29eedfa15dc0
2015-10-14 12:32:20 -04:00
Monty Taylor
d3c82ab428 Fix two typos
Change-Id: Idf3df94ea039f07fa958a3afadf3388221ffa2ff
2015-10-01 14:52:18 -04:00
Monty Taylor
7d84f10231 Support passing force_ipv4 to the constructor
IPv6 support is detectable, so rather than having a user opt-in to it,
provide a flag that can be provided to tell it that detected IPv6
support is lying. This should have to be set for far fewer people and
should result in transparent opt-in to IPv6 where available.

Change-Id: Ib0c4c4e8b3b7b4bcee5fa3414719969274929b9a
2015-10-01 13:51:43 -04:00
Steve Martinelli
988e305b37 update RST for readme so pypi looks pretty
Navigating to https://pypi.python.org/pypi/os-client-config results
in seeing the raw RST content of the readme file. This is likely
caused by minor RST warnings, but pypi gives up and shows it raw.

Change-Id: Ia2d6202ade5282d9aeae9bb948175aae2aa264cd
2015-09-22 17:21:02 -04:00
Jenkins
27dff22c6b Merge "Specify the config file with environment variable" 2015-07-11 12:30:01 +00:00
Jenkins
33144d7c29 Merge "Add support for configuring region lists with yaml" 2015-07-11 12:19:51 +00:00
Monty Taylor
6523cf62fa Specify the config file with environment variable
The fine folks at ansible want to be able to specify a specific location
for the config file with an env var which seems like a perfectly
reasonable thing to allow. Inject the specified file at the beginning of
the list so that it'll be the first one found.

Change-Id: Ib1947be1c0ae812e9cb83c7b99168c05dfc6fa6a
Co-authored-by: Chris Church <chris@ninemoreminutes.com>
2015-07-09 09:11:36 -04:00
Monty Taylor
1065ea4dbf Add support for configuring region lists with yaml
yaml supports encoding lists in a manner that is cleaner than comma
separated lists. While the old commas-in-region_name will still work,
add a 'regions' option that can be used to configure lists of regions.
Remove the comma-separated-list from the docs so that people don't try
to use it - even though it will work.

Change-Id: Ieb0aedb9c03fd26e644e9ba733b935f2c69daaf0
2015-07-09 09:11:31 -04:00
Spencer Krum
9d3cc7969b Fix rendering issue in Readme
Change-Id: If089b0331c6b40e983d81623ee3a6a541f93a45a
2015-07-08 10:26:07 -07:00
Monty Taylor
65dd84515b Add support for indicating preference for IPv6
People, such as Infra, would like to use IPv6 when it's there, but don't
want to need to write the "if ipv6, awesome, else, ipv4" code all the
time.

Change-Id: I870955863f1e8851c684dc604584c1ef3e20dd6b
2015-06-26 17:10:41 -04:00
Ghe Rivero
d710accb3f Some cleanup in the README.rst
Change-Id: I9f7c6c727708a9095566bce8d4ff03837be95d07
2015-06-06 13:32:20 +02:00
Ghe Rivero
7e605f963f Add SSL documentation to README.rst
Explain usage and warn avoid behavior with conflicting
cacert and verify options.

Change-Id: I25b43ba47bd0feb941b649265c6e67723a93e277
2015-06-05 14:35:52 -04:00
Ghe Rivero
038ddd3818 Add cloud vendor files config in doc
Although it is possible to include specific config files for
unknown vendors, this wasn't specified in the documentation.

Change-Id: Ib27277d480e373a8a083e820161e0bdb985de284
2015-06-04 09:59:02 +02:00
Monty Taylor
b51f9f8416 Rename cloud to profile
The cloud parameter was confusing people, especially since it was
inside of a dict that was named "clouds". profile was suggested as less
confusing, which seems fine.

Continue processing cloud as a parameter so that we don't break
anyway, but change the docs to only mention profile.

Change-Id: Idf3d089703985ecc60f23a3c780ddcab914aa678
2015-05-27 09:42:51 -04:00
Monty Taylor
4b40133e21 Use appdirs for platform-independent locations
Cache, data and config files live rooted in different places across
different OS's. Use appdirs to find where.

Depends-On: Ic939dea11b7476ec504d2bf65854a0781b1bfb39
Change-Id: I7338ae1d0442e0c5cc1ec4ae4d619fac319a4a28
2015-05-12 10:09:24 -04:00
Monty Taylor
2f1e6c13be Only add fall through cloud as a fall through
We only want do define the 'openstack' cloud if there are neither
environment varaibles nor config files. We need to define it as a place
to put passed-in-parameters in the case of neither, but we don't want it
any other time.

The behavior can now be described as:
- If you have a config file, you will get the clouds listed in it
- If you have environment variable, you will get a cloud named 'envvars'
- If you have neither, you will get a cloud named 'defaults'

Change-Id: I6752c1ccecf1ef979b2603246eeaab7da360c8a4
2015-05-12 08:36:28 -04:00
Monty Taylor
912af15b52 Remove crufty lines from README
Change-Id: Ibf36a67503aab5f3bcd3ba535da5f9f54ce9c28d
2015-05-02 19:27:22 -04:00
Monty Taylor
ffafb52fa7 Allow overriding envvars as the name of the cloud
For environment variables created cloud objects, it's possible someone
may not want it to be called envvars. I mean, let's be honest, I cannot
imagine why this would be important ... but people get emotional about
things. Let them name their cloud "bunnyrabbit" because that makes
people happy.

Change-Id: I0c232de7d93080ea632fb66a82b9e6d3e925c901
2015-04-11 13:36:56 -04:00
Monty Taylor
7e682d3bf0 Put env vars into their own cloud config
The semantics around mixing environment variables and config file values
are confusing at best and no reasonable usecase has been expressed as to
why doing so is desirable.

Move the logic around environment variable processing to always provide
an "envvars" cloud if any envvars are set. The cloud will only exist in
the presence of OS_ env vars.

get_one_cloud() will default to returning the envvars cloud if it
exists.

Change-Id: I6c3a54997c3278feedfdf93cc4d1e74b6235700a
Closes-Bug: #1439927
2015-04-11 13:36:55 -04:00
Monty Taylor
63e1630f2b Change dogpile cache defaults
Memory cache can grow unbounded, so it should really be opt in. Change
to match shade with the following defaults:
 - If you specify nothing, you get null cache
 - If you specify an expiration time and nothing else, you get memory
   cache
 - If you specify an explicit cache class, you will get that class

Change-Id: I6c9eab71a88a534de7e52ad2a564450c44aacc1d
2015-03-13 12:19:53 -04:00
Jenkins
3b3eb4cc3a Merge "Support keystone auth plugins in a generic way." 2015-01-21 20:43:56 +00:00
Monty Taylor
c75daaa1f9 Support keystone auth plugins in a generic way.
Basically, if keystoneclient is available, validate arguments into
the auth dict. If it's not - we should probably be talking about what
possible use this library has - but it should degrade cleanly and treat
everything as passthrough.

Change-Id: Ia31039d5c724eba22d053a004eefeaf6857f500d
2015-01-21 12:30:44 -08:00
Jeremy Stanley
ca54d72900 Corrections to readme
* README.rst: Remove docs and bugs links since the project is not
currently publishing/consuming these anywhere that I can find. Also
correct the source URL.

Change-Id: I2b7002f7ea301a2c03a2e41e904de0c91a14831a
2014-11-24 17:12:08 +00:00
Monty Taylor
b1bb75a69b Add cache control settings
Things need to do local caching, which means they need to control
some settings about that. Add simple cache settings support.

Change-Id: I7b56cc25ebe7a803816d95b79d0329f8e42025ba
2014-10-10 15:25:53 -07:00
Monty Taylor
1277d4cfc5 Update the README file for more completeness 2014-09-21 14:33:07 -07:00
Monty Taylor
6efe00dbf3 Port in config reading from shade 2014-09-21 12:17:09 -07:00
Monty Taylor
edadf145f3 Initial Cookiecutter Commit. 2014-09-20 16:16:13 -07:00