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 2016-08-24 10:00:40 +09:00
parent 2cc25abe49
commit b4b32267c6
5 changed files with 12 additions and 10 deletions

View File

@ -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',

View File

@ -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):

View File

@ -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

View File

@ -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):

View File

@ -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):