Files
openstack-armada-app/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/libvirt.py
Thiago Brito dceba41943 Add flake8 check and flake8-import-order
Improving the code quality of the plugins by adding the flake8 check on
zuul and addint the flake8-import-order plugin to standardize imports.
Also, defaults testenv to python3.9 configuration that should be used
for now on with the debian migration.

Story: 2010100
Task: 45656
Signed-off-by: Thiago Brito <thiago.brito@windriver.com>
Change-Id: I6566d5b99f4e7b19feeffe3b35674222eabe1cca
2022-06-22 13:46:16 -03:00

60 lines
1.8 KiB
Python

#
# Copyright (c) 2019-2020 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from sysinv.common import exception
from sysinv.helm import common
from k8sapp_openstack.common import constants as app_constants
from k8sapp_openstack.helm import openstack
class LibvirtHelm(openstack.OpenstackBaseHelm):
"""Class to encapsulate helm operations for the libvirt chart"""
CHART = app_constants.HELM_CHART_LIBVIRT
SERVICE_NAME = app_constants.HELM_CHART_LIBVIRT
def get_overrides(self, namespace=None):
admin_keyring = 'null'
if self._is_rook_ceph():
admin_keyring = self._get_rook_ceph_admin_keyring()
overrides = {
common.HELM_NS_OPENSTACK: {
'conf': {
'libvirt': {
'listen_addr': '0.0.0.0'
},
'qemu': {
'user': "root",
'group': "root",
'cgroup_controllers': ["cpu", "cpuacct", "cpuset", "freezer", "net_cls", "perf_event"],
'namespaces': [],
'clear_emulator_capabilities': 0
},
'ceph': {
'admin_keyring': admin_keyring,
},
},
'pod': {
'mounts': {
'libvirt': {
'libvirt': self._get_mount_uefi_overrides()
}
}
},
}
}
if namespace in self.SUPPORTED_NAMESPACES:
return overrides[namespace]
elif namespace:
raise exception.InvalidHelmNamespace(chart=self.CHART,
namespace=namespace)
else:
return overrides