Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
goldmann committed Jul 13, 2017
2 parents 9a073ce + d44f36a commit 35de2a2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
30 changes: 15 additions & 15 deletions dogen/plugins/cct.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,28 @@ def prepare(self, cfg):

os.makedirs(target_modules_dir)

cfg_file = os.path.join(cct_dir, "cct.yaml")
with open(cfg_file, 'w') as f:
yaml.dump(cfg['cct'], f)

local_modules_dir = os.path.join(os.path.dirname(self.descriptor), 'cct')
self.log.debug('Found existing modules in directory: %s' % local_modules_dir)

# setup cct to same logging level as dogen
cct_logger = logging.getLogger("cct")
cct_logger.setLevel(self.log.getEffectiveLevel())

cct_cfg.dogen = True
cct = CCT_CLI()
cct.process_changes([cfg_file], local_modules_dir, self.output)
cfg['sources'] += cct_cfg.artifacts
self.log.info("CCT plugin reported artifacts to dogen")

if os.path.exists(local_modules_dir):
for module in os.listdir(local_modules_dir):
module_path = os.path.join(local_modules_dir, module)
self.log.info("Using cached module '%s' from path '%s'" % (module, module_path))
shutil.copytree(module_path, os.path.join(target_modules_dir, module))

cfg_file = os.path.join(cct_dir, "cct.yaml")
with open(cfg_file, 'w') as f:
yaml.dump(cfg['cct'], f)

# copy cct modules from
modules_dir = os.path.join(os.path.dirname(self.descriptor), 'cct', 'modules')
if os.path.exists(modules_dir):
Expand All @@ -112,16 +122,6 @@ def prepare(self, cfg):
shutil.copytree(os.path.join(modules_dir, module), target_module)
self.log.info("Copied module %s to %s" % (module, target_module))

# setup cct to same logging level as dogen
cct_logger = logging.getLogger("cct")
cct_logger.setLevel(self.log.getEffectiveLevel())

cct_cfg.dogen = True
cct = CCT_CLI()
cct.process_changes([cfg_file], target_modules_dir, self.output)
cfg['sources'] += cct_cfg.artifacts
self.log.info("CCT plugin reported artifacts to dogen")

if 'cct_runtime' in cfg:
cfg['entrypoint'] = ['/usr/bin/cct']
self.runtime_changes(cfg)
Expand Down
2 changes: 1 addition & 1 deletion dogen/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "2.2.1"
version = "2.3.0"

0 comments on commit 35de2a2

Please sign in to comment.