from .xlate import XLATOR
-__version__ = '0.5.12'
+__version__ = '0.6.1'
LOG = logging.getLogger(__name__)
profile = self.config.cobbler_profile
os_id = self.config.os_id
- LOG.info(_("Creating new sytem {!r} ...").format(name))
+ LOG.info(_("Creating new system {!r} ...").format(name))
if not comment:
comment = "VMWare template for creating a {} system.".format(os_id)
self.sync()
+ # -------------------------------------------------------------------------
+ def remove_system(self, name):
+ """Removing the given system."""
+
+ LOG.info(_("Removing system {!r} ...").format(name))
+
+ args = ['system', 'remove']
+ args.append('--name')
+ args.append(name)
+
+ proc = self.exec_cobbler(args)
+
+ if proc.returncode:
+ err = _('No error message')
+ if proc.stderr:
+ err = proc.stderr
+ elif proc.stdout:
+ err = proc.stdout
+ msg = _("Error removing the cobbler system {n!r} - returncode was {rc}: {err}").format(
+ n=name, rc=proc.returncode, err=err)
+ raise ExpectedCobblerError(msg)
+
+ self.sync()
+
# -------------------------------------------------------------------------
def sync(self):
"""Executing 'cobbler sync' to apply environment, especially DHCPD configuration."""
from .xlate import XLATOR
-__version__ = '1.7.2'
+__version__ = '1.7.3'
LOG = logging.getLogger(__name__)
TZ = pytz.timezone('Europe/Berlin')
return 10
else:
self.poweroff_vm()
-# self.change_mac_address()
+
+ self.cobbler.remove_system(tpl_sysname)
return 0