Example #1
0
 def _check_attribute_synced(self, vm, attrib):
     """Compare an attribute value in Serveradmin with the actual value on
     the hypervisor
     """
     synced_values = self.vm_sync_from_hypervisor(vm)
     if attrib not in synced_values:
         log.warning('Cannot validate attribute "{}"!'.format(attrib))
         return
     current_value = synced_values[attrib]
     if current_value != vm.dataset_obj[attrib]:
         raise InconsistentAttributeError(vm, attrib, current_value)
Example #2
0
def _check_attributes(vm):
    synced_attributes = vm.hypervisor.vm_sync_from_hypervisor(vm)
    for attr, value in synced_attributes.items():
        if vm.dataset_obj[attr] != value:
            raise InconsistentAttributeError(vm, attr, value)