RFR: Support yaml metadata for actions and rules

* Add: Yaml support for actions and rules meta. Both yaml and yml extensions
are supported.
* Add: yaml, yml and json meta for sample action in fixtures for testing.
Does that mean we would have to change log format in logging.conf?
On Nov 7, 2014 9:40 AM, "Tomaz Muraus" <notifications@github.com> wrote:

> In st2common/st2common/content/loader.py:
>
> > +        :rtype: ``dict``
> > +        """
> > +        file_name, file_ext = os.path.splitext(file_path)
> > +
> > +        if file_ext not in ALLOWED_EXTS:
> > +            raise Exception('Unsupported meta type %s, file %s. Allowed: %s' %
> > +                            (file_ext, file_path, ALLOWED_EXTS))
> > +
> > +        return self._load(PARSER_FUNCS[file_ext], file_path)
> > +
> > +    def _load(self, parser_func, file_path):
> > +        with open(file_path, 'r') as fd:
> > +            try:
> > +                return parser_func(fd)
> > +            except ValueError:
> > +                LOG.exception('Failed loading content from %s.', file_path)
>
> @manasdk <https://github.com/manasdk> Yeah, in any case, I think we
> should move towards using extra.
>
> It's a documented way of doing it and we get additional context
> (dictionary key) which we don't get in this case since it's using
> positional args. We could use keyword args, but I like extra approach
> more.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/StackStorm/st2/pull/781/files#r19999394>.
>