Skip to content
This repository was archived by the owner on Jul 21, 2023. It is now read-only.

Commit e40f6f2

Browse files
authored
Merge pull request #63 from fdupont-redhat/bz_1809033_v1.x
Write the state file early (v1.x)
2 parents ffc096d + 6561b23 commit e40f6f2

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

wrapper/common.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ def hard_error(msg):
7979
"""
8080
logging.error(msg)
8181
sys.stderr.write(msg)
82+
state = State.instance()
83+
if state is not None and state.state_file is not None:
84+
state['last_message'] = {
85+
'message': msg,
86+
'type': 'error'
87+
}
88+
state.write()
8289
sys.exit(1)
8390

8491

wrapper/virt_v2v_wrapper.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ def main():
407407
throttling_file = os.path.join(STATE_DIR,
408408
'v2v-import-%s.throttle' % log_tag)
409409
state['internal']['throttling_file'] = throttling_file
410+
state.write()
410411

411412
log_format = '%(asctime)s:%(levelname)s:' \
412413
+ ' %(message)s (%(module)s:%(lineno)d)'

0 commit comments

Comments
 (0)