(self, federation, new_federation)
return federation.obj_what_changed()
Update only the patches that were modified and return the diff.
Update only the patches that were modified and return the diff.
Update only the patches that were modified and return the diff .
def _update_changed_fields(self, federation, new_federation):
        """Update only the patches that were modified and return the diff."""
        for field in objects.Federation.fields:
            try:
                patch_val = getattr(new_federation, field)
            except AttributeError:
                # Ignore fields that aren't exposed in the API
                continue
            if patch_val == wtypes.Unset:
                patch_val = None
            if federation[field] != patch_val:
                federation[field] = patch_val

        return federation.obj_what_changed()
def _update_changed_fields ( self , federation , new_federation ) : for field in objects . Federation . fields : try : patch_val = getattr ( new_federation , field ) except AttributeError : # Ignore fields that aren't exposed in the API continue if patch_val == wtypes . Unset : patch_val = None if federation [ field ] != patch_val : federation [ field ] = patch_val return federation . obj_what_changed ( )