Giuseppe Lavagetto has submitted this change and it was merged. Change subject: hiera: always search for the full key ......................................................................
hiera: always search for the full key At the moment, if a key is expanded, we search as follows: foo::bar::baz => $prefix/foo/bar.yaml key: baz while this mimicks the autoload structure of variables that puppet has, it is sometimes confusing as the role hierarchy doesn't do that; also, it's hard to grep in the source. The old lookup will be removed once the keys are fixed. Bug: T147403 Change-Id: Id79ea74b71b64b6a53e44ca923e508b0defaaf26 --- M modules/wmflib/lib/hiera/backend/nuyaml_backend.rb 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Giuseppe Lavagetto: Looks good to me, approved Alexandros Kosiaris: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/modules/wmflib/lib/hiera/backend/nuyaml_backend.rb b/modules/wmflib/lib/hiera/backend/nuyaml_backend.rb index 33ef086..791561a 100644 --- a/modules/wmflib/lib/hiera/backend/nuyaml_backend.rb +++ b/modules/wmflib/lib/hiera/backend/nuyaml_backend.rb @@ -171,6 +171,12 @@ else new_answer = plain_lookup(lookup_key, data, scope) end + + # Transitional: look up the full qualified key in expand_path + if new_answer.nil? && lookup_key != key + new_answer = plain_lookup(key, data, scope) + end + next if new_answer.nil? # Extra logging that we found the key. This can be outputted # multiple times if the resolution type is array or hash but that -- To view, visit https://gerrit.wikimedia.org/r/312206 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id79ea74b71b64b6a53e44ca923e508b0defaaf26 Gerrit-PatchSet: 8 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Giuseppe Lavagetto <glavage...@wikimedia.org> Gerrit-Reviewer: Alexandros Kosiaris <akosia...@wikimedia.org> Gerrit-Reviewer: BBlack <bbl...@wikimedia.org> Gerrit-Reviewer: Faidon Liambotis <fai...@wikimedia.org> Gerrit-Reviewer: Filippo Giunchedi <fgiunch...@wikimedia.org> Gerrit-Reviewer: Giuseppe Lavagetto <glavage...@wikimedia.org> Gerrit-Reviewer: Volans <rcocci...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits