def METHOD_NAME(pkg_name):
    """
    Query package version info and return "version-release" string, or empty
    string if the query fails.
    """
    # Using slow "rpm -qa" since on CentOS 7 "rpm -q" always succeeds and
    # writes "package python2 is not installed" to stdout, while "rpm -qa"
    # returns empty string if the package is not installed.
    out = commands.run(
        ["rpm", "-qa", "--queryformat", "%{VERSION}-%{RELEASE}", pkg_name])
    return out.decode("utf-8")