Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

Support or don't support strings #2

Open
jaxxstorm opened this issue Mar 24, 2016 · 2 comments
Open

Support or don't support strings #2

jaxxstorm opened this issue Mar 24, 2016 · 2 comments

Comments

@jaxxstorm
Copy link
Owner

Currently, you can't specify a string for a fact value, like so:

::facter_tags::value { 'puppet':
    values => 'infra',
  }

The workaround is to always make values an array or a hash, but it would be nice to be able to specify a single tag and have it evaluated accordingly.

We should always return valid JSON, even if it's just a string based. An alternative is to disallow strings as a valid type for values

@jaxxstorm jaxxstorm changed the title Support strings Support or don't support strings Mar 24, 2016
@jaxxstorm
Copy link
Owner Author

So the problem here is twofold,

We can't just have a single string in JSON, it's not valid 😢

There's a nice function in stdlib, but it's only Puppet 4 compatible 😢

https://github.com/puppetlabs/puppetlabs-stdlib#is_a

@jaxxstorm
Copy link
Owner Author

Additional note, can't use validate_hash or validate_array because it could be an array or a hash.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant