4
4
import os
5
5
from pathlib import Path
6
6
import subprocess
7
- from osism import settings
7
+
8
8
from celery .signals import worker_process_init
9
9
from loguru import logger
10
10
from redis import Redis
11
11
from pottery import Redlock
12
12
13
+ from osism import settings
14
+
13
15
redis = None
14
16
15
17
@@ -104,16 +106,20 @@ def run_ansible_in_environment(
104
106
lock .acquire ()
105
107
106
108
if role == "mariadb_backup" :
109
+ command = f"/run.sh backup { role } { joined_arguments } "
110
+ logger .info (f"RUN { command } " )
107
111
p = subprocess .Popen (
108
- f"/run.sh backup { role } { joined_arguments } " ,
112
+ command ,
109
113
shell = True ,
110
114
stdout = subprocess .PIPE ,
111
115
stderr = subprocess .PIPE ,
112
116
env = env ,
113
117
)
114
118
else :
119
+ command = f"/run.sh deploy { role } { joined_arguments } "
120
+ logger .info (f"RUN { command } " )
115
121
p = subprocess .Popen (
116
- f"/run.sh deploy { role } { joined_arguments } " ,
122
+ command ,
117
123
shell = True ,
118
124
stdout = subprocess .PIPE ,
119
125
stderr = subprocess .PIPE ,
@@ -125,8 +131,10 @@ def run_ansible_in_environment(
125
131
if locking :
126
132
lock .acquire ()
127
133
134
+ command = f"/run.sh { role } { joined_arguments } "
135
+ logger .info (f"RUN { command } " )
128
136
p = subprocess .Popen (
129
- f"/run.sh { role } { joined_arguments } " ,
137
+ command ,
130
138
shell = True ,
131
139
stdout = subprocess .PIPE ,
132
140
stderr = subprocess .PIPE ,
@@ -139,8 +147,10 @@ def run_ansible_in_environment(
139
147
and environment == "manager"
140
148
and role == "bifrost-command"
141
149
):
150
+ command = f'/run-manager.sh bifrost-command "-e bifrost_arguments=\' { joined_arguments } \' " "-e bifrost_result_id={ request_id } "'
151
+ logger .info (f"RUN { command } " )
142
152
p = subprocess .Popen (
143
- f'/run-manager.sh bifrost- command "-e bifrost_arguments= \' { joined_arguments } \' " "-e bifrost_result_id= { request_id } "' ,
153
+ command ,
144
154
shell = True ,
145
155
stdout = subprocess .PIPE ,
146
156
stderr = subprocess .PIPE ,
@@ -151,8 +161,10 @@ def run_ansible_in_environment(
151
161
if locking :
152
162
lock .acquire ()
153
163
164
+ command = f"/run-{ environment } .sh { role } { joined_arguments } "
165
+ logger .info (f"RUN { command } " )
154
166
p = subprocess .Popen (
155
- f"/run- { environment } .sh { role } { joined_arguments } " ,
167
+ command ,
156
168
shell = True ,
157
169
stdout = subprocess .PIPE ,
158
170
stderr = subprocess .PIPE ,
@@ -163,8 +175,10 @@ def run_ansible_in_environment(
163
175
if locking :
164
176
lock .acquire ()
165
177
178
+ command = f"/run-{ environment } .sh { role } { joined_arguments } "
179
+ logger .info (f"RUN { command } " )
166
180
p = subprocess .Popen (
167
- f"/run- { environment } .sh { role } { joined_arguments } " ,
181
+ command ,
168
182
shell = True ,
169
183
stdout = subprocess .PIPE ,
170
184
stderr = subprocess .PIPE ,
0 commit comments