Closed aequitas closed 6 years ago
Sorry for the late reply. Interesting, I'll try and reproduce next chance I get.
Thanks for making the patch!
No problem. I must admit I'm not using this module atm and probably won't in the future as afaik it can not be combined with lang, and I prefer to go for lang instead of YAML, so that will be a slow and painful rewrite of my current puppet code. If you have any solutions for this in mind let me know :)
So I've taken a look at the translations and I think your idea is great! Unfortunately, the patch does not seem to work. The reject
block cannot just chain the unwanted cases like this. Could you please
master
andchange the code to something like this? (Tested this successfully)
+ [ :name,
+ # ignore relational metaparameters, those are handled through the actual
+ # edges in the RAL graph
+ :before, :require, :notify, :subscribe, ].include? attr
I verified that the relationship edge does indeed survive this treatment:
$ puppet mgmtgraph print --code 'host { "a": before => Host["b"] } host { "b": }'
---
graph: localhost
...
- name: Host[a] -> Host[b]
from:
kind: exec
name: Host:a
to:
kind: exec
name: Host:b
...
Oh and as for mgmt lang (which needs a proper name, geez) vs. translated code, that has indeed been on my mind. Collected thoughts so far: https://ffrank.github.io/hacks/2018/02/13/thinking-about-migration-from-puppet-to-mgmt/
Any feedback is greatly appreciated (you can open an issue here for example).
Sorry ruby is not really my strong point :). I'll update the PR tomorrow.
@ffrank updated, also added a test.
I think the language is referred to as mcl, but maybe it needs a more proper name indeed :)
Love it! Special thanks for the test!
The
before
metaparam causes the generation of an invalid command (on my system at least):I have not tested this yet for unwanted side effects.