diff options
author | Sundar Nadathur <sundar.nadathur@intel.com> | 2019-01-16 00:31:01 -0800 |
---|---|---|
committer | Sundar Nadathur <sundar.nadathur@intel.com> | 2020-03-21 12:03:37 -0700 |
commit | c071741d565950ba0a6b43f7b66aad0bdbaf1dff (patch) | |
tree | 869a6c80739e40bc57d4eaca319221384e62dc21 /nova/accelerator | |
parent | 53775aa81957b4c78045e631027c5576a5ab5693 (diff) | |
download | nova-c071741d565950ba0a6b43f7b66aad0bdbaf1dff.tar.gz |
ksa auth conf and client for Cyborg access
Framework for communication with the Cyborg API.
- Standard keystoneauth1 config options for setting up authentication in
the [cyborg] section of nova*.conf.
- A new nova.accelerator.cyborg module containing a get_client method to
return a client containing a keystoneauth1 adapter pointing
to the Cyborg service with user- and service- based authentication.
- Requirements updates to pull in the os-service-types release
containing the 'accelerator' service type.
Change-Id: Iee0766269d61948ad701911e8b0e5e24d3d6eb04
Blueprint: nova-cyborg-interaction
Diffstat (limited to 'nova/accelerator')
-rw-r--r-- | nova/accelerator/__init__.py | 0 | ||||
-rw-r--r-- | nova/accelerator/cyborg.py | 32 |
2 files changed, 32 insertions, 0 deletions
diff --git a/nova/accelerator/__init__.py b/nova/accelerator/__init__.py new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/nova/accelerator/__init__.py diff --git a/nova/accelerator/cyborg.py b/nova/accelerator/cyborg.py new file mode 100644 index 0000000000..dca3688665 --- /dev/null +++ b/nova/accelerator/cyborg.py @@ -0,0 +1,32 @@ +# Copyright 2019 Intel +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from oslo_log import log as logging + +from nova import service_auth +from nova import utils + + +LOG = logging.getLogger(__name__) + + +def get_client(context): + return _CyborgClient(context) + + +class _CyborgClient(object): + + def __init__(self, context): + auth = service_auth.get_auth_plugin(context) + self._client = utils.get_ksa_adapter('accelerator', ksa_auth=auth) |