'Checks for restricted actions.
Raises ResourceActionRestricted, if the resource requires update
or replace and the required action is restricted.
Else, Raises UpdateReplace, if replacement is required or returns
True, if in-place update is required.'

def _check_restricted_actions(self, actions, after, before, after_props, before_props, prev_resource):

    try:
        if self.preview_update(after, before, after_props, before_props, prev_resource, check_init_complete=True):
            if ('update' in actions):
                raise exception.ResourceActionRestricted(action='update')
            return True
    except UpdateReplace:
        if ('replace' in actions):
            raise exception.ResourceActionRestricted(action='replace')
        raise
