

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] \nFatal error: [master] Could not remove connector '%(name)s'. No such file '/etc/presto/catalog/%(name)s.properties'\n\nAborting.\n\nFatal error: [slave1] Could not remove connector '%(name)s'. No such file '/etc/presto/catalog/%(name)s.properties'\n\nAborting.\n\nFatal error: [slave2] Could not remove connector '%(name)s'. No such file '/etc/presto/catalog/%(name)s.properties'\n\nAborting.\n\nFatal error: [slave3] Could not remove connector '%(name)s'. No such file '/etc/presto/catalog/%(name)s.properties'\n\nAborting.\n"
    success_message = '[master] Connector removed. Restart the server for the change to take effect\n[slave1] Connector removed. Restart the server for the change to take effect\n[slave2] Connector removed. Restart the server for the change to take effect\n[slave3] Connector removed. Restart the server for the change to take effect'
    self.assertRaisesMessageIgnoringOrder(OSError, (missing_connector_message % {
        'name': 'jmx',
    }), self.run_prestoadmin, 'connector remove jmx')
    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)
    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