mirror of
https://github.com/ansible/awx.git
synced 2026-03-19 18:07:33 -02:30
Bring the check_callback call out of the loop
We shouldn't need to call it multiple times.
This commit is contained in:
@@ -188,17 +188,18 @@ class IsolatedManager(object):
|
|||||||
self.private_data_dir,
|
self.private_data_dir,
|
||||||
extravars=extravars)
|
extravars=extravars)
|
||||||
status, rc = runner_obj.status, runner_obj.rc
|
status, rc = runner_obj.status, runner_obj.rc
|
||||||
if self.check_callback is not None:
|
|
||||||
config_path = self.path_to('artifacts', self.ident, 'config')
|
|
||||||
# If the configuration artifact has been synced back, update the model
|
|
||||||
if os.path.exists(config_path):
|
|
||||||
with open(config_path, 'r') as f:
|
|
||||||
data = json.load(f)
|
|
||||||
self.check_callback(data)
|
|
||||||
self.consume_events(dispatcher)
|
self.consume_events(dispatcher)
|
||||||
|
|
||||||
last_check = time.time()
|
last_check = time.time()
|
||||||
|
|
||||||
|
if self.check_callback is not None:
|
||||||
|
config_path = self.path_to('artifacts', self.ident, 'config')
|
||||||
|
# If the configuration artifact has been synced back, update the model
|
||||||
|
if os.path.exists(config_path):
|
||||||
|
with open(config_path, 'r') as f:
|
||||||
|
data = json.load(f)
|
||||||
|
self.check_callback(data)
|
||||||
|
|
||||||
if status == 'successful':
|
if status == 'successful':
|
||||||
status_path = self.path_to('artifacts', self.ident, 'status')
|
status_path = self.path_to('artifacts', self.ident, 'status')
|
||||||
rc_path = self.path_to('artifacts', self.ident, 'rc')
|
rc_path = self.path_to('artifacts', self.ident, 'rc')
|
||||||
|
|||||||
Reference in New Issue
Block a user