diff --git a/.zuul.yaml b/.zuul.yaml index 47864fb4..beba25ad 100644 --- a/.zuul.yaml +++ b/.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: diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/armada/manifest_openstack.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/armada/manifest_openstack.py index 03b27cd9..afe66f9d 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/armada/manifest_openstack.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/armada/manifest_openstack.py @@ -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" diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/aodh.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/aodh.py index 2a1f0979..57378ba5 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/aodh.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/aodh.py @@ -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""" diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/barbican.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/barbican.py index 856a6c07..390ceff5 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/barbican.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/barbican.py @@ -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): }, } } - diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/ceilometer.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/ceilometer.py index 02608713..37786a8b 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/ceilometer.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/ceilometer.py @@ -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""" diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/cinder.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/cinder.py index 161c6806..c6355034 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/cinder.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/cinder.py @@ -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): diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/dcdbsync.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/dcdbsync.py index 4c4c391a..0e9e9940 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/dcdbsync.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/dcdbsync.py @@ -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""" diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/fm_rest_api.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/fm_rest_api.py index 44746150..7fc0dba4 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/fm_rest_api.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/fm_rest_api.py @@ -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__) diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/glance.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/glance.py index bd00ef29..4e01f0d3 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/glance.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/glance.py @@ -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' diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/gnocchi.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/gnocchi.py index 9d31203f..7d5f2616 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/gnocchi.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/gnocchi.py @@ -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""" diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/heat.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/heat.py index 0433c472..3a4d5d5f 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/heat.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/heat.py @@ -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""" diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/helm_toolkit.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/helm_toolkit.py index 1044aaf1..425e195e 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/helm_toolkit.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/helm_toolkit.py @@ -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): diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/horizon.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/horizon.py index e2cf5dbb..927c17e7 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/horizon.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/horizon.py @@ -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""" diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/ironic.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/ironic.py index 774b42f1..8fb621dc 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/ironic.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/ironic.py @@ -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""" diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/keystone.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/keystone.py index 293d3730..2c6f41ad 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/keystone.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/keystone.py @@ -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' diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/libvirt.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/libvirt.py index 9e7132f3..db6a8bbf 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/libvirt.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/libvirt.py @@ -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""" diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/magnum.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/magnum.py index 9ecd32b9..a01ab8e8 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/magnum.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/magnum.py @@ -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""" diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/mariadb.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/mariadb.py index f58d70a8..f108d109 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/mariadb.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/mariadb.py @@ -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""" diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/neutron.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/neutron.py index 18dd33b7..afe7c2b2 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/neutron.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/neutron.py @@ -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] diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/nginx_ports_control.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/nginx_ports_control.py index 09f22075..deacc7a7 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/nginx_ports_control.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/nginx_ports_control.py @@ -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): diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/nova.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/nova.py index 90e8db64..87d4440e 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/nova.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/nova.py @@ -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 diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/nova_api_proxy.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/nova_api_proxy.py index e2949dd1..1f79e4e2 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/nova_api_proxy.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/nova_api_proxy.py @@ -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""" diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/openstack.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/openstack.py index 5b426340..5819e2cf 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/openstack.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/openstack.py @@ -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): diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/openvswitch.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/openvswitch.py index b2ba4cc8..2f232782 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/openvswitch.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/openvswitch.py @@ -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""" diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/pci_irq_affinity_agent.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/pci_irq_affinity_agent.py index 8e04af03..fe46ff5e 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/pci_irq_affinity_agent.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/pci_irq_affinity_agent.py @@ -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'], diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/placement.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/placement.py index 7b1c25c8..7692fd83 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/placement.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/placement.py @@ -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""" diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/rabbitmq.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/rabbitmq.py index c6ba5fcb..38283eb0 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/rabbitmq.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/rabbitmq.py @@ -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""" diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/swift.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/swift.py index f3ada5d5..fdb4517c 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/swift.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/helm/swift.py @@ -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""" diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_aodh.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_aodh.py index 4dcea022..9e3a1f15 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_aodh.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_aodh.py @@ -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) diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_barbican.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_barbican.py index 8c1cac0b..0e166fb3 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_barbican.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_barbican.py @@ -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 diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_ceilometer.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_ceilometer.py index 7c1bfe86..8416bc43 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_ceilometer.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_ceilometer.py @@ -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 diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_cinder.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_cinder.py index 1bfaf399..2f1e5318 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_cinder.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_cinder.py @@ -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 diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_fm_rest_api.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_fm_rest_api.py index e8caf4a0..7311bf51 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_fm_rest_api.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_fm_rest_api.py @@ -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 diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_glance.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_glance.py index 20a70d11..2b829f28 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_glance.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_glance.py @@ -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) diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_gnocchi.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_gnocchi.py index 009175e9..207d1334 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_gnocchi.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_gnocchi.py @@ -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 diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_heat.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_heat.py index 2e94101f..b959bf93 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_heat.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_heat.py @@ -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 diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_horizon.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_horizon.py index d4ed975f..cddd58af 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_horizon.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_horizon.py @@ -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 diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_ironic.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_ironic.py index 15726ff3..a2012d9b 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_ironic.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_ironic.py @@ -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"], ) diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_keystone.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_keystone.py index e026b419..46d98497 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_keystone.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_keystone.py @@ -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) diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_keystone_api_proxy.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_keystone_api_proxy.py index 92fdc049..bed292d6 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_keystone_api_proxy.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_keystone_api_proxy.py @@ -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 diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_neutron.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_neutron.py index 7602e6a4..51baf263 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_neutron.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_neutron.py @@ -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"], ) diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_nova.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_nova.py index d36e3706..eaa522e1 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_nova.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_nova.py @@ -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"], ) diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_nova_api_proxy.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_nova_api_proxy.py index 8543ec22..6e0bfcc5 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_nova_api_proxy.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_nova_api_proxy.py @@ -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"], ) diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_placement.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_placement.py index f87d5096..69074a41 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_placement.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/helm/test_placement.py @@ -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 diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/lifecycle/test_lifecycle_openstack.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/lifecycle/test_lifecycle_openstack.py index 15b83b5f..02502796 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/lifecycle/test_lifecycle_openstack.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/lifecycle/test_lifecycle_openstack.py @@ -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): diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/test_nova_api_proxy.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/test_nova_api_proxy.py index e54d1d0b..e70c3074 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/test_nova_api_proxy.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/test_nova_api_proxy.py @@ -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, diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/test_plugins.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/test_plugins.py index 14d92156..812f449d 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/test_plugins.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/test_plugins.py @@ -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" diff --git a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/utils/test_utils.py b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/utils/test_utils.py index f70a7aca..d84bffb7 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/utils/test_utils.py +++ b/python-k8sapp-openstack/k8sapp_openstack/k8sapp_openstack/tests/utils/test_utils.py @@ -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 diff --git a/python-k8sapp-openstack/k8sapp_openstack/tox.ini b/python-k8sapp-openstack/k8sapp_openstack/tox.ini index 706a7fb8..baa4ef6d 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/tox.ini +++ b/python-k8sapp-openstack/k8sapp_openstack/tox.ini @@ -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 diff --git a/python-k8sapp-openstack/k8sapp_openstack/upper-constraints.txt b/python-k8sapp-openstack/k8sapp_openstack/upper-constraints.txt index cfe58f3b..c8aa0e3c 100644 --- a/python-k8sapp-openstack/k8sapp_openstack/upper-constraints.txt +++ b/python-k8sapp-openstack/k8sapp_openstack/upper-constraints.txt @@ -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