def _ensure_systemd(version):
    '''
    Raises an exception if the systemd version is not greater than the
    passed version.
    '''
    try:
        version = int(version)
    except ValueError:
        raise CommandExecutionError('Invalid version \'{0}\''.format(version))

    try:
        installed = _sd_version()
        log.debug('nspawn: detected systemd {0}'.format(installed))
    except (__HOLE__, ValueError):
        raise CommandExecutionError('nspawn: Unable to get systemd version')

    if installed < version:
        raise CommandExecutionError(
            'This function requires systemd >= {0} '
            '(Detected version: {1}).'.format(version, installed)
        )
dataset/ETHPy150Open saltstack/salt/salt/modules/nspawn.py/_ensure_systemd