from .xlate import XLATOR
-from .base_moduleinfo import BaseModuleInfoError, BaseModuleInfo
+from .errors import BaseModuleInfoError
+from .base_moduleinfo import BaseModuleInfo
-__version__ = '0.2.0'
+__version__ = '0.2.1'
LOG = logging.getLogger(__name__)
self._exclude_spec = False
self._install_path = None
- super(ModuleInfo, self).__init__(
+ super(PuppetfileModuleInfo, self).__init__(
appname=appname, verbose=verbose, version=version, base_dir=base_dir,
initialized=False, name=name, vendor=vendor, full_name=full_name
)
return self._ref
@ref.setter
- def def ref(self, value):
+ def ref(self, value):
if value is None:
self._ref = None
return
@rtype: dict
"""
- res = super(ModuleInfo, self).as_dict(short=short)
+ res = super(PuppetfileModuleInfo, self).as_dict(short=short)
res['default_branch'] = self.default_branch
res['exclude_spec'] = self.exclude_spec
def to_data(self):
"""Returning a dict, which can be used to re-instantiate this module info."""
- res = super(ModuleInfo, self).to_data()
+ res = super(PuppetfileModuleInfo, self).to_data()
res['default_branch'] = self.default_branch
res['exclude_spec'] = self.exclude_spec
module_info.repo_type = 'svn'
if 'local' in definitions:
- if definitions['local']
+ val_local = definitions['local']
+ if to_bool(val_local):
+ module_info.repo_type = 'local'
+ else:
+ msg = _(
+ "PuppetfileModuleInfo for {m!r} has tag :local, but this not set to {t!r},"
+ " but {v!r} instead.").format(
+ m=module_info.full_name, t='true', v=val_local)
+ LOG.warn(msg)
if 'source' in definitions:
module_info.repo = definitions['source']
module_info.ref = branch
if 'commit' in definitions:
- module_info.ref = definitions['commit'}
+ module_info.ref = definitions['commit']
if 'version' in definitions:
module_info.ref = definitions['version']