config/sysinv/sysinv/sysinv/sysinv/puppet/horizon.py
Al Bailey 1377383e23 Sysinv. Cleanup import statements for pep8
concurrency is now set to 5 in .testr.conf
unit tests are no longer bandit checked
Unused imports are now excluded.
Note: storage_backend uses eval to dynamically invoke certain calls,
so those imports are flagged noqa

Change-Id: I6b0027072d18e1295798fa9ae355175772be8962
Signed-off-by: Jack Ding <jack.ding@windriver.com>
2018-06-29 13:43:53 -04:00

58 lines
1.5 KiB
Python

#
# Copyright (c) 2017 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from . import openstack
from sysinv.common import exception
class HorizonPuppet(openstack.OpenstackBasePuppet):
"""Class to encapsulate puppet operations for horizon configuration"""
def get_secure_static_config(self):
return {
'openstack::horizon::params::secret_key':
self._generate_random_password(length=32),
}
def get_system_config(self):
config = {
'openstack::horizon::params::enable_https':
self._https_enabled(),
'openstack::horizon::params::openstack_host':
self._keystone_auth_host(),
}
tpm_config = self._get_tpm_config()
if tpm_config is not None:
config.update(tpm_config)
return config
def _get_tpm_config(self):
try:
tpmconfig = self.dbapi.tpmconfig_get_one()
if tpmconfig.tpm_path:
return {
'openstack::horizon::params::tpm_object':
tpmconfig.tpm_path
}
except exception.NotFound:
pass
return None
def get_public_url(self):
# not an openstack service
raise NotImplementedError()
def get_internal_url(self):
# not an openstack service
raise NotImplementedError()
def get_admin_url(self):
# not an openstack service
raise NotImplementedError()