Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-4019

A function to get bundle meta tags

    XMLWordPrintable

    Details

      Description

      There are functions for getting class and variable meta tags (getclassmetatags(), getvariablemetatags()}.

      It would be nice if we had a function to get bundle meta tags, e.g. getbundlemetatags() that worked in a similar way.

      Since bundle tags are really a special variable, it's possible to get this without a function today, but it would be nice to have a function that behaved like the others which also allowed for looking up the value of a specific tag.

      For example:

      bundle agent __main__
      {
            methods: "test";
      }
      bundle agent test
      {
        meta:
            "tags" slist => { "autorun", "myOtherTag", "contact=Nick Anderson <nick.anderson@northern.tech>" };
      
        reports:
            "From bundle '$(this.namespace):$(this.bundle)' in '$(this.promise_filename)'";
            "$(with)" with => join( ", ", "$(this.namespace):$(this.bundle)_meta.tags" );
      }
      
      R: From bundle 'default:test' in '/home/nickanderson/org/roam/CFEngine/notes/cfengine3-DCrHyR'
      R: autorun, myOtherTag, contact=Nick Anderson <nick.anderson@northern.tech>

      In the above example, if I used getbundlemetatags( "default:test" ) I would expect to get a list containing autorun, myOtherTag, contact=Nick Anderson <nick.anderson@northern.tech>. If I used getbundlemetatags("default:test", "contact") I would expect to get a list with a single element, Nick Anderson <nick.anderson@northern.tech>.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            a10042 Nick Anderson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: