Remove "constants" module.

Module is being used only by ansible integration module
that is going to be replaced at some time in the
near future.

Change-Id: I19f7e35bc9e182e764927d75856106240b8bba15
This commit is contained in:
Federico Ressi 2019-04-12 11:17:35 +02:00
parent c261ef1ae5
commit a394b218d6
2 changed files with 8 additions and 34 deletions

View File

@ -1,30 +0,0 @@
# Copyright 2018 Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from __future__ import absolute_import
from tobiko import config
CONF = config.CONF
TEMPLATE_SUFFIX = ".yaml"
DEFAULT_PARAMS = {
# Nova
'image': CONF.tobiko.nova.image,
'flavor': CONF.tobiko.nova.flavor,
# Neutron
'public_net': CONF.tobiko.neutron.floating_network,
}

View File

@ -22,11 +22,15 @@ from ansible.parsing.dataloader import DataLoader
from ansible.vars.manager import VariableManager
from oslo_log import log
from tobiko.common import constants
from tobiko import config
from tobiko.openstack import keystone
LOG = log.getLogger(__name__)
CONF = config.CONF
TEMPLATE_SUFFIX = ".yaml"
class AnsibleManager(object):
@ -49,7 +53,7 @@ class AnsibleManager(object):
playbooks.extend(files)
if strip_suffix:
playbooks = [
f[:-len(constants.TEMPLATE_SUFFIX)] for f in playbooks]
f[:-len(TEMPLATE_SUFFIX)] for f in playbooks]
return playbooks
def get_options(self):
@ -78,8 +82,8 @@ class AnsibleManager(object):
'username': credentials.username,
'project_name': credentials.project_name,
'password': credentials.project_name.password,
'image': constants.DEFAULT_PARAMS['image'],
'flavor': constants.DEFAULT_PARAMS['flavor']}
'image': CONF.tobiko.nova.image,
'flavor': CONF.tobiko.nova.flavor}
self.variable_manager.extra_vars = extra_vars