summaryrefslogtreecommitdiff
path: root/keystoneclient/service_catalog.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove use of positional decoratorMorgan Fainberg2017-08-071-5/+0
| | | | | | | | | The positional decorator results in poorly maintainable code in a misguided effort to emulate python3's key-word-arg only notation and functionality. This patch removes keystoneclient's dependance on the positional decorator. Change-Id: I9e691cc8b0c04992f4a8dabd67e1b413d3220d23
* Increase readability of 'find()' method and small improvementsArthur Miranda2016-10-211-1/+1
| | | | | | | | Assigments replaced with argument assigment: endpoints.py, service_catalog.py Note added: 'original_ip' value is never used: session.py Refactor 'find()' method to increase readability: base.py Change-Id: I469331b123fdf03e9e7c5d93e1c95da57d30fbbe
* Removing bandit.yaml in favor of defaultsChristopher J Schaefer2016-04-191-30/+30
| | | | | | | | | | | Removing old configuration options for build-in defaults of latest bandit functionality. Also, marking flagged items with _# nosec_ with a descriptive comment on why the code is acceptable as is. Co-Authored-By: Christopher J Schaefer <cjschaef@us.ibm.com> Co-Authored-By: Tom Cocozzello <tjcocozz@us.ibm.com> Change-Id: I138ebd46a8be195177361a9c3306bb70423b639d
* use positional library instead of utilsSteve Martinelli2016-01-251-5/+5
| | | | | | swap instances of utils.positional with the positional library. Change-Id: Id8a9961e68d287a802f25512fc970829e9feb5c2
* Address hacking check H405lin-hua-cheng2016-01-131-6/+10
| | | | | | | | | Previously, there were a string of commits to keystone that addresed ignored hacking checks. This commit does the same for H405 in keystoneclient. This also modifies our tox.ini so that we no longer ignore H405 violations. Change-Id: I2af152e5425a0e9c82314039fdbb90d661c22680 Closes-Bug: 1482773
* Mark abstractmethod bodies with nocoverBrant Knudson2015-10-211-5/+5
| | | | | | | | | abstractmethod bodies aren't going to be called by unit tests, so there's no way to get coverage. The code in an abstractmethod body should be marked with "# pragma: no cover" so that they don't show up as missed in the coverage report. Change-Id: I88a7481ab22f2ce1abfd62badc5f5048acc6929f
* pass on @abc.abstractmethodsDolph Mathews2015-10-211-0/+2
| | | | | | | | | | | | | | Although a bare docstring is entirely valid grammar, those new to Python find that pattern baffling, *especially* when other similar methods contain pass statements. So, for consistency, add a pass statement to otherwise bare @abc.abstractmethods. Note that the implementation of an @abc.abstractmethod (in the abstract base class) can still be called by concrete children, so suddenly raising a NotImplementedError() instead might be "surprising" to implementors. A no-op such as "pass" or "return None" is preferable. Change-Id: I79969ad1a3429516ea785c649a165ead54944225
* Deprecate ServiceCatalog.get_urls() with no attrBrant Knudson2015-08-131-4/+7
| | | | | | | | | There was a TODO to deprecate calling ServiceCatalog.get_urls() with an attr but no filter_value. bp deprecations Change-Id: Idd97ce6920d63e1abb4f10ba4965035ba40f0155
* Deprecate ServiceCatalog(region_name)Brant Knudson2015-08-131-5/+41
| | | | | | | | | | | | | | | | | | There was a FIXME to deprecate ServiceCatalog's region_name parameter and property. This is now deprecated. Note that debtcollector isn't used here since the deprecation happens on ServiceCatalog's __init__() to catch use in subclasses of ServiceCatalog. ServiceCatalog also has a factory function that constructs the correct instance and the factory function always passes region_name, so it's always using the deprecated kwarg even when region_name isn't passed to the factory. It's not worth figuring out how to do this with debtcollector. bp deprecations Change-Id: I0e64712474ca2767f3c0ade919359132450f6776
* Allow handling multiple service_typesJamie Lennox2015-02-261-2/+2
| | | | | | | | | | | | | If the same service_type was mentioned in the catalog more than once then only the last entry would be parsed and any possible other matches would be lost. This was something that novaclient used to do, and as we are pushing sessions as the way that clients should all work we need to maintain that compatibility. Change-Id: I6964515ed1975bce1998897abfc02a1ec36e2584 Closes-Bug: #1425766
* Using correct keyword for region in v3Sergey Kraynev2015-02-121-1/+5
| | | | | | | | | Keystone v3 and v2 have different keywords in endpoint dictionary. This patch adds ability for keystone client for correct work with old and new API. Change-Id: I886b4c7ac3cbe08ac1b88f490e9ca92a90256961 Closes-Bug: #1364463
* I18nBrant Knudson2014-10-281-8/+27
| | | | | | | | | | | Keystoneclient didn't provide translated messages. With this change, the messages are marked for translation. DocImpact Implements: blueprint keystoneclient-i18n Change-Id: I85263a71671a1dffed524185266e6bb7ae559630
* Merge "fixed typos found by RETF rules"Jenkins2014-05-031-1/+1
|\
| * fixed typos found by RETF rulesChristian Berendt2014-05-031-1/+1
| | | | | | | | | | | | rules are avaialble at https://en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/Typos Change-Id: I67fb3e0d02c931cb7e605ac74ea8272956afa8e1
* | Fix docstrings in keystoneclientSteve Martinelli2014-05-021-1/+1
|/ | | | | | | | Trusts and service catalog had a few malformed docstrings that caused warnings when building docs. Change-Id: Iea8612c3aaebea54c00b02c73c77f0c9e79f86bc Partial-Bug: #1315523
* Add service name to catalogJamie Lennox2014-04-101-17/+49
| | | | | | | | The service catalog can contain names for the services. These names can be filtered on by other clients and are going to be required if we expect to use the keystoneclient service catalog in other clients. Change-Id: Iab69d67427ed40ce2f556f9a6348f4f1d9c26b5b
* Start using positional decoratorJamie Lennox2014-03-251-0/+5
| | | | | | | | | Apply the positional decorator to functions. It has been added as I think best practice would dictate, though in some places it has been added in a way that doesn't break existing tests. Closes-Bug: #1295881 Change-Id: I4f7ddbede4cba4ab79d144ad1f9dc83ea76f204a
* Fix doc build errorsBrant Knudson2014-03-131-2/+2
| | | | | | | | There were some parts that had invalid RST in their docstrings which caused warnings and errors to be generated. Related-Bug: #1278662 Change-Id: Ibb53e6f49b5fa100fa6ecfe47331f9a70729d03b
* Fix typos in documents and commentsEric Guo2014-01-231-1/+1
| | | | | | | | | Fix typos detected by toolkit misspellings. * pip install misspellings * git ls-files | grep -v locale | misspellings -f - Change-Id: Ifbbc29537d9d129aad238de6c37718c4fbb8349b
* Properly handle Regions in keystoneclientJamie Lennox2013-12-041-18/+39
| | | | | | | | | | | | | Region name is taken as a parameter but is ignored in all communication with the service catalog. Currently region can be stored in the token data and then requests to url functions will return the appropriate region. This is the wrong approach because there is nothing specific to the token (or auth_data) that is region specific. Instead region information should be held by the client. Closes-Bug: 1147530 Closes-Bug: 1255992 Change-Id: I812aa89c8b4af28e294e63926a7f88e8246fffc5
* Reorganize Service CatalogJamie Lennox2013-11-271-116/+133
| | | | | | | | | | | | Currently each service catalog call handles it's own parsing and filtering. Modify this so that each function calls back to another public function ensuring that filtering and parsing is only handled once. This allows us to consolidate some helper methods into the base class and generally clean up. Change-Id: I15777436af06baea903182f4b3b5913e2890afd1
* Merge "python3: Refactor dict for python2/python3 compat"Jenkins2013-10-161-1/+1
|\
| * python3: Refactor dict for python2/python3 compatChuck Short2013-10-111-1/+1
| | | | | | | | | | | | | | | | | | Python3 changed the behavior of dict.keys such that it is now returns a dict_keys object, which is iterable but not indexable. You can get the python2 result back with an explicit call to list. Change-Id: Ic504d3929398aa82ac87d1735cf4cedea2dfc5d1 Signed-off-by: Chuck Short <chuck.short@canonical.com>
* | Replace OpenStack LLC with OpenStack Foundation0.4.1ZhiQiang Fan2013-10-171-1/+1
|/ | | | | | | | | | Some files still use trademark OpenStack LLC in header, which should be changed to OpenStack Foundation. NOTE: tools/install_venv.py is not touched, should sync with oslo Change-Id: I01d4f6b64cf1a152c4e190407799ce7d53de845f Fixes-Bug: #1214176
* Add a get_data function to Service CatalogJamie Lennox2013-08-121-4/+20
| | | | | | | | Service catalog takes as a parameter the entire token. This makes it difficult to extract only the service catalog component without querying the catalog version, which should be unnecessary. Change-Id: I3ad428fcb3279e8aa607f67f58265a085ae63440
* Fix and enable gating on H403Dirk Mueller2013-07-131-2/+4
| | | | | | | Only a few occurrences of "multiline docstrings should end on a new line." Change-Id: I3fb4591259b1e7c8202365cbadc8967a1639254f
* Implements v3 auth client.lin-hua-cheng2013-06-201-19/+192
| | | | | | | | | | | Added support for domain scoping. Enhancement on AccessInfo to support reading v2/v3 token information. Enhancement on ServiceCatalog for reading/filtering v2/v3 service catalog information. Change-Id: Ibb678b9933d3673e37d0fba857a152a3c5d2b4f4
* Fix line continuations (flake8 E125, E126)Dolph Mathews2013-06-031-2/+2
| | | | | | | | - E125: continuation line does not distinguish itself from next logical line - E126: continuation line over-indented for hanging indent Change-Id: I626a6d5d57db927e8b239f90569b5601c772f28b
* Improve error message for missing endpointDoug Hellmann2013-02-221-1/+2
| | | | | | | | | | | Horizon logs an error when it wants an endpoint that the client can't find, but the error does not say which endpoint is missing. This change includes more details in the error message to make debugging from the horizon logs easier. Change-Id: I6f0aacd469500238f13a2178a220268d86d31fe5 Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
* Take region_name into account when calling url_forSam Morrison2013-01-241-1/+5
| | | | | | | | | Fixes bug 1103282 When creating a Client object with region_name specified, url_for will return an endpoint url for that region. Change-Id: Ia5c95503fe2ed5e53de93040d70ba08a9c09f286
* Correct a misspelled in commentsWu Wenxiang2012-11-261-1/+1
| | | | | | 'fron' in keystoneclient/service_catalog.py should be 'from' Change-Id: I75b01aca6eb905efa9d74f7deb4146c43525d4cc
* HACKING compliance: consistent usage of 'except'Dolph Mathews2012-11-051-1/+1
| | | | Change-Id: I13988e94d7e20a9179874ec5be072bdb8db3a95e
* Don't log an exception for an expected empty catalog.Gabriel Hurley2012-10-231-0/+3
| | | | | | | | | | | | Cleans up the code around exception handling and logging when first authenticating (which often returns an unscoped token). There's no need to be logging an exception on an expected empty catalog and moreover the except block was a bare "except" which could mask other errors. Fixes bug 1070493 Change-Id: I5e791e95ce3f9ab77723a7f4698cb11b169dacfb
* Useful error msg when missing catalog (bug 949904)Dolph Mathews2012-10-111-2/+13
| | | | Change-Id: I498e9b79e9739437b7e61997b37e84283b496561
* Support 2-way SSL with Keystone server if it is configured to enforceLiem Nguyen2012-07-031-1/+1
| | | | | | | 2-way SSL. See also https://review.openstack.org/#/c/7706/ for the corresponding review for the 2-way SSL addition to Keystone. Change-Id: If0cb46a43d663687396d93604a7139d85a4e7114
* pep8 1.1 changes and updatesJoe Heck2012-06-011-1/+1
| | | | Change-Id: I8bc3582bb3f35a3d841bb1e8c03b62ba61ff92d7
* Make ec2-credentials-* commands work properly for non-admin userDean Troyer2012-03-061-2/+3
| | | | | | | | | | * Add user id to token-get output * Save authenticated user and tenant IDs in client in Client._extract_service_catalog() * Handle default user and tenant IDs in ec2-credentials-* commands Fixed bug 947011 Change-Id: I97750f666ba03f32f0bb1be0c2df5ad8a321b433
* Display token and service catalog for userBrian Waldon2012-02-161-2/+27
| | | | | | | * Adds commands 'token', 'catalog' and 'endpoint-get' to keystone CLI * Fixes bug 930421 Change-Id: I9eceea3bf98a5c87b122fa663c96f7119ef8d3cc
* Initial commit.Gabriel Hurley2011-10-251-0/+53