puppetlabs / puppetlabs/puppetlabs-bash_task_helper

helper calls exit with string value

Open
#26 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Ruby
Stars
1
Forks
11
Avg merge
10h 40m
Merged PRs (30d)
5

Description

When using task helper helper the following way:

task-fail 'failed' $RETVAL

Observing the following error in output

  "_error" : {
    "msg" : "Exited 2:\n/opt/puppetlabs/pxp-agent/spool/560/temp_task_74cc-580c-a185-d303/bash_task_helper/files/task_helper.sh: line 266: exit: warning:: numeric argument required\n",
    "kind" : "puppetlabs.tasks/task-error",

This is due to helper using quotes around exit code
https://github.com/puppetlabs/puppetlabs-bash_task_helper/blob/main/files/task_helper.sh#L266
https://github.com/puppetlabs/puppetlabs-bash_task_helper/blob/main/files/task_helper.sh#L66

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with files/task_helper.sh at lines 66 and 266, then reproduce the issue with task-fail 'failed' $RETVAL. Done means the helper no longer reports a numeric-argument error when the command is run and the resulting task error output reflects the requested failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash
Domain
cli
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.