def rpm_upgrade(rpm_name):
    _LOGGER.info("Upgrading the rpm")
    nodeps = ''
    if env.nodeps:
        nodeps = '--nodeps '

    package_path = os.path.join(constants.REMOTE_PACKAGES_PATH, rpm_name)
    package_name = sudo('rpm -qp --queryformat \'%%{NAME}\' %s'
                        % package_path, quiet=True)

    ret_uninstall = sudo((nodeps, package_name) % 'rpm -e %s%s')
    ret_install = sudo('rpm -i %s%s' % (nodeps, package_path))
    if ret_uninstall.succeeded and ret_install.succeeded:
        print("Package upgraded successfully on: " + env.host)
dataset/ETHPy150Open prestodb/presto-admin/prestoadmin/package.py/rpm_upgrade/swapped operands of `%`