def test_connector_remove(self):
        self.setup_cluster(NoHadoopBareImageProvider(),
                           self.STANDALONE_PRESTO_CLUSTER)
        for host in self.cluster.all_hosts():
            self.assert_has_default_connector(host)

        missing_connector_message = """[Errno 1] 
Fatal error: [master] Could not remove connector '%(name)s'. No such file \
'/etc/presto/catalog/%(name)s.properties'

Aborting.

Fatal error: [slave1] Could not remove connector '%(name)s'. No such file \
'/etc/presto/catalog/%(name)s.properties'

Aborting.

Fatal error: [slave2] Could not remove connector '%(name)s'. No such file \
'/etc/presto/catalog/%(name)s.properties'

Aborting.

Fatal error: [slave3] Could not remove connector '%(name)s'. No such file \
'/etc/presto/catalog/%(name)s.properties'

Aborting.
"""  # noqa

        success_message = """[master] Connector removed. Restart the server \
for the change to take effect
[slave1] Connector removed. Restart the server for the change to take effect
[slave2] Connector removed. Restart the server for the change to take effect
[slave3] Connector removed. Restart the server for the change to take effect"""

        # test remove connector does not exist
        # expect error

        self.assertRaisesMessageIgnoringOrder(
            OSError,
            missing_connector_message % {'name': 'jmx'},
            self.run_prestoadmin,
            'connector remove jmx')

        # test remove connector not in directory, but in presto
        self.cluster.exec_cmd_on_host(
            self.cluster.master,
            'rm /etc/opt/prestoadmin/connectors/tpch.properties'
        )

        output = self.run_prestoadmin('connector remove tpch')
        self.assertEqualIgnoringOrder(success_message, output)

        # test remove connector in directory but not in presto
        self.cluster.write_content_to_host(
            'connector.name=tpch',
            os.path.join(constants.CONNECTORS_DIR, 'tpch.properties'),
            self.cluster.master
        )

        self.assertRaisesMessageIgnoringOrder(
            OSError,
            missing_connector_message % {'name': 'tpch'},
            self.run_prestoadmin,
            'connector remove tpch')
dataset/ETHPy150Open prestodb/presto-admin/tests/product/test_connectors.py/TestConnectors.test_connector_remove/original