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
This commit is contained in:
parent
b5b4cc562a
commit
dceba41943
18
.zuul.yaml
18
.zuul.yaml
@ -7,6 +7,7 @@
|
||||
- k8sapp-openstack-tox-py36
|
||||
- k8sapp-openstack-tox-py39
|
||||
- k8sapp-openstack-tox-pylint
|
||||
- k8sapp-openstack-tox-pep8
|
||||
gate:
|
||||
jobs:
|
||||
- openstack-tox-linters
|
||||
@ -98,6 +99,23 @@
|
||||
tox_envlist: pylint
|
||||
tox_extra_args: -c python-k8sapp-openstack/k8sapp_openstack/tox.ini
|
||||
|
||||
- job:
|
||||
name: k8sapp-openstack-tox-pep8
|
||||
parent: tox
|
||||
description: |
|
||||
Run pep8 tests for k8sapp_openstack
|
||||
nodeset: ubuntu-bionic
|
||||
required-projects:
|
||||
- starlingx/config
|
||||
- starlingx/fault
|
||||
- starlingx/update
|
||||
- starlingx/utilities
|
||||
files:
|
||||
- python-k8sapp-openstack/*
|
||||
vars:
|
||||
tox_envlist: pep8
|
||||
tox_extra_args: -c python-k8sapp-openstack/k8sapp_openstack/tox.ini
|
||||
|
||||
- secret:
|
||||
name: stx-openstack-armada-app-github-secret
|
||||
data:
|
||||
|
@ -1,4 +1,3 @@
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
#
|
||||
# Copyright (c) 2019-2021 Wind River Systems, Inc.
|
||||
#
|
||||
@ -9,11 +8,15 @@
|
||||
|
||||
""" System inventory Armada manifest operator."""
|
||||
|
||||
# fmt:off
|
||||
import os
|
||||
from copy import deepcopy
|
||||
import os
|
||||
|
||||
from oslo_log import log as logging
|
||||
import ruamel.yaml as yaml
|
||||
from sysinv.common import constants
|
||||
from sysinv.common import exception
|
||||
from sysinv.helm import manifest_base as base
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm.aodh import AodhHelm
|
||||
from k8sapp_openstack.helm.barbican import BarbicanHelm
|
||||
@ -39,17 +42,12 @@ from k8sapp_openstack.helm.nginx_ports_control import NginxPortsControlHelm
|
||||
from k8sapp_openstack.helm.nova import NovaHelm
|
||||
from k8sapp_openstack.helm.nova_api_proxy import NovaApiProxyHelm
|
||||
from k8sapp_openstack.helm.openvswitch import OpenvswitchHelm
|
||||
from k8sapp_openstack.helm.pci_irq_affinity_agent import \
|
||||
PciIrqAffinityAgentHelm
|
||||
from k8sapp_openstack.helm.pci_irq_affinity_agent import PciIrqAffinityAgentHelm
|
||||
from k8sapp_openstack.helm.placement import PlacementHelm
|
||||
from k8sapp_openstack.helm.psp_rolebinding import PSPRolebindingHelm
|
||||
from k8sapp_openstack.helm.rabbitmq import RabbitmqHelm
|
||||
from k8sapp_openstack.helm.swift import SwiftHelm
|
||||
from oslo_log import log as logging
|
||||
from sysinv.common import constants, exception
|
||||
from sysinv.helm import manifest_base as base
|
||||
|
||||
# fmt:on
|
||||
|
||||
KEY_SCHEMA = "schema"
|
||||
VAL_SCHEMA_CHART_GROUP = "armada/ChartGroup/v"
|
||||
|
@ -4,12 +4,12 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
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 AodhHelm(openstack.OpenstackBaseHelm):
|
||||
"""Class to encapsulate helm operations for the aodh chart"""
|
||||
|
@ -4,12 +4,12 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
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 BarbicanHelm(openstack.OpenstackBaseHelm):
|
||||
"""Class to encapsulate helm operations for the barbican chart"""
|
||||
@ -84,4 +84,3 @@ class BarbicanHelm(openstack.OpenstackBaseHelm):
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,13 +4,13 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
from sysinv.common import exception
|
||||
from sysinv.common import utils
|
||||
from sysinv.helm import common
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
|
||||
class CeilometerHelm(openstack.OpenstackBaseHelm):
|
||||
"""Class to encapsulate helm operations for the ceilometer chart"""
|
||||
|
@ -4,15 +4,15 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
import tsconfig.tsconfig as tsc
|
||||
from sysinv.common import constants
|
||||
from sysinv.common import exception
|
||||
from sysinv.common import utils
|
||||
from sysinv.common import storage_backend_conf
|
||||
from sysinv.common import utils
|
||||
from sysinv.helm import common
|
||||
from tsconfig import tsconfig as tsc
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
|
||||
ROOK_CEPH_BACKEND_NAME = 'ceph-store'
|
||||
@ -179,7 +179,6 @@ class CinderHelm(openstack.OpenstackBaseHelm):
|
||||
'cafile': self.get_ca_file()
|
||||
}
|
||||
|
||||
|
||||
return conf_cinder
|
||||
|
||||
def _get_conf_backends_overrides(self):
|
||||
|
@ -4,13 +4,13 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
from sysinv.common import constants
|
||||
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 DcdbsyncHelm(openstack.OpenstackBaseHelm):
|
||||
"""Class to encapsulate helm operations for the dcdbsync chart"""
|
||||
|
@ -3,11 +3,12 @@
|
||||
#
|
||||
|
||||
from oslo_log import log as logging
|
||||
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
|
||||
|
||||
from sysinv.common import exception
|
||||
from sysinv.helm import common
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -4,16 +4,16 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
from sysinv.common import constants
|
||||
from sysinv.common import exception
|
||||
from sysinv.common import utils
|
||||
from sysinv.common.storage_backend_conf import StorageBackendConfig
|
||||
|
||||
from sysinv.helm import common
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
|
||||
# Info used in the Glance Helm chart.
|
||||
RBD_STORE_USER = 'images'
|
||||
|
@ -4,12 +4,12 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
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 GnocchiHelm(openstack.OpenstackBaseHelm):
|
||||
"""Class to encapsulate helm operations for the gnocchi chart"""
|
||||
|
@ -4,12 +4,12 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
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 HeatHelm(openstack.OpenstackBaseHelm):
|
||||
"""Class to encapsulate helm operations for the heat chart"""
|
||||
|
@ -4,10 +4,11 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from sysinv.common import exception
|
||||
from sysinv.helm import common
|
||||
from sysinv.helm import base
|
||||
from sysinv.helm import common
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
|
||||
|
||||
class HelmToolkitHelm(base.BaseHelm):
|
||||
|
@ -4,13 +4,13 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
from sysinv.common import constants
|
||||
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 HorizonHelm(openstack.OpenstackBaseHelm):
|
||||
"""Class to encapsulate helm operations for the horizon chart"""
|
||||
|
@ -4,14 +4,13 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
from sysinv.common import constants
|
||||
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 IronicHelm(openstack.OpenstackBaseHelm):
|
||||
"""Class to encapsulate helm operations for the ironic chart"""
|
||||
|
@ -4,15 +4,15 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from six.moves import configparser
|
||||
import os
|
||||
|
||||
from six.moves import configparser
|
||||
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
|
||||
|
||||
from sysinv.common import exception
|
||||
from sysinv.helm import common
|
||||
|
||||
|
||||
OPENSTACK_PASSWORD_RULES_FILE = '/etc/keystone/password-rules.conf'
|
||||
|
||||
|
@ -4,12 +4,12 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
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"""
|
||||
|
@ -4,13 +4,12 @@
|
||||
# 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
|
||||
|
||||
from sysinv.common import exception
|
||||
|
||||
from sysinv.helm import common
|
||||
|
||||
|
||||
class MagnumHelm(openstack.OpenstackBaseHelm):
|
||||
"""Class to encapsulate helm operations for the magnum chart"""
|
||||
|
@ -4,13 +4,13 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from sysinv.common import exception
|
||||
from sysinv.common import utils as cutils
|
||||
from sysinv.helm import common
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
from sysinv.common import utils as cutils
|
||||
from sysinv.common import exception
|
||||
from sysinv.helm import common
|
||||
|
||||
|
||||
class MariadbHelm(openstack.OpenstackBaseHelm):
|
||||
"""Class to encapsulate helm operations for the mariadb chart"""
|
||||
|
@ -5,14 +5,14 @@
|
||||
#
|
||||
|
||||
from oslo_log import log as logging
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
from sysinv.common import constants
|
||||
from sysinv.common import exception
|
||||
from sysinv.common import utils
|
||||
from sysinv.helm import common
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
DATA_NETWORK_TYPES = [constants.NETWORK_TYPE_DATA]
|
||||
|
@ -5,10 +5,11 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from sysinv.common import exception
|
||||
from sysinv.helm import common
|
||||
from sysinv.helm import base
|
||||
from sysinv.helm import common
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
|
||||
|
||||
class NginxPortsControlHelm(base.BaseHelm):
|
||||
|
@ -9,9 +9,6 @@ import copy
|
||||
import os
|
||||
|
||||
from oslo_log import log as logging
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
from sysinv.common import constants
|
||||
from sysinv.common import exception
|
||||
from sysinv.common import interface
|
||||
@ -19,6 +16,9 @@ from sysinv.common import utils
|
||||
from sysinv.common.storage_backend_conf import StorageBackendConfig
|
||||
from sysinv.helm import common
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
# Align ephemeral rbd_user with the cinder rbd_user so that the same libvirt
|
||||
|
@ -4,12 +4,12 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
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 NovaApiProxyHelm(openstack.OpenstackBaseHelm):
|
||||
"""Class to encapsulate helm operations for the nova chart"""
|
||||
|
@ -4,9 +4,7 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from eventlet.green import subprocess
|
||||
import base64
|
||||
import keyring
|
||||
import os
|
||||
# Adding a try-import as six 1.12.0 doesn't have this move and we are pinned
|
||||
# at the stein upper-requirements on tox.ini
|
||||
@ -18,6 +16,8 @@ except ImportError: # Python 2.7-3.2
|
||||
from cryptography.hazmat.backends import default_backend
|
||||
from cryptography.hazmat.primitives import serialization
|
||||
from cryptography.hazmat.primitives.asymmetric import rsa
|
||||
from eventlet.green import subprocess
|
||||
import keyring
|
||||
from oslo_log import log
|
||||
from oslo_serialization import jsonutils
|
||||
from sqlalchemy.orm.exc import NoResultFound
|
||||
@ -29,8 +29,8 @@ from sysinv.common.storage_backend_conf import K8RbdProvisioner
|
||||
from sysinv.helm import base
|
||||
from sysinv.helm import common
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack import utils as app_utils
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
@ -263,7 +263,6 @@ class OpenstackBaseHelm(BaseHelm):
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
return overrides
|
||||
|
||||
def _get_file_content(self, filename):
|
||||
|
@ -4,14 +4,14 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
from sysinv.common import constants
|
||||
from sysinv.common import exception
|
||||
from sysinv.common import utils
|
||||
from sysinv.helm import common
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
|
||||
class OpenvswitchHelm(openstack.OpenstackBaseHelm):
|
||||
"""Class to encapsulate helm operations for the openvswitch chart"""
|
||||
|
@ -5,12 +5,12 @@
|
||||
#
|
||||
|
||||
from oslo_log import log as logging
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
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
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@ -49,10 +49,10 @@ class PciIrqAffinityAgentHelm(openstack.OpenstackBaseHelm):
|
||||
|
||||
overrides = {
|
||||
'identity': {
|
||||
'auth': self._get_endpoints_identity_overrides(
|
||||
self.SERVICE_NAME,
|
||||
self.AUTH_USERS
|
||||
),
|
||||
'auth': self._get_endpoints_identity_overrides(
|
||||
self.SERVICE_NAME,
|
||||
self.AUTH_USERS
|
||||
),
|
||||
},
|
||||
'rabbit': {
|
||||
'rabbit_userid': nova_oslo_messaging_data['username'],
|
||||
|
@ -5,12 +5,12 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
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 PlacementHelm(openstack.OpenstackBaseHelm):
|
||||
"""Class to encapsulate helm operations for the placement chart"""
|
||||
|
@ -4,12 +4,12 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
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 RabbitmqHelm(openstack.OpenstackBaseHelm):
|
||||
"""Class to encapsulate helm operations for the rabbitmq chart"""
|
||||
|
@ -4,12 +4,12 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
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 SwiftHelm(openstack.OpenstackBaseHelm):
|
||||
"""Class to encapsulate helm operations for the swift chart"""
|
||||
|
@ -3,8 +3,8 @@
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import uuidutils
|
||||
from sysinv.common import constants
|
||||
from sysinv.helm import common
|
||||
@ -39,7 +39,7 @@ class AodhGetOverrideTest(AodhHelmTestCase,
|
||||
},
|
||||
},
|
||||
},
|
||||
'conf': {},
|
||||
'conf': {},
|
||||
})
|
||||
|
||||
@mock.patch('os.path.exists', return_value=True)
|
||||
|
@ -3,8 +3,8 @@
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import uuidutils
|
||||
from sysinv.common import constants
|
||||
from sysinv.helm import common
|
||||
|
@ -3,8 +3,8 @@
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import uuidutils
|
||||
from sysinv.common import constants
|
||||
from sysinv.helm import common
|
||||
|
@ -3,8 +3,8 @@
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import uuidutils
|
||||
from sysinv.common import constants
|
||||
from sysinv.helm import common
|
||||
|
@ -3,8 +3,8 @@
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import uuidutils
|
||||
from sysinv.common import constants
|
||||
from sysinv.helm import common
|
||||
|
@ -3,8 +3,8 @@
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import uuidutils
|
||||
from sysinv.common import constants
|
||||
from sysinv.helm import common
|
||||
@ -40,9 +40,9 @@ class GlanceGetOverrideTest(GlanceHelmTestCase,
|
||||
},
|
||||
},
|
||||
'storage': {},
|
||||
'conf': {},
|
||||
'bootstrap': {},
|
||||
'ceph_client': {},
|
||||
'conf': {},
|
||||
'bootstrap': {},
|
||||
'ceph_client': {},
|
||||
})
|
||||
|
||||
@mock.patch('os.path.exists', return_value=True)
|
||||
|
@ -3,8 +3,8 @@
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import uuidutils
|
||||
from sysinv.common import constants
|
||||
from sysinv.helm import common
|
||||
|
@ -3,8 +3,8 @@
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import uuidutils
|
||||
from sysinv.common import constants
|
||||
from sysinv.helm import common
|
||||
|
@ -3,8 +3,8 @@
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import uuidutils
|
||||
from sysinv.common import constants
|
||||
from sysinv.helm import common
|
||||
|
@ -3,17 +3,13 @@
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
import mock
|
||||
|
||||
from oslo_utils import uuidutils
|
||||
from sysinv.common import constants
|
||||
from sysinv.helm import common
|
||||
from sysinv.tests.db import base as dbbase
|
||||
from sysinv.tests.db import utils as dbutils
|
||||
from sysinv.tests.helm import base
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.helm import neutron
|
||||
from k8sapp_openstack.tests import test_plugins
|
||||
|
||||
|
||||
@ -50,7 +46,7 @@ class IronicGetOverrideTest(IronicHelmTestCase,
|
||||
app_constants.HELM_CHART_IRONIC,
|
||||
cnamespace=common.HELM_NS_OPENSTACK)
|
||||
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
overrides_ironic["endpoints"]["identity"]["auth"]["glance"],
|
||||
overrides_glance["endpoints"]["identity"]["auth"]["glance"],
|
||||
)
|
||||
|
@ -3,8 +3,8 @@
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import uuidutils
|
||||
from sysinv.common import constants
|
||||
from sysinv.helm import common
|
||||
@ -39,8 +39,8 @@ class KeystoneGetOverrideTest(KeystoneHelmTestCase,
|
||||
},
|
||||
},
|
||||
},
|
||||
'conf': {},
|
||||
'network': {},
|
||||
'conf': {},
|
||||
'network': {},
|
||||
})
|
||||
|
||||
@mock.patch('os.path.exists', return_value=True)
|
||||
|
@ -3,8 +3,8 @@
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import uuidutils
|
||||
from sysinv.common import constants
|
||||
from sysinv.helm import common
|
||||
|
@ -3,8 +3,8 @@
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import uuidutils
|
||||
from sysinv.common import constants
|
||||
from sysinv.helm import common
|
||||
@ -50,7 +50,7 @@ class NeutronGetOverrideTest(NeutronHelmTestCase,
|
||||
app_constants.HELM_CHART_NEUTRON,
|
||||
cnamespace=common.HELM_NS_OPENSTACK)
|
||||
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
overrides_nova["endpoints"]["identity"]["auth"]["nova"],
|
||||
overrides_neutron["endpoints"]["identity"]["auth"]["nova"],
|
||||
)
|
||||
|
@ -3,8 +3,8 @@
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import uuidutils
|
||||
from sysinv.common import constants
|
||||
from sysinv.helm import common
|
||||
@ -83,15 +83,15 @@ class NovaGetOverrideTest(NovaHelmTestCase,
|
||||
app_constants.HELM_CHART_NOVA,
|
||||
cnamespace=common.HELM_NS_OPENSTACK)
|
||||
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
overrides_nova["endpoints"]["identity"]["auth"]["neutron"],
|
||||
overrides_neutron["endpoints"]["identity"]["auth"]["neutron"],
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
overrides_nova["endpoints"]["identity"]["auth"]["ironic"],
|
||||
overrides_ironic["endpoints"]["identity"]["auth"]["ironic"],
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
overrides_nova["endpoints"]["identity"]["auth"]["placement"],
|
||||
overrides_placement["endpoints"]["identity"]["auth"]["placement"],
|
||||
)
|
||||
|
@ -3,8 +3,8 @@
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import uuidutils
|
||||
from sysinv.common import constants
|
||||
from sysinv.helm import common
|
||||
@ -53,11 +53,11 @@ class NovaApiProxyGetOverrideTest(NovaApiProxyHelmTestCase,
|
||||
app_constants.HELM_CHART_NOVA_API_PROXY,
|
||||
cnamespace=common.HELM_NS_OPENSTACK)
|
||||
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
overrides_n_api_prx["endpoints"]["identity"]["auth"]["neutron"],
|
||||
overrides_neutron["endpoints"]["identity"]["auth"]["neutron"],
|
||||
)
|
||||
self.assertEquals(
|
||||
self.assertEqual(
|
||||
overrides_n_api_prx["endpoints"]["identity"]["auth"]["placement"],
|
||||
overrides_placement["endpoints"]["identity"]["auth"]["placement"],
|
||||
)
|
||||
|
@ -3,8 +3,8 @@
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
import mock
|
||||
|
||||
import mock
|
||||
from oslo_utils import uuidutils
|
||||
from sysinv.common import constants
|
||||
from sysinv.helm import common
|
||||
|
@ -5,11 +5,10 @@
|
||||
#
|
||||
|
||||
import mock
|
||||
from sysinv.tests.db import base as dbbase
|
||||
|
||||
from k8sapp_openstack.lifecycle import lifecycle_openstack
|
||||
|
||||
from sysinv.tests.db import base as dbbase
|
||||
|
||||
|
||||
class OpenstackAppLifecycleOperatorTest(dbbase.ControllerHostTestCase):
|
||||
def setUp(self):
|
||||
|
@ -4,14 +4,14 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.tests import test_plugins
|
||||
|
||||
from sysinv.helm import common
|
||||
from sysinv.tests.db import base as dbbase
|
||||
from sysinv.tests.db import utils as dbutils
|
||||
from sysinv.tests.helm import base
|
||||
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from k8sapp_openstack.tests import test_plugins
|
||||
|
||||
|
||||
class NovaApiProxyTestCase(test_plugins.K8SAppOpenstackAppMixin,
|
||||
base.HelmTestCaseMixin):
|
||||
@ -38,7 +38,6 @@ class NovaApiProxyIPv4ControllerHostTestCase(NovaApiProxyTestCase,
|
||||
class NovaApiProxyIPv4AIODuplexSystemTestCase(NovaApiProxyTestCase,
|
||||
dbbase.ProvisionedAIODuplexSystemTestCase):
|
||||
|
||||
|
||||
def test_replicas(self):
|
||||
overrides = self.operator.get_helm_chart_overrides(
|
||||
app_constants.HELM_CHART_NOVA_API_PROXY,
|
||||
|
@ -2,12 +2,7 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
# fmt:off
|
||||
import mock
|
||||
|
||||
from k8sapp_openstack.armada.manifest_openstack import \
|
||||
OpenstackArmadaManifestOperator
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
from sysinv.common import constants
|
||||
from sysinv.helm import common
|
||||
from sysinv.tests.db import base as dbbase
|
||||
@ -15,7 +10,9 @@ from sysinv.tests.db import utils as dbutils
|
||||
from sysinv.tests.helm import base
|
||||
from sysinv.tests.helm.test_helm import HelmOperatorTestSuiteMixin
|
||||
|
||||
# fmt:on
|
||||
from k8sapp_openstack.armada.manifest_openstack import OpenstackArmadaManifestOperator
|
||||
from k8sapp_openstack.common import constants as app_constants
|
||||
|
||||
|
||||
KEY_SCHEMA = "schema"
|
||||
KEY_METADATA = "metadata"
|
||||
|
@ -5,11 +5,8 @@
|
||||
#
|
||||
|
||||
import mock
|
||||
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
from sysinv.common import constants
|
||||
|
||||
from sysinv.tests.db import base as dbbase
|
||||
|
||||
from k8sapp_openstack import utils as app_utils
|
||||
|
@ -1,5 +1,5 @@
|
||||
[tox]
|
||||
envlist = flake8,py27,py36,py39,pylint
|
||||
envlist = pep8,py27,py36,py39,pylint
|
||||
minversion = 1.6
|
||||
# skipsdist = True
|
||||
#,pip-missing-reqs
|
||||
@ -10,6 +10,7 @@ stxdir = {toxinidir}/../../..
|
||||
distshare={toxworkdir}/.tox/distshare
|
||||
|
||||
[testenv]
|
||||
basepython = python3.9
|
||||
# usedevelop = True
|
||||
# enabling usedevelop results in py27 develop-inst:
|
||||
# Exception: Versioning for this project requires either an sdist tarball,
|
||||
@ -21,10 +22,8 @@ sitepackages = False
|
||||
whitelist_externals = bash
|
||||
find
|
||||
|
||||
install_command = pip install \
|
||||
-v -v -v \
|
||||
-c{toxinidir}/upper-constraints.txt \
|
||||
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt} \
|
||||
install_command = pip install -v -v -v \
|
||||
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
|
||||
{opts} {packages}
|
||||
|
||||
# Note the hash seed is set to 0 until can be tested with a
|
||||
@ -97,16 +96,28 @@ ignore = H101,H102,H104,H105,H306,H401,H403,H404,H405,H701,H702,H703,
|
||||
E117,E126,E127,E128,E402
|
||||
exclude = build,dist,tools,.eggs
|
||||
max-line-length=120
|
||||
import-order-style = google
|
||||
application-import-names = k8sapp_openstack
|
||||
|
||||
[testenv:flake8]
|
||||
basepython = python3
|
||||
[testenv:pep8]
|
||||
basepython = python3.6
|
||||
deps = -r{toxinidir}/test-requirements.txt
|
||||
flake8-bugbear
|
||||
flake8-import-order
|
||||
install_command = pip install -v -v -v \
|
||||
-c{toxinidir}/upper-constraints.txt \
|
||||
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt} \
|
||||
{opts} {packages}
|
||||
commands =
|
||||
flake8 {posargs} .
|
||||
|
||||
[testenv:py27]
|
||||
basepython = python2.7
|
||||
install_command = pip install \
|
||||
-v -v -v \
|
||||
-c{toxinidir}/upper-constraints.txt \
|
||||
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt} \
|
||||
{opts} {packages}
|
||||
commands =
|
||||
{[testenv]commands}
|
||||
stestr run {posargs}
|
||||
@ -114,26 +125,21 @@ commands =
|
||||
|
||||
[testenv:py36]
|
||||
basepython = python3.6
|
||||
commands =
|
||||
{[testenv]commands}
|
||||
stestr run {posargs}
|
||||
stestr slowest
|
||||
|
||||
[testenv:py39]
|
||||
basepython = python3.9
|
||||
install_command = pip install -v -v -v \
|
||||
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
|
||||
install_command = pip install \
|
||||
-v -v -v \
|
||||
-c{toxinidir}/upper-constraints.txt \
|
||||
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt} \
|
||||
{opts} {packages}
|
||||
commands =
|
||||
{[testenv]commands}
|
||||
stestr run {posargs}
|
||||
stestr slowest
|
||||
|
||||
[testenv:pep8]
|
||||
# testenv:flake8 clone
|
||||
basepython = {[testenv:flake8]basepython}
|
||||
deps = {[testenv:flake8]deps}
|
||||
commands = {[testenv:flake8]commands}
|
||||
[testenv:py39]
|
||||
commands =
|
||||
{[testenv]commands}
|
||||
stestr run {posargs}
|
||||
stestr slowest
|
||||
|
||||
[testenv:venv]
|
||||
commands = {posargs}
|
||||
@ -179,9 +185,13 @@ commands = bandit --ini tox.ini -n 5 -r k8sapp_openstack
|
||||
[testenv:pylint]
|
||||
basepython = python2.7
|
||||
sitepackages = False
|
||||
|
||||
deps = {[testenv]deps}
|
||||
pylint
|
||||
install_command = pip install \
|
||||
-v -v -v \
|
||||
-c{toxinidir}/upper-constraints.txt \
|
||||
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt} \
|
||||
{opts} {packages}
|
||||
commands =
|
||||
pylint {posargs} k8sapp_openstack --rcfile=./pylint.rc
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Override upstream constraints based on StarlingX load
|
||||
# Override upstream constraints based on StarlingX CentOS load, do not use for Debian
|
||||
iso8601==0.1.12
|
||||
openstacksdk==0.27.1
|
||||
os-client-config==1.32.0
|
||||
|
Loading…
Reference in New Issue
Block a user