from .module_list import ModuleInfoDict
+from .puppetfile import Puppetfile
+
from .xlate import __module_dir__ as __xlate_module_dir__
from .xlate import __base_dir__ as __xlate_base_dir__
from .xlate import __mo_file__ as __xlate_mo_file__
root_log.addHandler(lh_console)
+ if self.verbose < 3:
+ paramiko_logger = logging.getLogger('paramiko.transport')
+ charsetprober_logger = logging.getLogger('chardet.charsetprober')
+ charsetprober_logger.setLevel(logging.INFO)
+ if self.verbose < 1:
+ paramiko_logger.setLevel(logging.WARNING)
+ else:
+ paramiko_logger.setLevel(logging.INFO)
+
return
# -------------------------------------------------------------------------
return
+ # -------------------------------------------------------------------------
+ def read_puppetfile(self, env):
+
+ LOG.info(_("Reading Puppetfile of environment {!r} ...").format(env))
+
+ pfile = Puppetfile(
+ env_root_dir=self.puppet_root_env_dir, environment=env,
+ appname=self.appname, verbose=self.verbose, base_dir=self.base_dir,
+ initialized=True)
+
+ if self.verbose > 1:
+ LOG.debug("Got Puppetfile:\n{}".format(pp(pfile.as_dict())))
+
+ pfile_modules = None
+ try:
+ pfile_modules = pfile.read_modules()
+ except PuppetfileError as e:
+ LOG.warn(str(e))
+ else:
+ if self.verbose > 2:
+ LOG.debug("Successful read {!r}.".format(pfile.filename))
+ if pfile_modules:
+ for module_info in pfile_modules.values():
+ self.env_modules[env].append(module_info)
+
# -------------------------------------------------------------------------
def read_cache_file(self, only_main_branches=True):
for env in self.environments:
LOG.debug("Evaluating environment {!r} ..".format(env))
- self.read_puppetfile(env)
+ pfile_modules = self.read_puppetfile(env)
+ if pfile_modules:
+ for module_info in pfile_modules.values():
+ self.env_modules[env].append(module_info)
self.read_metadata_files(env)
if self.verbose > 2:
LOG.debug("ModuleInfoDict:\n{}".format(pp(self.env_modules[env].as_dict())))
return ModuleInfo.init_from_json(
json_data, env, appname=self.appname, verbose=self.verbose, base_dir=self.base_dir)
- # -------------------------------------------------------------------------
- def read_puppetfile(self, env):
-
- LOG.info(_("Reading Puppetfile of environment {!r} ...").format(env))
-
- pfile = Puppetfile(
- env_root_dir=self.puppet_root_env_dir, environment=env,
- appname=self.appname, verbose=self.verbose, base_dir=self.base_dir,
- initialized=True)
-
- if self.verbose > 1:
- LOG.debug("Got Puppetfile:\n{}".format(pp(pfile.as_dict())))
-
- pfile_modules = None
- try:
- pfile_modules = pfile.read_modules()
- except PuppetfileError as e:
- LOG.warn(str(e))
- else:
- if self.verbose > 2:
- LOG.debug("Successful read {!r}.".format(pfile.filename))
- if pfile_modules:
- for module_info in pfile_modules.values():
- self.env_modules[env].append(module_info)
-
# -------------------------------------------------------------------------
def init_puppet_environments(self):