summaryrefslogtreecommitdiff
path: root/openstackclient/api/api.py
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2023-05-08 11:36:34 +0100
committerStephen Finucane <sfinucan@redhat.com>2023-05-10 10:51:30 +0100
commita6f81a736c503e45e1fca9fe49f9f46b9ced7cb8 (patch)
tree730284d0b6a1c71b962ac2b63e5cccfe7ed3c15c /openstackclient/api/api.py
parent7d80f9e9626d14ce2ab60e4b69e3ccd070f31e0d (diff)
downloadpython-openstackclient-a6f81a736c503e45e1fca9fe49f9f46b9ced7cb8.tar.gz
Blacken openstackclient.api
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: I1df5bc4c35f02147fe5ac5b4073f0e01e7d51c2f Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to 'openstackclient/api/api.py')
-rw-r--r--openstackclient/api/api.py57
1 files changed, 9 insertions, 48 deletions
diff --git a/openstackclient/api/api.py b/openstackclient/api/api.py
index d4772f94..f02c87dc 100644
--- a/openstackclient/api/api.py
+++ b/openstackclient/api/api.py
@@ -30,12 +30,7 @@ class KeystoneSession(object):
"""
- def __init__(
- self,
- session=None,
- endpoint=None,
- **kwargs
- ):
+ def __init__(self, session=None, endpoint=None, **kwargs):
"""Base object that contains some common API objects and methods
:param Session session:
@@ -87,11 +82,7 @@ class BaseAPI(KeystoneSession):
"""Base API"""
def __init__(
- self,
- session=None,
- service_type=None,
- endpoint=None,
- **kwargs
+ self, session=None, service_type=None, endpoint=None, **kwargs
):
"""Base object that contains some common API objects and methods
@@ -110,13 +101,7 @@ class BaseAPI(KeystoneSession):
# The basic action methods all take a Session and return dict/lists
- def create(
- self,
- url,
- session=None,
- method=None,
- **params
- ):
+ def create(self, url, session=None, method=None, **params):
"""Create a new resource
:param string url:
@@ -136,12 +121,7 @@ class BaseAPI(KeystoneSession):
except json.JSONDecodeError:
return ret
- def delete(
- self,
- url,
- session=None,
- **params
- ):
+ def delete(self, url, session=None, **params):
"""Delete a resource
:param string url:
@@ -152,14 +132,7 @@ class BaseAPI(KeystoneSession):
return self._request('DELETE', url, **params)
- def list(
- self,
- path,
- session=None,
- body=None,
- detailed=False,
- **params
- ):
+ def list(self, path, session=None, body=None, detailed=False, **params):
"""Return a list of resources
GET ${ENDPOINT}/${PATH}?${PARAMS}
@@ -255,9 +228,7 @@ class BaseAPI(KeystoneSession):
if len(data) > 1:
msg = _("Multiple %(resource)s exist with %(attr)s='%(value)s'")
raise exceptions.CommandError(
- msg % {'resource': resource,
- 'attr': attr,
- 'value': value}
+ msg % {'resource': resource, 'attr': attr, 'value': value}
)
# Search by id
@@ -267,16 +238,10 @@ class BaseAPI(KeystoneSession):
return data[0]
msg = _("No %(resource)s with a %(attr)s or ID of '%(value)s' found")
raise exceptions.CommandError(
- msg % {'resource': resource,
- 'attr': attr,
- 'value': value}
+ msg % {'resource': resource, 'attr': attr, 'value': value}
)
- def find_bulk(
- self,
- path,
- **kwargs
- ):
+ def find_bulk(self, path, **kwargs):
"""Bulk load and filter locally
:param string path:
@@ -302,11 +267,7 @@ class BaseAPI(KeystoneSession):
return ret
- def find_one(
- self,
- path,
- **kwargs
- ):
+ def find_one(self, path, **kwargs):
"""Find a resource by name or ID
:param string path: