Introduced v1 LCM logic
This logic will handle ini-file based approach Change-Id: Ifc892d595cffd0bcef5eca30a82013fa3346a8a2
This commit is contained in:
parent
82efc7e153
commit
159301b4fc
|
@ -27,20 +27,9 @@ from nailgun.logger import logger
|
|||
|
||||
class OpenStackConfigPipeline(BasePipeline):
|
||||
# TODO(dukov) add cluster remove callback
|
||||
|
||||
@classmethod
|
||||
def process_deployment_for_node(cls, node, node_data):
|
||||
"""Updating deployment info
|
||||
|
||||
Genereate OpenStack configuration hash based on configuration files
|
||||
stored in git repository associated with a particular environment
|
||||
"""
|
||||
logger.info("Started serialisation for node {}".format(node.id))
|
||||
repo = GitRepo.get_by_cluster_id(node.cluster_id)
|
||||
if not repo:
|
||||
return node_data
|
||||
|
||||
GitRepo.checkout(repo)
|
||||
repo_path = os.path.join(const.REPOS_DIR, repo.repo_name)
|
||||
def lcm_v1(cls, node, node_data, repo_path):
|
||||
resource_mapping = ExternalGit.ext_settings['resource_mapping']
|
||||
exts_list = utils.get_file_exts_list(resource_mapping)
|
||||
|
||||
|
@ -87,9 +76,26 @@ class OpenStackConfigPipeline(BasePipeline):
|
|||
|
||||
utils.deep_merge(common,
|
||||
override_configs['nodes'].get(uid, {}))
|
||||
|
||||
node_data['configuration'] = common
|
||||
logger.debug("Node {0} config from git {1}".format(uid, common))
|
||||
return {'configuration': common}
|
||||
|
||||
@classmethod
|
||||
def process_deployment_for_node(cls, node, node_data):
|
||||
"""Updating deployment info
|
||||
|
||||
Genereate OpenStack configuration hash based on configuration files
|
||||
stored in git repository associated with a particular environment
|
||||
"""
|
||||
logger.info("Started serialisation for node {}".format(node.id))
|
||||
repo = GitRepo.get_by_cluster_id(node.cluster_id)
|
||||
if not repo:
|
||||
return node_data
|
||||
|
||||
GitRepo.checkout(repo)
|
||||
repo_path = os.path.join(const.REPOS_DIR, repo.repo_name)
|
||||
|
||||
data = cls.lcm_v1(node, node_data, repo_path)
|
||||
utils.deep_merge(node_data, data)
|
||||
logger.info("Finished serialisation for node {}".format(node.id))
|
||||
return node_data
|
||||
|
||||
|
|
Loading…
Reference in New Issue