def run_prestoadmin_expect(self, command, expect_statements):
        temp_script = '/opt/prestoadmin/tmp.expect'
        script_content = '#!/usr/bin/expect\n' + \
                         'spawn /opt/prestoadmin/presto-admin %s\n%s' % \
                         (command, expect_statements)

        self.cluster.write_content_to_host(script_content, temp_script,
                                           self.cluster.master)
        self.cluster.exec_cmd_on_host(
            self.cluster.master, 'chmod +x %s' % temp_script)
        return self.cluster.exec_cmd_on_host(
            self.cluster.master, temp_script)
dataset/ETHPy150Open prestodb/presto-admin/tests/product/base_product_case.py/BaseProductTestCase.run_prestoadmin_expect/original