diff --git a/qubes/backup.py b/qubes/backup.py index 03a2cfcc..a3b4f7aa 100644 --- a/qubes/backup.py +++ b/qubes/backup.py @@ -819,7 +819,8 @@ class Backup(object): # Save date of last backup, only when backup succeeded for qid, vm_info in files_to_backup.items(): if vm_info.vm: - vm_info.vm.backup_timestamp = datetime.datetime.now() + vm_info.vm.backup_timestamp = \ + int(datetime.datetime.now().strftime('%s')) self.app.save() diff --git a/qubes/tests/vm/qubesvm.py b/qubes/tests/vm/qubesvm.py index e8637aad..14e4b933 100644 --- a/qubes/tests/vm/qubesvm.py +++ b/qubes/tests/vm/qubesvm.py @@ -513,12 +513,12 @@ class TC_90_QubesVM(QubesVMTestsMixin, qubes.tests.QubesTestCase): timestamp = datetime.datetime(2016, 1, 1, 12, 14, 2) timestamp_str = timestamp.strftime('%s') self.assertPropertyDefaultValue(vm, 'backup_timestamp', None) - self.assertPropertyValue(vm, 'backup_timestamp', timestamp, - timestamp, timestamp_str) + self.assertPropertyValue(vm, 'backup_timestamp', int(timestamp_str), + int(timestamp_str), timestamp_str) del vm.backup_timestamp self.assertPropertyDefaultValue(vm, 'backup_timestamp', None) self.assertPropertyValue(vm, 'backup_timestamp', timestamp_str, - timestamp) + int(timestamp_str)) def test_401_backup_timestamp_invalid(self): vm = self.get_vm() diff --git a/qubes/vm/qubesvm.py b/qubes/vm/qubesvm.py index 6450b90d..f846a4d8 100644 --- a/qubes/vm/qubesvm.py +++ b/qubes/vm/qubesvm.py @@ -476,13 +476,9 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM): type=bool, setter=qubes.property.bool, doc='If this domain is to be included in default backup.') - # format got changed from %s to str(datetime.datetime) backup_timestamp = qubes.property('backup_timestamp', default=None, - setter=(lambda self, prop, value: - value if isinstance(value, datetime.datetime) else - datetime.datetime.fromtimestamp(int(value))), - saver=(lambda self, prop, value: value.strftime('%s')), - doc='FIXME') + type=int, + doc='Time of last backup of the qube, in seconds since unix epoch') default_dispvm = qubes.VMProperty('default_dispvm', load_stage=4,