Make templates env path be const variable

"../../common/templates/environments/" path seems to be redundant
in each drivers.
So it should be const variable.

Change-Id: I5cbd30e350c861b611b327a4dda3f92a6316e45b
Closes-Bug: #1616259
changes/97/359497/1
OTSUKA, Yuanying 6 years ago
parent 2cc25abe49
commit b4b32267c6
  1. 2
      magnum/drivers/common/template_def.py
  2. 4
      magnum/drivers/k8s_coreos_v1/template_def.py
  3. 8
      magnum/drivers/k8s_fedora_atomic_v1/template_def.py
  4. 4
      magnum/drivers/mesos_ubuntu_v1/template_def.py
  5. 4
      magnum/drivers/swarm_fedora_atomic_v1/template_def.py

@ -30,6 +30,8 @@ from requests import exceptions as req_exceptions
LOG = logging.getLogger(__name__)
COMMON_TEMPLATES_PATH = "../../common/templates/"
COMMON_ENV_PATH = COMMON_TEMPLATES_PATH + "environments/"
template_def_opts = [
cfg.StrOpt('etcd_discovery_service_endpoint_format',

@ -129,9 +129,9 @@ class CoreOSK8sTemplateDefinition(K8sTemplateDefinition):
def get_env_files(self, baymodel):
if baymodel.master_lb_enabled:
return ['../../common/templates/environments/with_master_lb.yaml']
return [template_def.COMMON_ENV_PATH + 'with_master_lb.yaml']
else:
return ['../../common/templates/environments/no_master_lb.yaml']
return [template_def.COMMON_ENV_PATH + 'no_master_lb.yaml']
@property
def template_path(self):

@ -188,16 +188,16 @@ class AtomicK8sTemplateDefinition(K8sTemplateDefinition):
env_files = []
if baymodel.master_lb_enabled:
env_files.append(
'../../common/templates/environments/with_master_lb.yaml')
template_def.COMMON_ENV_PATH + 'with_master_lb.yaml')
else:
env_files.append(
'../../common/templates/environments/no_master_lb.yaml')
template_def.COMMON_ENV_PATH + 'no_master_lb.yaml')
if baymodel.floating_ip_enabled:
env_files.append(
'../../common/templates/environments/enable_floating_ip.yaml')
template_def.COMMON_ENV_PATH + 'enable_floating_ip.yaml')
else:
env_files.append(
'../../common/templates/environments/disable_floating_ip.yaml')
template_def.COMMON_ENV_PATH + 'disable_floating_ip.yaml')
return env_files

@ -83,9 +83,9 @@ class UbuntuMesosTemplateDefinition(template_def.BaseTemplateDefinition):
def get_env_files(self, baymodel):
if baymodel.master_lb_enabled:
return ['../../common/templates/environments/with_master_lb.yaml']
return [template_def.COMMON_ENV_PATH + 'with_master_lb.yaml']
else:
return ['../../common/templates/environments/no_master_lb.yaml']
return [template_def.COMMON_ENV_PATH + 'no_master_lb.yaml']
@property
def template_path(self):

@ -112,9 +112,9 @@ class AtomicSwarmTemplateDefinition(template_def.BaseTemplateDefinition):
def get_env_files(self, baymodel):
if baymodel.master_lb_enabled:
return ['../../common/templates/environments/with_master_lb.yaml']
return [template_def.COMMON_ENV_PATH + 'with_master_lb.yaml']
else:
return ['../../common/templates/environments/no_master_lb.yaml']
return [template_def.COMMON_ENV_PATH + 'no_master_lb.yaml']
@property
def template_path(self):

Loading…
Cancel
Save