Skip to content
This repository has been archived by the owner on Feb 9, 2022. It is now read-only.

Commit

Permalink
Merge pull request #57 from oVirt/BZFixes
Browse files Browse the repository at this point in the history
Bz fixes
  • Loading branch information
maorlipchuk authored Jul 19, 2018
2 parents 2f1446b + a88f412 commit 3c48ff7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
10 changes: 8 additions & 2 deletions files/ovirt-dr
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,35 @@ def main(argv):
sys.exit(2)

create_log_dir(log_file)
if log_file is not None and log_file != '':
print("Log file: '%s'" % log_file)
_print_log_file_name(log_file)
if action == 'validate':
validator.ValidateMappingFile().run(conf_file)
elif action == 'generate':
generate_vars.GenerateMappingFile().run(conf_file,
log_file,
logg.getLevelName(log_level))
_print_log_file_name(log_file)
elif action == 'failover':
fail_over.FailOver().run(conf_file,
log_file,
logg.getLevelName(log_level))
_print_log_file_name(log_file)
elif action == 'failback':
fail_back.FailBack().run(conf_file,
log_file,
logg.getLevelName(log_level))
_print_log_file_name(log_file)
elif action == '--help':
help_log()
else:
print "\tError: action '%s' is not defined" % action
help_log()


def _print_log_file_name(log_file):
if log_file is not None and log_file != '':
print("Log file: '%s'" % log_file)

def _init_vars(argv):
conf_file = DEF_CONF_FILE
log_file = ''
Expand Down
4 changes: 2 additions & 2 deletions tasks/recover/add_nfs_domain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
nfs:
path: "{{ nfs_storage['dr_' + dr_target_host + '_path'] }}"
address: "{{ nfs_storage['dr_' + dr_target_host + '_address'] }}"
- name: Log append to failed storage domains
- name: Log append to successful storage domains
set_fact:
succeed_storage_domains: "{{ succeed_storage_domains }} + [ \"{{ nfs_storage['dr_' + dr_target_host + '_name'] }}\" ]"

rescue:
- name: Log append to failed_storage_domains
- name: Log append to failed storage domains
set_fact:
failed_storage_domains: "{{ failed_storage_domains }} + [ \"{{ nfs_storage['dr_' + dr_target_host + '_name'] }}\" ]"
ignore_errors: "{{ dr_ignore_error_recover }}"
Expand Down
3 changes: 2 additions & 1 deletion tasks/recover/print_info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
shell: cat /tmp/{{ dr_report_file }}
register: content

- debug: msg="{{ content.stdout_lines | quote }}"
- name: Pring report file to stdout
debug: msg="{{ content.stdout_lines | quote }}"
tags:
- fail_over
- fail_back
Expand Down
2 changes: 1 addition & 1 deletion tasks/recover/register_vm.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- block:
- name: register VMs
- name: Register VMs
ovirt_vms:
state: registered
storage_domain: "{{ storage.name }}"
Expand Down

0 comments on commit 3c48ff7

Please sign in to comment.