From e10261c96b168a3bb0be62f97b54685f44225be0 Mon Sep 17 00:00:00 2001 From: ramishra Date: Mon, 17 May 2021 07:30:32 +0530 Subject: [PATCH] Don't run containers in interactive mode Removes '-it' from arguments. Change-Id: I8b3e3b1eda9c24c76e9d1f78af9c3d52c998e1b8 --- tripleoclient/heat_launcher.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tripleoclient/heat_launcher.py b/tripleoclient/heat_launcher.py index 5fc5db054..bf3e655a3 100644 --- a/tripleoclient/heat_launcher.py +++ b/tripleoclient/heat_launcher.py @@ -468,22 +468,22 @@ class HeatPodLauncher(HeatContainerLauncher): def heat_db_sync(self, restore_db=False): if not self.database_exists(): subprocess.check_call([ - 'sudo', 'podman', 'exec', '-it', '-u', 'root', + 'sudo', 'podman', 'exec', '-u', 'root', 'mysql', 'mysql', '-e', 'create database heat' ]) subprocess.check_call([ - 'sudo', 'podman', 'exec', '-it', '-u', 'root', + 'sudo', 'podman', 'exec', '-u', 'root', 'mysql', 'mysql', '-e', 'create user if not exists ' '\'heat\'@\'%\' identified by \'heat\'' ]) subprocess.check_call([ - 'sudo', 'podman', 'exec', '-it', '-u', 'root', + 'sudo', 'podman', 'exec', '-u', 'root', 'mysql', 'mysql', 'heat', '-e', 'grant all privileges on heat.* to \'heat\'@\'%\'' ]) subprocess.check_call([ - 'sudo', 'podman', 'exec', '-it', '-u', 'root', + 'sudo', 'podman', 'exec', '-u', 'root', 'mysql', 'mysql', '-e', 'flush privileges;' ]) cmd = [ @@ -510,7 +510,7 @@ class HeatPodLauncher(HeatContainerLauncher): db_dump_path = max(db_dumps, key=os.path.getmtime) log.info("Restoring db from {}".format(db_dump_path)) subprocess.run([ - 'sudo', 'podman', 'exec', '-i', '-u', 'root', + 'sudo', 'podman', 'exec', '-u', 'root', 'mysql', 'mysql', 'heat'], stdin=open(db_dump_path), check=True) @@ -522,7 +522,7 @@ class HeatPodLauncher(HeatContainerLauncher): "Remove it first." % db_dump_path) with open(db_dump_path, 'w') as out: subprocess.run([ - 'sudo', 'podman', 'exec', '-it', '-u', 'root', + 'sudo', 'podman', 'exec', '-u', 'root', 'mysql', 'mysqldump', 'heat'], stdout=out, check=True) @@ -532,11 +532,11 @@ class HeatPodLauncher(HeatContainerLauncher): self.do_backup_db() try: subprocess.check_call([ - 'sudo', 'podman', 'exec', '-it', '-u', 'root', + 'sudo', 'podman', 'exec', '-u', 'root', 'mysql', 'mysql', 'heat', '-e', 'drop database heat']) subprocess.check_call([ - 'sudo', 'podman', 'exec', '-it', '-u', 'root', + 'sudo', 'podman', 'exec', '-u', 'root', 'mysql', 'mysql', '-e', 'drop user \'heat\'@\'%\'']) except subprocess.CalledProcessError: @@ -582,7 +582,7 @@ class HeatPodLauncher(HeatContainerLauncher): def database_exists(self): output = subprocess.check_output([ - 'sudo', 'podman', 'exec', '-it', '-u', 'root', 'mysql', + 'sudo', 'podman', 'exec', '-u', 'root', 'mysql', 'mysql', '-e', 'show databases like "heat"' ]) return 'heat' in str(output) @@ -637,7 +637,7 @@ class HeatPodLauncher(HeatContainerLauncher): wait=wait_fixed(0.5)) def wait_for_message_queue(self): output = subprocess.check_output([ - 'sudo', 'podman', 'exec', '-it', 'rabbitmq', + 'sudo', 'podman', 'exec', 'rabbitmq', 'rabbitmqctl', 'list_queues' ]) if 'heat' not in str(output):