Don't run containers in interactive mode

Removes '-it' from arguments.

Change-Id: I8b3e3b1eda9c24c76e9d1f78af9c3d52c998e1b8
(cherry picked from commit e10261c96b)
This commit is contained in:
ramishra 2021-05-17 07:30:32 +05:30 committed by James Slagle
parent fea5819cc9
commit b90a7196b9
1 changed files with 10 additions and 10 deletions

View File

@ -468,22 +468,22 @@ class HeatPodLauncher(HeatContainerLauncher):
def heat_db_sync(self, restore_db=False): def heat_db_sync(self, restore_db=False):
if not self.database_exists(): if not self.database_exists():
subprocess.check_call([ subprocess.check_call([
'sudo', 'podman', 'exec', '-it', '-u', 'root', 'sudo', 'podman', 'exec', '-u', 'root',
'mysql', 'mysql', '-e', 'create database heat' 'mysql', 'mysql', '-e', 'create database heat'
]) ])
subprocess.check_call([ subprocess.check_call([
'sudo', 'podman', 'exec', '-it', '-u', 'root', 'sudo', 'podman', 'exec', '-u', 'root',
'mysql', 'mysql', '-e', 'mysql', 'mysql', '-e',
'create user if not exists ' 'create user if not exists '
'\'heat\'@\'%\' identified by \'heat\'' '\'heat\'@\'%\' identified by \'heat\''
]) ])
subprocess.check_call([ subprocess.check_call([
'sudo', 'podman', 'exec', '-it', '-u', 'root', 'sudo', 'podman', 'exec', '-u', 'root',
'mysql', 'mysql', 'heat', '-e', 'mysql', 'mysql', 'heat', '-e',
'grant all privileges on heat.* to \'heat\'@\'%\'' 'grant all privileges on heat.* to \'heat\'@\'%\''
]) ])
subprocess.check_call([ subprocess.check_call([
'sudo', 'podman', 'exec', '-it', '-u', 'root', 'sudo', 'podman', 'exec', '-u', 'root',
'mysql', 'mysql', '-e', 'flush privileges;' 'mysql', 'mysql', '-e', 'flush privileges;'
]) ])
cmd = [ cmd = [
@ -510,7 +510,7 @@ class HeatPodLauncher(HeatContainerLauncher):
db_dump_path = max(db_dumps, key=os.path.getmtime) db_dump_path = max(db_dumps, key=os.path.getmtime)
log.info("Restoring db from {}".format(db_dump_path)) log.info("Restoring db from {}".format(db_dump_path))
subprocess.run([ subprocess.run([
'sudo', 'podman', 'exec', '-i', '-u', 'root', 'sudo', 'podman', 'exec', '-u', 'root',
'mysql', 'mysql', 'heat'], stdin=open(db_dump_path), 'mysql', 'mysql', 'heat'], stdin=open(db_dump_path),
check=True) check=True)
@ -522,7 +522,7 @@ class HeatPodLauncher(HeatContainerLauncher):
"Remove it first." % db_dump_path) "Remove it first." % db_dump_path)
with open(db_dump_path, 'w') as out: with open(db_dump_path, 'w') as out:
subprocess.run([ subprocess.run([
'sudo', 'podman', 'exec', '-it', '-u', 'root', 'sudo', 'podman', 'exec', '-u', 'root',
'mysql', 'mysqldump', 'heat'], stdout=out, 'mysql', 'mysqldump', 'heat'], stdout=out,
check=True) check=True)
@ -532,11 +532,11 @@ class HeatPodLauncher(HeatContainerLauncher):
self.do_backup_db() self.do_backup_db()
try: try:
subprocess.check_call([ subprocess.check_call([
'sudo', 'podman', 'exec', '-it', '-u', 'root', 'sudo', 'podman', 'exec', '-u', 'root',
'mysql', 'mysql', 'heat', '-e', 'mysql', 'mysql', 'heat', '-e',
'drop database heat']) 'drop database heat'])
subprocess.check_call([ subprocess.check_call([
'sudo', 'podman', 'exec', '-it', '-u', 'root', 'sudo', 'podman', 'exec', '-u', 'root',
'mysql', 'mysql', '-e', 'mysql', 'mysql', '-e',
'drop user \'heat\'@\'%\'']) 'drop user \'heat\'@\'%\''])
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
@ -582,7 +582,7 @@ class HeatPodLauncher(HeatContainerLauncher):
def database_exists(self): def database_exists(self):
output = subprocess.check_output([ output = subprocess.check_output([
'sudo', 'podman', 'exec', '-it', '-u', 'root', 'mysql', 'sudo', 'podman', 'exec', '-u', 'root', 'mysql',
'mysql', '-e', 'show databases like "heat"' 'mysql', '-e', 'show databases like "heat"'
]) ])
return 'heat' in str(output) return 'heat' in str(output)
@ -637,7 +637,7 @@ class HeatPodLauncher(HeatContainerLauncher):
wait=wait_fixed(0.5)) wait=wait_fixed(0.5))
def wait_for_message_queue(self): def wait_for_message_queue(self):
output = subprocess.check_output([ output = subprocess.check_output([
'sudo', 'podman', 'exec', '-it', 'rabbitmq', 'sudo', 'podman', 'exec', 'rabbitmq',
'rabbitmqctl', 'list_queues' 'rabbitmqctl', 'list_queues'
]) ])
if 'heat' not in str(output): if 'heat' not in str(output):