Puppet Plan language error in 2023.5: ```$pscript...
# bolt
j
Puppet Plan language error in 2023.5:
Copy code
$pscript_targets = get_targets($prevalidate_results.ok_set.targets).filter |$n| { $n.facts['patch_script']['pre'] != '' }
Are we no longer allowed to use [] after the n.facts ...
Copy code
{
  "msg": "Evaluation Error: Operator '[]' is not applicable to an Undef Value. (file: /opt/puppetlabs/server/data/orchestration-services/code/environments/.../plans/patch_group.pp, line: 38, column: 87)",
  "kind": "bolt/pal-error",
  "details": {
    "file": "/opt/puppetlabs/server/data/orchestration-services/code/environments/.../plans/patch_group.pp",
    "line": 38,
    "column": 87
  }
}
This is the error message I am getting when I run the plan... This worked fine back in 2019.7... Did something change that would cause this?
b
you don't have a patch_script fact, so you cannot acces the sub element pre
and that never worked
so the fact probably exists on your 2019 but not on your 2023
or your whole facts element is empty
j
I can see the facts there.. by two means... 1) Right before I run a task that checks to ensure the fact is there using puppet facter -p patch_script.pre on the node itself...2) I see the fact on the WebUI in Puppet PE... Do I just need to "re-get" the facts or something simple like that?
b
I think there's a facts plan that you need to run
at least on bolt. I'm not sure if it's different on PE
j
I'll give it a shot... thank you
That did the trick... Thank You
b
\o/