Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

peadm::status plan fails #110

Closed
vchepkov opened this issue Aug 4, 2020 · 2 comments
Closed

peadm::status plan fails #110

vchepkov opened this issue Aug 4, 2020 · 2 comments

Comments

@vchepkov
Copy link
Contributor

vchepkov commented Aug 4, 2020

peadm::status plan fails in PE2019.8.0

$ bolt plan run peadm::status -t puppet.chepkov.lan
Starting: plan peadm::status
Starting: task peadm::infrastatus on puppet.chepkov.lan
Finished: task peadm::infrastatus with 0 failures in 10.5 sec
Finished: plan peadm::status in 10.51 sec
{
  "kind": "bolt/pal-error",
  "msg": "Evaluation Error: Operator '[]' is not applicable to an Undef Value. (file: /Bolt/modules/peadm/plans/status.pp, line: 20, column: 13)",
  "details": {
    "file": "/Bolt/modules/peadm/plans/status.pp",
    "line": 20,
    "column": 13
  }
}

After examining the line in question, I found that if I replace this code

$data = $item[result][output]

with

$data = $item[value][output]

plan works as expected

$ bolt plan run peadm::status -t puppet.chepkov.lan
Starting: plan peadm::status
Starting: task peadm::infrastatus on puppet.chepkov.lan
Finished: task peadm::infrastatus with 0 failures in 10.5 sec
+---------------------------------------+--------------------------------------+
|                         Overall Status: operational                          |
+---------------------------------------+--------------------------------------+
| Stack                                 | Status                               |
+---------------------------------------+--------------------------------------+
| puppet.chepkov.lan                    | operational                          |
+---------------------------------------+--------------------------------------+
Finished: plan peadm::status in 10.61 sec
Plan completed successfully with no result
@vchepkov vchepkov added the bug label Aug 4, 2020
@vchepkov
Copy link
Contributor Author

vchepkov commented Aug 4, 2020

cc: @logicminds

@logicminds
Copy link
Contributor

Yes this was changed in recent bolt version. I'll have to find a better way that works with both versions of bolt.

logicminds added a commit to nwops/puppetlabs-peadm that referenced this issue Aug 4, 2020
  * previously when getting data after a task is run, we fetched
    the result data.  However, a newer version of bolt changed
    the key name to value and broke this code.  This fixes that
    by fetching the newer key name and failing back to the old
    key name if the value does not exist.
@reidmv reidmv closed this as completed in 47b94c5 Aug 4, 2020
reidmv added a commit that referenced this issue Aug 4, 2020
Fix #110 - peadm::status plan fails with new bolt version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants