@staticmethod
    def assert_installed(testcase, container=None, msg=None, cluster=None):
        # cluster keyword arg supports configurable cluster, which needs to
        # assert that presto isn't installed before testcase.cluster is set.
        if not cluster:
            cluster = testcase.cluster

        # container keyword arg supports test_package_install and a few other
        # places where we need to check specific members of a cluster.
        if not container:
            container = cluster.get_master()

        try:
            check_rpm = cluster.exec_cmd_on_host(
                container, (PACKAGE_NAME,) % 'rpm -q %s')
            testcase.assertRegexpMatches(
                check_rpm, RPM_BASENAME + '\n', msg=msg
            )
        except OSError as e:
            if isinstance(testcase.cluster, DockerCluster):
                cluster.client.commit(cluster.master, 'db_error_master')
                cluster.client.commit(cluster.slaves[0], 'db_error_slave0')
                cluster.client.commit(cluster.slaves[1], 'db_error_slave1')
                cluster.client.commit(cluster.slaves[2], 'db_error_slave2')
            if msg:
                error_message = e.strerror + '\n' + msg
            else:
                error_message = e.strerror
            testcase.fail(msg=error_message)
dataset/ETHPy150Open prestodb/presto-admin/tests/product/standalone/presto_installer.py/StandalonePrestoInstaller.assert_installed/swapped operands of `%`