def version_cmp(pkg1, pkg2):
    try:
        # pylint: disable=no-member
        if distutils.version.LooseVersion(pkg1) < \
                distutils.version.LooseVersion(pkg2):
            return -1
        elif distutils.version.LooseVersion(pkg1) == \
                distutils.version.LooseVersion(pkg2):
            return 0
        elif distutils.version.LooseVersion(pkg1) > \
                distutils.version.LooseVersion(pkg2):
            return 1
    except Exception as exc:
        log.exception(exc)
    return None
Compares two version strings using distutils.version.LooseVersion. This is
dataset/ETHPy150Open saltstack/salt/salt/utils/__init__.py/version_cmp