Skip to content

optional data incorrectly parsed by function or task file_or_content #67

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

Closed
abuxton opened this issue Mar 4, 2020 · 2 comments
Closed

Comments

@abuxton
Copy link
Contributor

abuxton commented Mar 4, 2020

Describe the Bug

https://github.com/puppetlabs/puppetlabs-peadm/blob/master/functions/file_or_content.pp
the variables are strongly typed as String, yet the input is Optional

both license and r10k value are opotional but last code refactor includes chanegs that expect the values to be set! this is undesirable in usage while demonstrating the module and or in mono builds as the supporting infrastructure is not always available these were previously captured in if statments!

https://github.com/puppetlabs/puppetlabs-peadm/blob/master/plans/action/install.pp#L106
https://github.com/puppetlabs/puppetlabs-peadm/blob/master/plans/action/install.pp#L109
https://github.com/puppetlabs/puppetlabs-peadm/blob/master/plans/action/install.pp#L133

Expected Behavior

it should work without optional data

Steps to Reproduce

Steps to reproduce the behavior:
run the task with out values for license or r10k key

Environment

Additional Context

2 possible fixes
update the function to allow undef Optional[String]
update the plan to re introduce if case statement

@abuxton abuxton added the bug label Mar 4, 2020
@bwilcox
Copy link
Contributor

bwilcox commented Mar 4, 2020

#66

Here's a fix...

@reidmv
Copy link
Contributor

reidmv commented Mar 9, 2020

Merged #66

@reidmv reidmv closed this as completed Mar 9, 2020
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

3 participants