Closed PeteToscano closed 1 year ago
/me sighs.
Did I submit this to the wrong repo? Should it be here or under autopkg/grahampugh-recipes
instead?
Here is correct! Thanks. I'll take a look when I get a chance.
Thanks, Graham. No big deal if you'd rather decline this PR, and there is no rush.
Hi @PeteToscano just to let you know I do want to implement this, just I don't like the script_is_template
key name. I think skip_script_key_substitution
is probably what I'll go for :-) I'll try and get to it soon.
Thanks for the feedback, Graham. I've updated the patch to reflect the new name and changed the default value so that not defining skip_script_key_substitution
will still result in the usual behavior. I was able to test it in normal use (not set, set to False, and set to True), but not in an override, if that makes any difference.
Perfect, thanks for making the change. Merged it in this repo now, I'll do some load testing before it goes into grahampugh-recipes.
FYI, working a treat when the key is set to True either in the Input
array (so will work in overrides) or directly in the Processor arguments. 👍 I was able to remove the workaround I had made in the one script I have where this mattered :)
Good deal. Happy I can contribute back in some small way. Thanks again for writing and maintaining the Jamf processors for autopkg (not to mention the YAML support).
This flag indicates if the script being uploaded is or isn't a template. If the flag is set to
False
, it'll skip thesubstitute_assignable_keys(script_contents)
call. This can be useful for scripts that have strings bracketed by % symbols. For example, thisdate
command in a bash script:date +"%Y-%m-%d %H:%M:%S%z"
. Without this flag, JamfScriptUploader.py throws anautopkglib.ProcessorError
exception saying, "Unsubstitutable key in template found: 'S'." This small example can be worked around, but in larger or more pathological cases, it might be simpler to bypass the variable-replacement entirely.The
script_is_template
flag is not required, and the default value isTrue
. This should ensure that the default behavior of JamfScriptUploader.py doesn't change with this PR applied. (Or at least it shouldn't.)(Side note: I'm new to creating GH PRs, so apologies if the formatting is messed up somehow.)