Pending changes can cause keyerror
wdoekes opened this issue · comments
Apparently @vilitux ran into this:
File "/usr/local/bin/proxmove", line 464, in from_dict
vm.get_config() # get config and check for pending changes at once
File "/usr/local/bin/proxmove", line 495, in get_config
dict_['key'], dict_['value'], dict_['pending']))
KeyError: 'value'
We expect both value and pending to be set, but apparently that's not always the case (updates in smbios?):
pending = []
for dict_ in pending_config:
keys = dict_.keys()
if keys == set(['key', 'value']):
assert next_config.get(dict_['key']) == dict_['value']
else:
pending.append('{!r}({!r}=>{!r})'.format(
dict_['key'], dict_['value'], dict_['pending']))
if pending:
# Contains 'pending' changes. Refuse to continue.
raise ProxmoxVm.Error(
'VM {!r} contains pending changes: {}'.format(
self.name, ', '.join(pending)))