'Load the watchrule object.
The object can be loaded either from the DB by name or from an existing
DB object.'

@classmethod
def load(cls, context, watch_name=None, watch=None):

    if (watch is None):
        try:
            watch = watch_rule_objects.WatchRule.get_by_name(context, watch_name)
        except Exception as ex:
            LOG.warning('WatchRule.load    (%(watch_name)s)    db    error    %(ex)s', {'watch_name': watch_name, 'ex': ex})
    if (watch is None):
        raise exception.EntityNotFound(entity='Watch    Rule', name=watch_name)
    else:
        return cls(context=context, watch_name=watch.name, rule=watch.rule, stack_id=watch.stack_id, state=watch.state, wid=watch.id, watch_data=watch.watch_data, last_evaluated=watch.last_evaluated)
