aruhier / virt-backup

Backup your kvm guests managed by libvirt
Other
106 stars 23 forks source link

virt-backup fails while parsing config #13

Closed nicolinux closed 6 years ago

nicolinux commented 6 years ago

Hi,

I like to test virt-backup but so far I haven't been able to get it to run. Here is my config:

debug: True
uri: "qemu:///system"
username:
passphrase:
default:
  daily: 4
  weekly: 2
  monthly: 5
  yearly: 1
groups:
  test:
    target: /mnt/usb/kvm/_backup
    compression: None
    autostart: False
    hourly: 1
    daily: 3
    weekly: 2
    monthly: 5
    yearly: 1
    hosts:
      - host: win7

Here is the error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/virt_backup/groups/pending.py", line 102, in add_domain
    existing_bak = next(self.search(dom))
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/virt-backup", line 9, in <module>
    load_entry_point('virt-backup==0.1.4', 'console_scripts', 'virt-backup')()
  File "/usr/local/lib/python3.5/dist-packages/virt_backup/__main__.py", line 88, in parse_args
    args.func(parsed_args=args)
  File "/usr/local/lib/python3.5/dist-packages/virt_backup/__main__.py", line 101, in start_backups
    groups = build_all_or_selected_groups(config, conn, parsed_args.groups)
  File "/usr/local/lib/python3.5/dist-packages/virt_backup/__main__.py", line 272, in build_all_or_selected_groups
    groups = [g for g in groups_from_dict(config["groups"], conn)
  File "/usr/local/lib/python3.5/dist-packages/virt_backup/__main__.py", line 272, in <listcomp>
    groups = [g for g in groups_from_dict(config["groups"], conn)
  File "/usr/local/lib/python3.5/dist-packages/virt_backup/groups/pending.py", line 53, in groups_from_dict
    yield build(group_name, group_properties)
  File "/usr/local/lib/python3.5/dist-packages/virt_backup/groups/pending.py", line 48, in build
    backup_group.add_domain(domain, matches.get("disks", ()))
  File "/usr/local/lib/python3.5/dist-packages/virt_backup/groups/pending.py", line 107, in add_domain
    dom=dom, dev_disks=disks, **self.default_bak_param
TypeError: __init__() got an unexpected keyword argument 'hourly'

I just started it with virt-backup backup.

Thanks.

aruhier commented 6 years ago

Hi, Thanks a lot for the bug report, I am looking at it right now!

aruhier commented 6 years ago

It should be fixed in the last release.

However, I introduced a small regression in term of code readability, by adding some unused attributes (related to retention) into the BackupGroup. It is completely fixed in the last commit. I will not draft a new release for this, as it should not impact in any way the user.

Thanks again for the bug report, as this tool does not seem to be used much, I highly appreciate!