Example #1
0
def isConfigured():
    confTag = _getConfTag()
    if os.path.exists(ISCSID_CONF):
        tagline = misc.readfileSUDO(ISCSID_CONF)[0]
        if confTag in tagline:
            return True

    return False
Example #2
0
def isConfigured():
    confTag = _getConfTag()
    if os.path.exists(ISCSID_CONF):
        tagline = misc.readfileSUDO(ISCSID_CONF)[0]
        if confTag in tagline:
            return True

    return False
Example #3
0
def isEnabled():
    """
    Check the multipath daemon configuration. The configuration file
    /etc/multipath.conf should contain private tag in form
    "RHEV REVISION X.Y" for this check to succeed.
    If the tag above is followed by tag "RHEV PRIVATE" the configuration
    should be preserved at all cost.

    """
    if os.path.exists(MPATH_CONF):
        first = second = ''
        mpathconf = misc.readfileSUDO(MPATH_CONF)
        try:
            first = mpathconf[0]
            second = mpathconf[1]
        except IndexError:
            pass
        if MPATH_CONF_PRIVATE_TAG in second:
            log.info("Manual override for multipath.conf detected - "
                     "preserving current configuration")
            if MPATH_CONF_TAG not in first:
                log.warning(
                    "This manual override for multipath.conf was based "
                    "on downrevved template. You are strongly advised to "
                    "contact your support representatives")
            return True

        if MPATH_CONF_TAG in first:
            log.debug(
                "Current revision of multipath.conf detected, preserving")
            return True

        for tag in OLD_TAGS:
            if tag in first:
                log.info("Downrev multipath.conf detected, upgrade required")
                return False

    log.debug("multipath Defaulting to False")
    return False
Example #4
0
def isEnabled():
    """
    Check the multipath daemon configuration. The configuration file
    /etc/multipath.conf should contain private tag in form
    "RHEV REVISION X.Y" for this check to succeed.
    If the tag above is followed by tag "RHEV PRIVATE" the configuration
    should be preserved at all cost.

    """
    if os.path.exists(MPATH_CONF):
        first = second = ''
        mpathconf = misc.readfileSUDO(MPATH_CONF)
        try:
            first = mpathconf[0]
            second = mpathconf[1]
        except IndexError:
            pass
        if MPATH_CONF_PRIVATE_TAG in second:
            log.info("Manual override for multipath.conf detected - "
                "preserving current configuration")
            if MPATH_CONF_TAG not in first:
                log.warning("This manual override for multipath.conf was based "
                    "on downrevved template. You are strongly advised to "
                    "contact your support representatives")
            return True

        if MPATH_CONF_TAG in first:
            log.debug("Current revision of multipath.conf detected, preserving")
            return True

        for tag in OLD_TAGS:
            if tag in first:
                log.info("Downrev multipath.conf detected, upgrade required")
                return False

    log.debug("multipath Defaulting to False")
    return False