use positional library instead of utils
swap instances of utils.positional with the positional library. Change-Id: Id8a9961e68d287a802f25512fc970829e9feb5c2
This commit is contained in:
@@ -24,15 +24,16 @@ raw data specified in version discovery responses.
|
|||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
from positional import positional
|
||||||
|
|
||||||
from keystoneclient import exceptions
|
from keystoneclient import exceptions
|
||||||
from keystoneclient.i18n import _, _LI, _LW
|
from keystoneclient.i18n import _, _LI, _LW
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@utils.positional()
|
@positional()
|
||||||
def get_version_data(session, url, authenticated=None):
|
def get_version_data(session, url, authenticated=None):
|
||||||
"""Retrieve raw version data from a url."""
|
"""Retrieve raw version data from a url."""
|
||||||
headers = {'Accept': 'application/json'}
|
headers = {'Accept': 'application/json'}
|
||||||
@@ -135,7 +136,7 @@ class Discover(object):
|
|||||||
DEPRECATED_STATUSES = ('deprecated',)
|
DEPRECATED_STATUSES = ('deprecated',)
|
||||||
EXPERIMENTAL_STATUSES = ('experimental',)
|
EXPERIMENTAL_STATUSES = ('experimental',)
|
||||||
|
|
||||||
@utils.positional()
|
@positional()
|
||||||
def __init__(self, session, url, authenticated=None):
|
def __init__(self, session, url, authenticated=None):
|
||||||
self._data = get_version_data(session, url,
|
self._data = get_version_data(session, url,
|
||||||
authenticated=authenticated)
|
authenticated=authenticated)
|
||||||
|
@@ -11,8 +11,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
|
from positional import positional
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
|
|
||||||
class Adapter(object):
|
class Adapter(object):
|
||||||
@@ -45,7 +44,7 @@ class Adapter(object):
|
|||||||
:type logger: logging.Logger
|
:type logger: logging.Logger
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@utils.positional()
|
@positional()
|
||||||
def __init__(self, session, service_type=None, service_name=None,
|
def __init__(self, session, service_type=None, service_name=None,
|
||||||
interface=None, region_name=None, endpoint_override=None,
|
interface=None, region_name=None, endpoint_override=None,
|
||||||
version=None, auth=None, user_agent=None,
|
version=None, auth=None, user_agent=None,
|
||||||
|
@@ -13,11 +13,12 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from positional import positional
|
||||||
|
|
||||||
from keystoneclient.auth import base
|
from keystoneclient.auth import base
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
|
|
||||||
@utils.positional()
|
@positional()
|
||||||
def register_argparse_arguments(parser, argv, default=None):
|
def register_argparse_arguments(parser, argv, default=None):
|
||||||
"""Register CLI options needed to create a plugin.
|
"""Register CLI options needed to create a plugin.
|
||||||
|
|
||||||
|
@@ -10,8 +10,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from positional import positional
|
||||||
|
|
||||||
from keystoneclient.auth.identity import base
|
from keystoneclient.auth.identity import base
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
|
|
||||||
class AccessInfoPlugin(base.BaseIdentityPlugin):
|
class AccessInfoPlugin(base.BaseIdentityPlugin):
|
||||||
@@ -31,7 +32,7 @@ class AccessInfoPlugin(base.BaseIdentityPlugin):
|
|||||||
if using the AUTH_INTERFACE with get_endpoint. (optional)
|
if using the AUTH_INTERFACE with get_endpoint. (optional)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@utils.positional()
|
@positional()
|
||||||
def __init__(self, auth_ref, auth_url=None):
|
def __init__(self, auth_ref, auth_url=None):
|
||||||
super(AccessInfoPlugin, self).__init__(auth_url=auth_url,
|
super(AccessInfoPlugin, self).__init__(auth_url=auth_url,
|
||||||
reauthenticate=False)
|
reauthenticate=False)
|
||||||
|
@@ -16,13 +16,13 @@ import threading
|
|||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
from positional import positional
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from keystoneclient import _discover
|
from keystoneclient import _discover
|
||||||
from keystoneclient.auth import base
|
from keystoneclient.auth import base
|
||||||
from keystoneclient import exceptions
|
from keystoneclient import exceptions
|
||||||
from keystoneclient.i18n import _LW
|
from keystoneclient.i18n import _LW
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -371,7 +371,7 @@ class BaseIdentityPlugin(base.BaseAuthPlugin):
|
|||||||
def get_project_id(self, session, **kwargs):
|
def get_project_id(self, session, **kwargs):
|
||||||
return self.get_access(session).project_id
|
return self.get_access(session).project_id
|
||||||
|
|
||||||
@utils.positional()
|
@positional()
|
||||||
def get_discovery(self, session, url, authenticated=None):
|
def get_discovery(self, session, url, authenticated=None):
|
||||||
"""Return the discovery object for a URL.
|
"""Return the discovery object for a URL.
|
||||||
|
|
||||||
|
@@ -11,11 +11,11 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
from positional import positional
|
||||||
|
|
||||||
from keystoneclient.auth.identity.generic import password
|
from keystoneclient.auth.identity.generic import password
|
||||||
from keystoneclient import exceptions as exc
|
from keystoneclient import exceptions as exc
|
||||||
from keystoneclient.i18n import _
|
from keystoneclient.i18n import _
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
|
|
||||||
class DefaultCLI(password.Password):
|
class DefaultCLI(password.Password):
|
||||||
@@ -25,7 +25,7 @@ class DefaultCLI(password.Password):
|
|||||||
as well as allowing users to override with a custom token and endpoint.
|
as well as allowing users to override with a custom token and endpoint.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@utils.positional()
|
@positional()
|
||||||
def __init__(self, endpoint=None, token=None, **kwargs):
|
def __init__(self, endpoint=None, token=None, **kwargs):
|
||||||
super(DefaultCLI, self).__init__(**kwargs)
|
super(DefaultCLI, self).__init__(**kwargs)
|
||||||
|
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
from positional import positional
|
||||||
|
|
||||||
from keystoneclient import _discover
|
from keystoneclient import _discover
|
||||||
from keystoneclient.auth.identity.generic import base
|
from keystoneclient.auth.identity.generic import base
|
||||||
@@ -45,7 +46,7 @@ class Password(base.BaseGenericPlugin):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@utils.positional()
|
@positional()
|
||||||
def __init__(self, auth_url, username=None, user_id=None, password=None,
|
def __init__(self, auth_url, username=None, user_id=None, password=None,
|
||||||
user_domain_id=None, user_domain_name=None, **kwargs):
|
user_domain_id=None, user_domain_name=None, **kwargs):
|
||||||
super(Password, self).__init__(auth_url=auth_url, **kwargs)
|
super(Password, self).__init__(auth_url=auth_url, **kwargs)
|
||||||
|
@@ -14,6 +14,7 @@ import abc
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
from positional import positional
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from keystoneclient import access
|
from keystoneclient import access
|
||||||
@@ -48,7 +49,7 @@ class Auth(base.BaseIdentityPlugin):
|
|||||||
|
|
||||||
return options
|
return options
|
||||||
|
|
||||||
@utils.positional()
|
@positional()
|
||||||
def __init__(self, auth_url,
|
def __init__(self, auth_url,
|
||||||
trust_id=None,
|
trust_id=None,
|
||||||
tenant_id=None,
|
tenant_id=None,
|
||||||
@@ -127,7 +128,7 @@ class Password(Auth):
|
|||||||
:raises TypeError: if a user_id or username is not provided.
|
:raises TypeError: if a user_id or username is not provided.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@utils.positional(4)
|
@positional(4)
|
||||||
def __init__(self, auth_url, username=_NOT_PASSED, password=None,
|
def __init__(self, auth_url, username=_NOT_PASSED, password=None,
|
||||||
user_id=_NOT_PASSED, **kwargs):
|
user_id=_NOT_PASSED, **kwargs):
|
||||||
super(Password, self).__init__(auth_url, **kwargs)
|
super(Password, self).__init__(auth_url, **kwargs)
|
||||||
|
@@ -14,13 +14,13 @@ import abc
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
from positional import positional
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from keystoneclient import access
|
from keystoneclient import access
|
||||||
from keystoneclient.auth.identity import base
|
from keystoneclient.auth.identity import base
|
||||||
from keystoneclient import exceptions
|
from keystoneclient import exceptions
|
||||||
from keystoneclient.i18n import _
|
from keystoneclient.i18n import _
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ class BaseAuth(base.BaseIdentityPlugin):
|
|||||||
token. (optional) default True.
|
token. (optional) default True.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@utils.positional()
|
@positional()
|
||||||
def __init__(self, auth_url,
|
def __init__(self, auth_url,
|
||||||
trust_id=None,
|
trust_id=None,
|
||||||
domain_id=None,
|
domain_id=None,
|
||||||
|
@@ -11,10 +11,10 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
from positional import positional
|
||||||
|
|
||||||
from keystoneclient import access
|
from keystoneclient import access
|
||||||
from keystoneclient.auth.identity.v3 import federated
|
from keystoneclient.auth.identity.v3 import federated
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
|
|
||||||
class OidcPassword(federated.FederatedBaseAuth):
|
class OidcPassword(federated.FederatedBaseAuth):
|
||||||
@@ -42,7 +42,7 @@ class OidcPassword(federated.FederatedBaseAuth):
|
|||||||
])
|
])
|
||||||
return options
|
return options
|
||||||
|
|
||||||
@utils.positional(4)
|
@positional(4)
|
||||||
def __init__(self, auth_url, identity_provider, protocol,
|
def __init__(self, auth_url, identity_provider, protocol,
|
||||||
username, password, client_id, client_secret,
|
username, password, client_id, client_secret,
|
||||||
access_token_endpoint, scope='profile',
|
access_token_endpoint, scope='profile',
|
||||||
|
@@ -14,6 +14,7 @@ import logging
|
|||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
from debtcollector import removals
|
from debtcollector import removals
|
||||||
|
from positional import positional
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from keystoneclient import _discover
|
from keystoneclient import _discover
|
||||||
@@ -21,7 +22,6 @@ from keystoneclient.auth import base
|
|||||||
from keystoneclient import exceptions
|
from keystoneclient import exceptions
|
||||||
from keystoneclient.i18n import _
|
from keystoneclient.i18n import _
|
||||||
from keystoneclient import session as client_session
|
from keystoneclient import session as client_session
|
||||||
from keystoneclient import utils
|
|
||||||
from keystoneclient.v2_0 import client as v2_client
|
from keystoneclient.v2_0 import client as v2_client
|
||||||
from keystoneclient.v3 import client as v3_client
|
from keystoneclient.v3 import client as v3_client
|
||||||
|
|
||||||
@@ -151,7 +151,7 @@ class Discover(_discover.Discover):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@utils.positional(2)
|
@positional(2)
|
||||||
def __init__(self, session=None, authenticated=None, **kwargs):
|
def __init__(self, session=None, authenticated=None, **kwargs):
|
||||||
if not session:
|
if not session:
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
|
from positional import positional
|
||||||
|
|
||||||
from keystoneclient import utils
|
from keystoneclient import utils
|
||||||
|
|
||||||
@@ -34,7 +35,7 @@ class DiscoveryBase(dict):
|
|||||||
:param DateTime updated: When the API was last updated.
|
:param DateTime updated: When the API was last updated.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@utils.positional()
|
@positional()
|
||||||
def __init__(self, id, status=None, updated=None):
|
def __init__(self, id, status=None, updated=None):
|
||||||
super(DiscoveryBase, self).__init__()
|
super(DiscoveryBase, self).__init__()
|
||||||
|
|
||||||
@@ -79,7 +80,7 @@ class DiscoveryBase(dict):
|
|||||||
def updated(self, value):
|
def updated(self, value):
|
||||||
self.updated_str = utils.isotime(value)
|
self.updated_str = utils.isotime(value)
|
||||||
|
|
||||||
@utils.positional()
|
@positional()
|
||||||
def add_link(self, href, rel='self', type=None):
|
def add_link(self, href, rel='self', type=None):
|
||||||
link = {'href': href, 'rel': rel}
|
link = {'href': href, 'rel': rel}
|
||||||
if type:
|
if type:
|
||||||
@@ -91,7 +92,7 @@ class DiscoveryBase(dict):
|
|||||||
def media_types(self):
|
def media_types(self):
|
||||||
return self.setdefault('media-types', [])
|
return self.setdefault('media-types', [])
|
||||||
|
|
||||||
@utils.positional(1)
|
@positional(1)
|
||||||
def add_media_type(self, base, type):
|
def add_media_type(self, base, type):
|
||||||
mt = {'base': base, 'type': type}
|
mt = {'base': base, 'type': type}
|
||||||
self.media_types.append(mt)
|
self.media_types.append(mt)
|
||||||
@@ -115,7 +116,7 @@ class V2Discovery(DiscoveryBase):
|
|||||||
|
|
||||||
_DESC_URL = 'http://docs.openstack.org/api/openstack-identity-service/2.0/'
|
_DESC_URL = 'http://docs.openstack.org/api/openstack-identity-service/2.0/'
|
||||||
|
|
||||||
@utils.positional()
|
@positional()
|
||||||
def __init__(self, href, id=None, html=True, pdf=True, **kwargs):
|
def __init__(self, href, id=None, html=True, pdf=True, **kwargs):
|
||||||
super(V2Discovery, self).__init__(id or 'v2.0', **kwargs)
|
super(V2Discovery, self).__init__(id or 'v2.0', **kwargs)
|
||||||
|
|
||||||
@@ -161,7 +162,7 @@ class V3Discovery(DiscoveryBase):
|
|||||||
:param bool xml: Add XML media-type elements to the structure.
|
:param bool xml: Add XML media-type elements to the structure.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@utils.positional()
|
@positional()
|
||||||
def __init__(self, href, id=None, json=True, xml=True, **kwargs):
|
def __init__(self, href, id=None, json=True, xml=True, **kwargs):
|
||||||
super(V3Discovery, self).__init__(id or 'v3.0', **kwargs)
|
super(V3Discovery, self).__init__(id or 'v3.0', **kwargs)
|
||||||
|
|
||||||
@@ -212,7 +213,7 @@ class DiscoveryList(dict):
|
|||||||
|
|
||||||
TEST_URL = 'http://keystone.host:5000/'
|
TEST_URL = 'http://keystone.host:5000/'
|
||||||
|
|
||||||
@utils.positional(2)
|
@positional(2)
|
||||||
def __init__(self, href=None, v2=True, v3=True, v2_id=None, v3_id=None,
|
def __init__(self, href=None, v2=True, v3=True, v2_id=None, v3_id=None,
|
||||||
v2_status=None, v2_updated=None, v2_html=True, v2_pdf=True,
|
v2_status=None, v2_updated=None, v2_html=True, v2_pdf=True,
|
||||||
v3_status=None, v3_updated=None, v3_json=True, v3_xml=True):
|
v3_status=None, v3_updated=None, v3_json=True, v3_xml=True):
|
||||||
|
@@ -26,6 +26,7 @@ from debtcollector import removals
|
|||||||
from debtcollector import renames
|
from debtcollector import renames
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
|
from positional import positional
|
||||||
import requests
|
import requests
|
||||||
from six.moves.urllib import parse as urlparse
|
from six.moves.urllib import parse as urlparse
|
||||||
|
|
||||||
@@ -62,7 +63,6 @@ from keystoneclient import baseclient
|
|||||||
from keystoneclient import exceptions
|
from keystoneclient import exceptions
|
||||||
from keystoneclient.i18n import _, _LW
|
from keystoneclient.i18n import _, _LW
|
||||||
from keystoneclient import session as client_session
|
from keystoneclient import session as client_session
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
@@ -249,7 +249,7 @@ class HTTPClient(baseclient.Client, base.BaseAuthPlugin):
|
|||||||
removal_version='2.0.0')
|
removal_version='2.0.0')
|
||||||
@renames.renamed_kwarg('tenant_id', 'project_id', version='1.7.0',
|
@renames.renamed_kwarg('tenant_id', 'project_id', version='1.7.0',
|
||||||
removal_version='2.0.0')
|
removal_version='2.0.0')
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def __init__(self, username=None, tenant_id=None, tenant_name=None,
|
def __init__(self, username=None, tenant_id=None, tenant_name=None,
|
||||||
password=None, auth_url=None, region_name=None, endpoint=None,
|
password=None, auth_url=None, region_name=None, endpoint=None,
|
||||||
token=None, debug=False, auth_ref=None, use_keyring=False,
|
token=None, debug=False, auth_ref=None, use_keyring=False,
|
||||||
@@ -491,7 +491,7 @@ class HTTPClient(baseclient.Client, base.BaseAuthPlugin):
|
|||||||
|
|
||||||
return self.project_name
|
return self.project_name
|
||||||
|
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def authenticate(self, username=None, password=None, tenant_name=None,
|
def authenticate(self, username=None, password=None, tenant_name=None,
|
||||||
tenant_id=None, auth_url=None, token=None,
|
tenant_id=None, auth_url=None, token=None,
|
||||||
user_id=None, domain_name=None, domain_id=None,
|
user_id=None, domain_name=None, domain_id=None,
|
||||||
@@ -703,7 +703,7 @@ class HTTPClient(baseclient.Client, base.BaseAuthPlugin):
|
|||||||
# permanently setting _endpoint would better match that behaviour.
|
# permanently setting _endpoint would better match that behaviour.
|
||||||
self._endpoint = value
|
self._endpoint = value
|
||||||
|
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def get_raw_token_from_identity_service(self, auth_url, username=None,
|
def get_raw_token_from_identity_service(self, auth_url, username=None,
|
||||||
password=None, tenant_name=None,
|
password=None, tenant_name=None,
|
||||||
tenant_id=None, token=None,
|
tenant_id=None, token=None,
|
||||||
|
@@ -19,11 +19,11 @@
|
|||||||
import abc
|
import abc
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
|
from positional import positional
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from keystoneclient import exceptions
|
from keystoneclient import exceptions
|
||||||
from keystoneclient.i18n import _
|
from keystoneclient.i18n import _
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
@six.add_metaclass(abc.ABCMeta)
|
||||||
@@ -209,7 +209,7 @@ class ServiceCatalog(object):
|
|||||||
return endpoints
|
return endpoints
|
||||||
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def get_urls(self, attr=None, filter_value=None,
|
def get_urls(self, attr=None, filter_value=None,
|
||||||
service_type='identity', endpoint_type='publicURL',
|
service_type='identity', endpoint_type='publicURL',
|
||||||
region_name=None, service_name=None):
|
region_name=None, service_name=None):
|
||||||
@@ -233,7 +233,7 @@ class ServiceCatalog(object):
|
|||||||
"""
|
"""
|
||||||
raise NotImplementedError() # pragma: no cover
|
raise NotImplementedError() # pragma: no cover
|
||||||
|
|
||||||
@utils.positional(3, enforcement=utils.positional.WARN)
|
@positional(3, enforcement=positional.WARN)
|
||||||
def url_for(self, attr=None, filter_value=None,
|
def url_for(self, attr=None, filter_value=None,
|
||||||
service_type='identity', endpoint_type='publicURL',
|
service_type='identity', endpoint_type='publicURL',
|
||||||
region_name=None, service_name=None):
|
region_name=None, service_name=None):
|
||||||
@@ -348,7 +348,7 @@ class ServiceCatalogV2(ServiceCatalog):
|
|||||||
pass
|
pass
|
||||||
return token
|
return token
|
||||||
|
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def get_urls(self, attr=None, filter_value=None,
|
def get_urls(self, attr=None, filter_value=None,
|
||||||
service_type='identity', endpoint_type='publicURL',
|
service_type='identity', endpoint_type='publicURL',
|
||||||
region_name=None, service_name=None):
|
region_name=None, service_name=None):
|
||||||
@@ -415,7 +415,7 @@ class ServiceCatalogV3(ServiceCatalog):
|
|||||||
pass
|
pass
|
||||||
return token
|
return token
|
||||||
|
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def get_urls(self, attr=None, filter_value=None,
|
def get_urls(self, attr=None, filter_value=None,
|
||||||
service_type='identity', endpoint_type='public',
|
service_type='identity', endpoint_type='public',
|
||||||
region_name=None, service_name=None):
|
region_name=None, service_name=None):
|
||||||
|
@@ -24,13 +24,13 @@ from oslo_config import cfg
|
|||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
from oslo_utils import importutils
|
from oslo_utils import importutils
|
||||||
from oslo_utils import strutils
|
from oslo_utils import strutils
|
||||||
|
from positional import positional
|
||||||
import requests
|
import requests
|
||||||
import six
|
import six
|
||||||
from six.moves import urllib
|
from six.moves import urllib
|
||||||
|
|
||||||
from keystoneclient import exceptions
|
from keystoneclient import exceptions
|
||||||
from keystoneclient.i18n import _, _LI, _LW
|
from keystoneclient.i18n import _, _LI, _LW
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
osprofiler_web = importutils.try_import("osprofiler.web")
|
osprofiler_web = importutils.try_import("osprofiler.web")
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ class Session(object):
|
|||||||
"""This property is deprecated as of the 1.7.0 release and may be removed
|
"""This property is deprecated as of the 1.7.0 release and may be removed
|
||||||
in the 2.0.0 release."""
|
in the 2.0.0 release."""
|
||||||
|
|
||||||
@utils.positional(2, enforcement=utils.positional.WARN)
|
@positional(2, enforcement=positional.WARN)
|
||||||
def __init__(self, auth=None, session=None, original_ip=None, verify=True,
|
def __init__(self, auth=None, session=None, original_ip=None, verify=True,
|
||||||
cert=None, timeout=None, user_agent=None,
|
cert=None, timeout=None, user_agent=None,
|
||||||
redirect=_DEFAULT_REDIRECT_LIMIT):
|
redirect=_DEFAULT_REDIRECT_LIMIT):
|
||||||
@@ -165,7 +165,7 @@ class Session(object):
|
|||||||
return (header[0], '{SHA1}%s' % token_hash)
|
return (header[0], '{SHA1}%s' % token_hash)
|
||||||
return header
|
return header
|
||||||
|
|
||||||
@utils.positional()
|
@positional()
|
||||||
def _http_log_request(self, url, method=None, data=None,
|
def _http_log_request(self, url, method=None, data=None,
|
||||||
headers=None, logger=_logger):
|
headers=None, logger=_logger):
|
||||||
if not logger.isEnabledFor(logging.DEBUG):
|
if not logger.isEnabledFor(logging.DEBUG):
|
||||||
@@ -215,7 +215,7 @@ class Session(object):
|
|||||||
|
|
||||||
logger.debug(' '.join(string_parts))
|
logger.debug(' '.join(string_parts))
|
||||||
|
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def request(self, url, method, json=None, original_ip=None,
|
def request(self, url, method, json=None, original_ip=None,
|
||||||
user_agent=None, redirect=None, authenticated=None,
|
user_agent=None, redirect=None, authenticated=None,
|
||||||
endpoint_filter=None, auth=None, requests_auth=None,
|
endpoint_filter=None, auth=None, requests_auth=None,
|
||||||
@@ -766,7 +766,7 @@ class Session(object):
|
|||||||
auth = self._auth_required(auth, msg)
|
auth = self._auth_required(auth, msg)
|
||||||
return auth.get_project_id(self)
|
return auth.get_project_id(self)
|
||||||
|
|
||||||
@utils.positional.classmethod()
|
@positional.classmethod()
|
||||||
def get_conf_options(cls, deprecated_opts=None):
|
def get_conf_options(cls, deprecated_opts=None):
|
||||||
"""Get oslo_config options that are needed for a :py:class:`.Session`.
|
"""Get oslo_config options that are needed for a :py:class:`.Session`.
|
||||||
|
|
||||||
@@ -815,7 +815,7 @@ class Session(object):
|
|||||||
help='Timeout value for http requests'),
|
help='Timeout value for http requests'),
|
||||||
]
|
]
|
||||||
|
|
||||||
@utils.positional.classmethod()
|
@positional.classmethod()
|
||||||
def register_conf_options(cls, conf, group, deprecated_opts=None):
|
def register_conf_options(cls, conf, group, deprecated_opts=None):
|
||||||
"""Register the oslo_config options that are needed for a session.
|
"""Register the oslo_config options that are needed for a session.
|
||||||
|
|
||||||
|
@@ -17,6 +17,8 @@ import sys
|
|||||||
|
|
||||||
from oslo_utils import encodeutils
|
from oslo_utils import encodeutils
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
|
# NOTE(stevemar): do not remove positional. We need this to stay for a while
|
||||||
|
# since versions of auth_token require it here.
|
||||||
from positional import positional # noqa
|
from positional import positional # noqa
|
||||||
import prettytable
|
import prettytable
|
||||||
import six
|
import six
|
||||||
|
@@ -10,12 +10,13 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from positional import positional
|
||||||
|
|
||||||
from keystoneclient import access
|
from keystoneclient import access
|
||||||
from keystoneclient import auth
|
from keystoneclient import auth
|
||||||
from keystoneclient import base
|
from keystoneclient import base
|
||||||
from keystoneclient import exceptions
|
from keystoneclient import exceptions
|
||||||
from keystoneclient.i18n import _
|
from keystoneclient.i18n import _
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
|
|
||||||
class Token(base.Resource):
|
class Token(base.Resource):
|
||||||
@@ -38,7 +39,7 @@ class Token(base.Resource):
|
|||||||
class TokenManager(base.Manager):
|
class TokenManager(base.Manager):
|
||||||
resource_class = Token
|
resource_class = Token
|
||||||
|
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def authenticate(self, username=None, tenant_id=None, tenant_name=None,
|
def authenticate(self, username=None, tenant_id=None, tenant_name=None,
|
||||||
password=None, token=None, return_raw=False):
|
password=None, token=None, return_raw=False):
|
||||||
if token:
|
if token:
|
||||||
|
@@ -10,8 +10,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from positional import positional
|
||||||
|
|
||||||
from keystoneclient import base
|
from keystoneclient import base
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
|
|
||||||
class IdentityProvider(base.Resource):
|
class IdentityProvider(base.Resource):
|
||||||
@@ -38,7 +39,7 @@ class IdentityProviderManager(base.CrudManager):
|
|||||||
return self._update(url, body=body, response_key=self.key,
|
return self._update(url, body=body, response_key=self.key,
|
||||||
method='PUT')
|
method='PUT')
|
||||||
|
|
||||||
@utils.positional.method(0)
|
@positional.method(0)
|
||||||
def create(self, id, **kwargs):
|
def create(self, id, **kwargs):
|
||||||
"""Create Identity Provider object.
|
"""Create Identity Provider object.
|
||||||
|
|
||||||
|
@@ -10,8 +10,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from positional import positional
|
||||||
|
|
||||||
from keystoneclient import base
|
from keystoneclient import base
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
|
|
||||||
class Mapping(base.Resource):
|
class Mapping(base.Resource):
|
||||||
@@ -39,7 +40,7 @@ class MappingManager(base.CrudManager):
|
|||||||
response_key=self.key,
|
response_key=self.key,
|
||||||
method='PUT')
|
method='PUT')
|
||||||
|
|
||||||
@utils.positional.method(0)
|
@positional.method(0)
|
||||||
def create(self, mapping_id, **kwargs):
|
def create(self, mapping_id, **kwargs):
|
||||||
"""Create federation mapping.
|
"""Create federation mapping.
|
||||||
|
|
||||||
|
@@ -10,8 +10,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from positional import positional
|
||||||
|
|
||||||
from keystoneclient import base
|
from keystoneclient import base
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
|
|
||||||
class Protocol(base.Resource):
|
class Protocol(base.Resource):
|
||||||
@@ -56,7 +57,7 @@ class ProtocolManager(base.CrudManager):
|
|||||||
response_key=self.key,
|
response_key=self.key,
|
||||||
method='PUT')
|
method='PUT')
|
||||||
|
|
||||||
@utils.positional.method(3)
|
@positional.method(3)
|
||||||
def create(self, protocol_id, identity_provider, mapping, **kwargs):
|
def create(self, protocol_id, identity_provider, mapping, **kwargs):
|
||||||
"""Create federation protocol object and tie to the Identity Provider.
|
"""Create federation protocol object and tie to the Identity Provider.
|
||||||
|
|
||||||
|
@@ -10,8 +10,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from positional import positional
|
||||||
|
|
||||||
from keystoneclient import base
|
from keystoneclient import base
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
|
|
||||||
class ServiceProvider(base.Resource):
|
class ServiceProvider(base.Resource):
|
||||||
@@ -40,7 +41,7 @@ class ServiceProviderManager(base.CrudManager):
|
|||||||
return self._update(url, body=body, response_key=self.key,
|
return self._update(url, body=body, response_key=self.key,
|
||||||
method='PUT')
|
method='PUT')
|
||||||
|
|
||||||
@utils.positional.method(0)
|
@positional.method(0)
|
||||||
def create(self, id, **kwargs):
|
def create(self, id, **kwargs):
|
||||||
"""Create Service Provider object.
|
"""Create Service Provider object.
|
||||||
|
|
||||||
|
@@ -15,10 +15,10 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from debtcollector import renames
|
from debtcollector import renames
|
||||||
|
from positional import positional
|
||||||
|
|
||||||
from keystoneclient import base
|
from keystoneclient import base
|
||||||
from keystoneclient.i18n import _
|
from keystoneclient.i18n import _
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
|
|
||||||
class Credential(base.Resource):
|
class Credential(base.Resource):
|
||||||
@@ -55,7 +55,7 @@ class CredentialManager(base.CrudManager):
|
|||||||
|
|
||||||
@renames.renamed_kwarg('data', 'blob', version='1.7.0',
|
@renames.renamed_kwarg('data', 'blob', version='1.7.0',
|
||||||
removal_version='2.0.0')
|
removal_version='2.0.0')
|
||||||
@utils.positional(1, enforcement=utils.positional.WARN)
|
@positional(1, enforcement=positional.WARN)
|
||||||
def create(self, user, type, blob=None, data=None, project=None, **kwargs):
|
def create(self, user, type, blob=None, data=None, project=None, **kwargs):
|
||||||
"""Create a credential
|
"""Create a credential
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ class CredentialManager(base.CrudManager):
|
|||||||
|
|
||||||
@renames.renamed_kwarg('data', 'blob', version='1.7.0',
|
@renames.renamed_kwarg('data', 'blob', version='1.7.0',
|
||||||
removal_version='2.0.0')
|
removal_version='2.0.0')
|
||||||
@utils.positional(2, enforcement=utils.positional.WARN)
|
@positional(2, enforcement=positional.WARN)
|
||||||
def update(self, credential, user, type=None, blob=None, data=None,
|
def update(self, credential, user, type=None, blob=None, data=None,
|
||||||
project=None, **kwargs):
|
project=None, **kwargs):
|
||||||
"""Update a credential
|
"""Update a credential
|
||||||
|
@@ -14,8 +14,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from positional import positional
|
||||||
|
|
||||||
from keystoneclient import base
|
from keystoneclient import base
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
|
|
||||||
class Domain(base.Resource):
|
class Domain(base.Resource):
|
||||||
@@ -34,7 +35,7 @@ class DomainManager(base.CrudManager):
|
|||||||
collection_key = 'domains'
|
collection_key = 'domains'
|
||||||
key = 'domain'
|
key = 'domain'
|
||||||
|
|
||||||
@utils.positional(1, enforcement=utils.positional.WARN)
|
@positional(1, enforcement=positional.WARN)
|
||||||
def create(self, name, description=None, enabled=True, **kwargs):
|
def create(self, name, description=None, enabled=True, **kwargs):
|
||||||
return super(DomainManager, self).create(
|
return super(DomainManager, self).create(
|
||||||
name=name,
|
name=name,
|
||||||
@@ -58,7 +59,7 @@ class DomainManager(base.CrudManager):
|
|||||||
kwargs['enabled'] = 0
|
kwargs['enabled'] = 0
|
||||||
return super(DomainManager, self).list(**kwargs)
|
return super(DomainManager, self).list(**kwargs)
|
||||||
|
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def update(self, domain, name=None,
|
def update(self, domain, name=None,
|
||||||
description=None, enabled=None, **kwargs):
|
description=None, enabled=None, **kwargs):
|
||||||
return super(DomainManager, self).update(
|
return super(DomainManager, self).update(
|
||||||
|
@@ -14,10 +14,11 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from positional import positional
|
||||||
|
|
||||||
from keystoneclient import base
|
from keystoneclient import base
|
||||||
from keystoneclient import exceptions
|
from keystoneclient import exceptions
|
||||||
from keystoneclient.i18n import _
|
from keystoneclient.i18n import _
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
|
|
||||||
VALID_INTERFACES = ['public', 'admin', 'internal']
|
VALID_INTERFACES = ['public', 'admin', 'internal']
|
||||||
@@ -50,7 +51,7 @@ class EndpointManager(base.CrudManager):
|
|||||||
msg = msg % ', '.join(VALID_INTERFACES)
|
msg = msg % ', '.join(VALID_INTERFACES)
|
||||||
raise exceptions.ValidationError(msg)
|
raise exceptions.ValidationError(msg)
|
||||||
|
|
||||||
@utils.positional(1, enforcement=utils.positional.WARN)
|
@positional(1, enforcement=positional.WARN)
|
||||||
def create(self, service, url, interface=None, region=None, enabled=True,
|
def create(self, service, url, interface=None, region=None, enabled=True,
|
||||||
**kwargs):
|
**kwargs):
|
||||||
self._validate_interface(interface)
|
self._validate_interface(interface)
|
||||||
@@ -66,7 +67,7 @@ class EndpointManager(base.CrudManager):
|
|||||||
return super(EndpointManager, self).get(
|
return super(EndpointManager, self).get(
|
||||||
endpoint_id=base.getid(endpoint))
|
endpoint_id=base.getid(endpoint))
|
||||||
|
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def list(self, service=None, interface=None, region=None, enabled=None,
|
def list(self, service=None, interface=None, region=None, enabled=None,
|
||||||
region_id=None, **kwargs):
|
region_id=None, **kwargs):
|
||||||
"""List endpoints.
|
"""List endpoints.
|
||||||
@@ -85,7 +86,7 @@ class EndpointManager(base.CrudManager):
|
|||||||
enabled=enabled,
|
enabled=enabled,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def update(self, endpoint, service=None, url=None, interface=None,
|
def update(self, endpoint, service=None, url=None, interface=None,
|
||||||
region=None, enabled=None, **kwargs):
|
region=None, enabled=None, **kwargs):
|
||||||
self._validate_interface(interface)
|
self._validate_interface(interface)
|
||||||
|
@@ -14,8 +14,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from positional import positional
|
||||||
|
|
||||||
from keystoneclient import base
|
from keystoneclient import base
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
|
|
||||||
class Group(base.Resource):
|
class Group(base.Resource):
|
||||||
@@ -27,7 +28,7 @@ class Group(base.Resource):
|
|||||||
* description: group description
|
* description: group description
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def update(self, name=None, description=None):
|
def update(self, name=None, description=None):
|
||||||
kwargs = {
|
kwargs = {
|
||||||
'name': name if name is not None else self.name,
|
'name': name if name is not None else self.name,
|
||||||
@@ -51,7 +52,7 @@ class GroupManager(base.CrudManager):
|
|||||||
collection_key = 'groups'
|
collection_key = 'groups'
|
||||||
key = 'group'
|
key = 'group'
|
||||||
|
|
||||||
@utils.positional(1, enforcement=utils.positional.WARN)
|
@positional(1, enforcement=positional.WARN)
|
||||||
def create(self, name, domain=None, description=None, **kwargs):
|
def create(self, name, domain=None, description=None, **kwargs):
|
||||||
return super(GroupManager, self).create(
|
return super(GroupManager, self).create(
|
||||||
name=name,
|
name=name,
|
||||||
@@ -59,7 +60,7 @@ class GroupManager(base.CrudManager):
|
|||||||
description=description,
|
description=description,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def list(self, user=None, domain=None, **kwargs):
|
def list(self, user=None, domain=None, **kwargs):
|
||||||
"""List groups.
|
"""List groups.
|
||||||
|
|
||||||
@@ -82,7 +83,7 @@ class GroupManager(base.CrudManager):
|
|||||||
return super(GroupManager, self).get(
|
return super(GroupManager, self).get(
|
||||||
group_id=base.getid(group))
|
group_id=base.getid(group))
|
||||||
|
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def update(self, group, name=None, description=None, **kwargs):
|
def update(self, group, name=None, description=None, **kwargs):
|
||||||
return super(GroupManager, self).update(
|
return super(GroupManager, self).update(
|
||||||
group_id=base.getid(group),
|
group_id=base.getid(group),
|
||||||
|
@@ -14,8 +14,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from positional import positional
|
||||||
|
|
||||||
from keystoneclient import base
|
from keystoneclient import base
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
|
|
||||||
class Policy(base.Resource):
|
class Policy(base.Resource):
|
||||||
@@ -27,7 +28,7 @@ class Policy(base.Resource):
|
|||||||
* type: the mime type of the policy blob
|
* type: the mime type of the policy blob
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def update(self, blob=None, type=None):
|
def update(self, blob=None, type=None):
|
||||||
kwargs = {
|
kwargs = {
|
||||||
'blob': blob if blob is not None else self.blob,
|
'blob': blob if blob is not None else self.blob,
|
||||||
@@ -49,7 +50,7 @@ class PolicyManager(base.CrudManager):
|
|||||||
collection_key = 'policies'
|
collection_key = 'policies'
|
||||||
key = 'policy'
|
key = 'policy'
|
||||||
|
|
||||||
@utils.positional(1, enforcement=utils.positional.WARN)
|
@positional(1, enforcement=positional.WARN)
|
||||||
def create(self, blob, type='application/json', **kwargs):
|
def create(self, blob, type='application/json', **kwargs):
|
||||||
return super(PolicyManager, self).create(
|
return super(PolicyManager, self).create(
|
||||||
blob=blob,
|
blob=blob,
|
||||||
@@ -68,7 +69,7 @@ class PolicyManager(base.CrudManager):
|
|||||||
"""
|
"""
|
||||||
return super(PolicyManager, self).list(**kwargs)
|
return super(PolicyManager, self).list(**kwargs)
|
||||||
|
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def update(self, entity, blob=None, type=None, **kwargs):
|
def update(self, entity, blob=None, type=None, **kwargs):
|
||||||
return super(PolicyManager, self).update(
|
return super(PolicyManager, self).update(
|
||||||
policy_id=base.getid(entity),
|
policy_id=base.getid(entity),
|
||||||
|
@@ -14,10 +14,11 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from positional import positional
|
||||||
|
|
||||||
from keystoneclient import base
|
from keystoneclient import base
|
||||||
from keystoneclient import exceptions
|
from keystoneclient import exceptions
|
||||||
from keystoneclient.i18n import _
|
from keystoneclient.i18n import _
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
|
|
||||||
class Project(base.Resource):
|
class Project(base.Resource):
|
||||||
@@ -35,7 +36,7 @@ class Project(base.Resource):
|
|||||||
project in the hierarchy
|
project in the hierarchy
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def update(self, name=None, description=None, enabled=None):
|
def update(self, name=None, description=None, enabled=None):
|
||||||
kwargs = {
|
kwargs = {
|
||||||
'name': name if name is not None else self.name,
|
'name': name if name is not None else self.name,
|
||||||
@@ -60,7 +61,7 @@ class ProjectManager(base.CrudManager):
|
|||||||
collection_key = 'projects'
|
collection_key = 'projects'
|
||||||
key = 'project'
|
key = 'project'
|
||||||
|
|
||||||
@utils.positional(3, enforcement=utils.positional.WARN)
|
@positional(3, enforcement=positional.WARN)
|
||||||
def create(self, name, domain, description=None,
|
def create(self, name, domain, description=None,
|
||||||
enabled=True, parent=None, **kwargs):
|
enabled=True, parent=None, **kwargs):
|
||||||
"""Create a project.
|
"""Create a project.
|
||||||
@@ -88,7 +89,7 @@ class ProjectManager(base.CrudManager):
|
|||||||
enabled=enabled,
|
enabled=enabled,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def list(self, domain=None, user=None, **kwargs):
|
def list(self, domain=None, user=None, **kwargs):
|
||||||
"""List projects.
|
"""List projects.
|
||||||
|
|
||||||
@@ -119,7 +120,7 @@ class ProjectManager(base.CrudManager):
|
|||||||
'parameters, not both')
|
'parameters, not both')
|
||||||
raise exceptions.ValidationError(msg)
|
raise exceptions.ValidationError(msg)
|
||||||
|
|
||||||
@utils.positional()
|
@positional()
|
||||||
def get(self, project, subtree_as_list=False, parents_as_list=False,
|
def get(self, project, subtree_as_list=False, parents_as_list=False,
|
||||||
subtree_as_ids=False, parents_as_ids=False):
|
subtree_as_ids=False, parents_as_ids=False):
|
||||||
"""Get a project.
|
"""Get a project.
|
||||||
@@ -164,7 +165,7 @@ class ProjectManager(base.CrudManager):
|
|||||||
url = self.build_url(dict_args_in_out=dict_args)
|
url = self.build_url(dict_args_in_out=dict_args)
|
||||||
return self._get(url + query, self.key)
|
return self._get(url + query, self.key)
|
||||||
|
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def update(self, project, name=None, domain=None, description=None,
|
def update(self, project, name=None, domain=None, description=None,
|
||||||
enabled=None, **kwargs):
|
enabled=None, **kwargs):
|
||||||
return super(ProjectManager, self).update(
|
return super(ProjectManager, self).update(
|
||||||
|
@@ -14,10 +14,11 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from positional import positional
|
||||||
|
|
||||||
from keystoneclient import base
|
from keystoneclient import base
|
||||||
from keystoneclient import exceptions
|
from keystoneclient import exceptions
|
||||||
from keystoneclient.i18n import _
|
from keystoneclient.i18n import _
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
|
|
||||||
class Role(base.Resource):
|
class Role(base.Resource):
|
||||||
@@ -78,7 +79,7 @@ class RoleManager(base.CrudManager):
|
|||||||
msg = _('Must specify either a user or group')
|
msg = _('Must specify either a user or group')
|
||||||
raise exceptions.ValidationError(msg)
|
raise exceptions.ValidationError(msg)
|
||||||
|
|
||||||
@utils.positional(1, enforcement=utils.positional.WARN)
|
@positional(1, enforcement=positional.WARN)
|
||||||
def create(self, name, **kwargs):
|
def create(self, name, **kwargs):
|
||||||
return super(RoleManager, self).create(
|
return super(RoleManager, self).create(
|
||||||
name=name,
|
name=name,
|
||||||
@@ -88,7 +89,7 @@ class RoleManager(base.CrudManager):
|
|||||||
return super(RoleManager, self).get(
|
return super(RoleManager, self).get(
|
||||||
role_id=base.getid(role))
|
role_id=base.getid(role))
|
||||||
|
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def list(self, user=None, group=None, domain=None,
|
def list(self, user=None, group=None, domain=None,
|
||||||
project=None, os_inherit_extension_inherited=False, **kwargs):
|
project=None, os_inherit_extension_inherited=False, **kwargs):
|
||||||
"""Lists roles and role grants.
|
"""Lists roles and role grants.
|
||||||
@@ -119,7 +120,7 @@ class RoleManager(base.CrudManager):
|
|||||||
|
|
||||||
return super(RoleManager, self).list(**kwargs)
|
return super(RoleManager, self).list(**kwargs)
|
||||||
|
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def update(self, role, name=None, **kwargs):
|
def update(self, role, name=None, **kwargs):
|
||||||
return super(RoleManager, self).update(
|
return super(RoleManager, self).update(
|
||||||
role_id=base.getid(role),
|
role_id=base.getid(role),
|
||||||
@@ -130,7 +131,7 @@ class RoleManager(base.CrudManager):
|
|||||||
return super(RoleManager, self).delete(
|
return super(RoleManager, self).delete(
|
||||||
role_id=base.getid(role))
|
role_id=base.getid(role))
|
||||||
|
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def grant(self, role, user=None, group=None, domain=None, project=None,
|
def grant(self, role, user=None, group=None, domain=None, project=None,
|
||||||
os_inherit_extension_inherited=False, **kwargs):
|
os_inherit_extension_inherited=False, **kwargs):
|
||||||
"""Grants a role to a user or group on a domain or project.
|
"""Grants a role to a user or group on a domain or project.
|
||||||
@@ -151,7 +152,7 @@ class RoleManager(base.CrudManager):
|
|||||||
role_id=base.getid(role),
|
role_id=base.getid(role),
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def check(self, role, user=None, group=None, domain=None, project=None,
|
def check(self, role, user=None, group=None, domain=None, project=None,
|
||||||
os_inherit_extension_inherited=False, **kwargs):
|
os_inherit_extension_inherited=False, **kwargs):
|
||||||
"""Checks if a user or group has a role on a domain or project.
|
"""Checks if a user or group has a role on a domain or project.
|
||||||
@@ -174,7 +175,7 @@ class RoleManager(base.CrudManager):
|
|||||||
os_inherit_extension_inherited=os_inherit_extension_inherited,
|
os_inherit_extension_inherited=os_inherit_extension_inherited,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def revoke(self, role, user=None, group=None, domain=None, project=None,
|
def revoke(self, role, user=None, group=None, domain=None, project=None,
|
||||||
os_inherit_extension_inherited=False, **kwargs):
|
os_inherit_extension_inherited=False, **kwargs):
|
||||||
"""Revokes a role from a user or group on a domain or project.
|
"""Revokes a role from a user or group on a domain or project.
|
||||||
|
@@ -14,8 +14,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from positional import positional
|
||||||
|
|
||||||
from keystoneclient import base
|
from keystoneclient import base
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
|
|
||||||
class Service(base.Resource):
|
class Service(base.Resource):
|
||||||
@@ -37,7 +38,7 @@ class ServiceManager(base.CrudManager):
|
|||||||
collection_key = 'services'
|
collection_key = 'services'
|
||||||
key = 'service'
|
key = 'service'
|
||||||
|
|
||||||
@utils.positional(1, enforcement=utils.positional.WARN)
|
@positional(1, enforcement=positional.WARN)
|
||||||
def create(self, name, type=None,
|
def create(self, name, type=None,
|
||||||
enabled=True, description=None, **kwargs):
|
enabled=True, description=None, **kwargs):
|
||||||
type_arg = type or kwargs.pop('service_type', None)
|
type_arg = type or kwargs.pop('service_type', None)
|
||||||
@@ -52,7 +53,7 @@ class ServiceManager(base.CrudManager):
|
|||||||
return super(ServiceManager, self).get(
|
return super(ServiceManager, self).get(
|
||||||
service_id=base.getid(service))
|
service_id=base.getid(service))
|
||||||
|
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def list(self, name=None, type=None, **kwargs):
|
def list(self, name=None, type=None, **kwargs):
|
||||||
type_arg = type or kwargs.pop('service_type', None)
|
type_arg = type or kwargs.pop('service_type', None)
|
||||||
return super(ServiceManager, self).list(
|
return super(ServiceManager, self).list(
|
||||||
@@ -60,7 +61,7 @@ class ServiceManager(base.CrudManager):
|
|||||||
type=type_arg,
|
type=type_arg,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def update(self, service, name=None, type=None, enabled=None,
|
def update(self, service, name=None, type=None, enabled=None,
|
||||||
description=None, **kwargs):
|
description=None, **kwargs):
|
||||||
type_arg = type or kwargs.pop('service_type', None)
|
type_arg = type or kwargs.pop('service_type', None)
|
||||||
|
@@ -10,9 +10,10 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from positional import positional
|
||||||
|
|
||||||
from keystoneclient import access
|
from keystoneclient import access
|
||||||
from keystoneclient import base
|
from keystoneclient import base
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
|
|
||||||
def _calc_id(token):
|
def _calc_id(token):
|
||||||
@@ -51,7 +52,7 @@ class TokenManager(object):
|
|||||||
resp, body = self._client.get('/auth/tokens/OS-PKI/revoked')
|
resp, body = self._client.get('/auth/tokens/OS-PKI/revoked')
|
||||||
return body
|
return body
|
||||||
|
|
||||||
@utils.positional.method(1)
|
@positional.method(1)
|
||||||
def get_token_data(self, token, include_catalog=True):
|
def get_token_data(self, token, include_catalog=True):
|
||||||
"""Fetch the data about a token from the identity server.
|
"""Fetch the data about a token from the identity server.
|
||||||
|
|
||||||
@@ -70,7 +71,7 @@ class TokenManager(object):
|
|||||||
resp, body = self._client.get(url, headers=headers)
|
resp, body = self._client.get(url, headers=headers)
|
||||||
return body
|
return body
|
||||||
|
|
||||||
@utils.positional.method(1)
|
@positional.method(1)
|
||||||
def validate(self, token, include_catalog=True):
|
def validate(self, token, include_catalog=True):
|
||||||
"""Validate a token.
|
"""Validate a token.
|
||||||
|
|
||||||
|
@@ -17,11 +17,11 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from debtcollector import renames
|
from debtcollector import renames
|
||||||
|
from positional import positional
|
||||||
|
|
||||||
from keystoneclient import base
|
from keystoneclient import base
|
||||||
from keystoneclient import exceptions
|
from keystoneclient import exceptions
|
||||||
from keystoneclient.i18n import _
|
from keystoneclient.i18n import _
|
||||||
from keystoneclient import utils
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ class UserManager(base.CrudManager):
|
|||||||
|
|
||||||
@renames.renamed_kwarg('project', 'default_project', version='1.7.0',
|
@renames.renamed_kwarg('project', 'default_project', version='1.7.0',
|
||||||
removal_version='2.0.0')
|
removal_version='2.0.0')
|
||||||
@utils.positional(1, enforcement=utils.positional.WARN)
|
@positional(1, enforcement=positional.WARN)
|
||||||
def create(self, name, domain=None, project=None, password=None,
|
def create(self, name, domain=None, project=None, password=None,
|
||||||
email=None, description=None, enabled=True,
|
email=None, description=None, enabled=True,
|
||||||
default_project=None, **kwargs):
|
default_project=None, **kwargs):
|
||||||
@@ -78,7 +78,7 @@ class UserManager(base.CrudManager):
|
|||||||
|
|
||||||
@renames.renamed_kwarg('project', 'default_project', version='1.7.0',
|
@renames.renamed_kwarg('project', 'default_project', version='1.7.0',
|
||||||
removal_version='2.0.0')
|
removal_version='2.0.0')
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def list(self, project=None, domain=None, group=None, default_project=None,
|
def list(self, project=None, domain=None, group=None, default_project=None,
|
||||||
**kwargs):
|
**kwargs):
|
||||||
"""List users.
|
"""List users.
|
||||||
@@ -115,7 +115,7 @@ class UserManager(base.CrudManager):
|
|||||||
|
|
||||||
@renames.renamed_kwarg('project', 'default_project', version='1.7.0',
|
@renames.renamed_kwarg('project', 'default_project', version='1.7.0',
|
||||||
removal_version='2.0.0')
|
removal_version='2.0.0')
|
||||||
@utils.positional(enforcement=utils.positional.WARN)
|
@positional(enforcement=positional.WARN)
|
||||||
def update(self, user, name=None, domain=None, project=None, password=None,
|
def update(self, user, name=None, domain=None, project=None, password=None,
|
||||||
email=None, description=None, enabled=None,
|
email=None, description=None, enabled=None,
|
||||||
default_project=None, **kwargs):
|
default_project=None, **kwargs):
|
||||||
|
Reference in New Issue
Block a user