from .xlate import XLATOR
-__version__ = '0.4.5'
+__version__ = '0.4.6'
LOG = logging.getLogger(__name__)
def ensure_snippets(self):
local_snippets_dir = self.base_dir / 'snippets'
+ self.ensure_remote_directory(self.config.snippets_dir)
+
+ for local_snippet in local_snippets_dir.glob('*'):
+ remote_snippet = self.config.snippets_dir / local_snippet.name
+ self.ensure_remote_file(local_snippet, remote_snippet, check_parent=False)
# -------------------------------------------------------------------------
def add_system(self, name, fqdn, mac_address, comment=None):
ks_meta_list = []
ks_meta_list.append("ROOT_PWD_HASH={}".format(self.config.get_root_pwd_hash()))
ks_meta_list.append("SWAP_SIZE_MB={}".format(self.config.swap_size_mb))
+ ks_meta_list.append("SYSTEM_STATUS={}".format(status))
ks_meta = None
if ks_meta_list:
args.append('--ksmeta')
args.append(ks_meta)
+ cmd_str = 'cobbler ' + ' '.join(map(lambda x: pipes.quote(x), args))
+ LOG.debug("Should execute: {}".format(cmd_str))
if self.verbose > 1:
LOG.debug(_("Cobbler arguments for creating a new system:") + "\n" + pp(args))
from .xlate import XLATOR
-__version__ = '1.5.5'
+__version__ = '1.5.6'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
ks_base = 'template-' + self.os_id + '-' + self.system_status + '.ks'
return self.cobbler_ks_dir / ks_base
+ # -------------------------------------------------------------------------
+ @property
+ def snippets_dir(self):
+ """The path to the snippets dirctory, depending of the system status."""
+ return self.cobbler_rootdir / 'snippets' / 'per_status' / self.system_status
+
# -------------------------------------------------------------------------
def as_dict(self, short=True):
"""
res['data_size'] = self.data_size
res['ram_gb'] = self.ram_gb
res['system_ks'] = self.system_ks
+ res['snippets_dir'] = self.snippets_dir
res['root_password'] = None
if self.root_password:
from .xlate import XLATOR
-__version__ = '1.5.7'
+__version__ = '1.5.8'
LOG = logging.getLogger(__name__)
TZ = pytz.timezone('Europe/Berlin')
self.check_for_cobbler_distro()
self.cobbler.ensure_profile()
self.cobbler.ensure_root_authkeys()
+ self.cobbler.ensure_system_ks()
+ self.cobbler.ensure_snippets()
self.vsphere.get_about()
self.vsphere.get_clusters()