summaryrefslogtreecommitdiffstats
path: root/conductor
diff options
context:
space:
mode:
authorRitu Sood <ritu.sood@intel.com>2018-05-11 07:28:52 -0700
committerRitu Sood <ritu.sood@intel.com>2018-05-11 19:39:57 -0700
commita950e73cd6185df6e843204c7fa69efa5e7640c1 (patch)
tree901c1df53c137fb107253c1bc9a8d85fda674195 /conductor
parenta4bb011a91ef18261167f1e4f555f57e0e8f8b27 (diff)
Adding basic auth to AAI Plugin
For now leaving the original certificates as before so as not to disturb any existing test cases etc. Issue-ID: OPTFRA-232 Change-Id: If28c772f14c89dbf4229d754cf9dd49094fc5196 Signed-off-by: Ritu Sood <ritu.sood@intel.com>
Diffstat (limited to 'conductor')
-rw-r--r--conductor/conductor/data/plugins/inventory_provider/aai.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/conductor/conductor/data/plugins/inventory_provider/aai.py b/conductor/conductor/data/plugins/inventory_provider/aai.py
index 41f55c5..2e36bf5 100644
--- a/conductor/conductor/data/plugins/inventory_provider/aai.py
+++ b/conductor/conductor/data/plugins/inventory_provider/aai.py
@@ -71,6 +71,12 @@ AAI_OPTS = [
help='Certificate Authority Bundle file in pem format. '
'Must contain the appropriate trust chain for the '
'Certificate file.'),
+ cfg.StrOpt('username',
+ default='',
+ help='Username for AAI.'),
+ cfg.StrOpt('password',
+ default='',
+ help='Password for AAI.'),
]
CONF.register_opts(AAI_OPTS, group='aai')
@@ -97,6 +103,8 @@ class AAI(base.InventoryProviderBase):
self.complex_last_refresh_time = None
self.timeout = self.conf.aai.aai_rest_timeout
self.retries = self.conf.aai.aai_retries
+ self.username = self.conf.aai.username
+ self.password = self.conf.aai.password
# Cache is initially empty
self._aai_cache = {}
@@ -172,6 +180,8 @@ class AAI(base.InventoryProviderBase):
kwargs = {
"server_url": self.base,
"retries": self.retries,
+ "username": self.username,
+ "password": self.password,
"cert_file": self.cert,
"cert_key_file": self.key,
"ca_bundle_file": self.verify,