from .xlate import XLATOR
-__version__ = '0.3.0'
+__version__ = '0.3.1'
LOG = logging.getLogger(__name__)
self, appname=None, verbose=0, version=__version__, base_dir=None,
config=None, terminal_has_colors=False, simulate=None, force=None, initialized=False):
+ if not isinstance(config, CrTplConfiguration):
+ msg = _("{w} is not an instance of {c}, but an instance of {i} instead.").format(
+ w='Parameter config', c='CrTplConfiguration', i=config.__class__.__name__)
+ raise HandlerError(msg)
+
self.host = CrTplConfiguration.default_cobbler_host
self.ssh_port = CrTplConfiguration.default_cobbler_ssh_port
self.ssh_user = CrTplConfiguration.default_cobbler_ssh_user
self.ssh = None
self.ssh_timeout = CrTplConfiguration.default_cobbler_ssh_timeout
self.root_dir = CrTplConfiguration.default_cobbler_rootdir
+ self.config = config
super(Cobbler, self).__init__(
appname=appname, verbose=verbose, version=version, base_dir=base_dir,
self.private_ssh_key = str(self.base_dir.joinpath('keys', CrTplConfiguration.ssh_privkey))
- if config:
- self.private_ssh_key = config.private_ssh_key
- self.host = config.cobbler_host
- self.ssh_port = config.cobbler_ssh_port
- self.ssh_user = config.cobbler_ssh_user
- self.ssh_timeout = config.cobbler_ssh_timeout
- self.root_dir = config.cobbler_rootdir
+ self.private_ssh_key = config.private_ssh_key
+ self.host = config.cobbler_host
+ self.ssh_port = config.cobbler_ssh_port
+ self.ssh_user = config.cobbler_ssh_user
+ self.ssh_timeout = config.cobbler_ssh_timeout
+ self.root_dir = config.cobbler_rootdir
if initialized:
self.initialized = True