-
Notifications
You must be signed in to change notification settings - Fork 47
Closed
Description
calling the cpan provider on a module that has a non-standard or missing version in cpan will error.
Two examples I found were Log::Dispatch::Gelf (version is "v1.3.0", including that leading "v") and "Graph::Directed" (no version is defined).
Current behavior is an error like this:
Error: Could not set 'latest' on ensure: undefined method `[]' for nil:NilClass at 37:/etc/puppet/environments/...
Error: Could not set 'latest' on ensure: undefined method `[]' for nil:NilClass at 37:/etc/puppet/environments/...
Wrapped exception:
undefined method `[]' for nil:NilClass
Error: /Stage[main]/Tbb/Cpan[Log::Dispatch::Gelf]/ensure: change from present to latest failed: Could not set 'latest' on ensure: undefined method `[]' for nil:NilClass at 37:/etc/puppet/environments/...
Error: Could not set 'latest' on ensure: undefined method `[]' for nil:NilClass at 37:/etc/puppet/environments/...
Error: Could not set 'latest' on ensure: undefined method `[]' for nil:NilClass at 37:/etc/puppet/environments/...
Wrapped exception:
undefined method `[]' for nil:NilClass
Error: /Stage[main]/Tbb/Cpan[Graph::Directed]/ensure: change from present to latest failed: Could not set 'latest' on ensure: undefined method `[]' for nil:NilClass at 37:/etc/puppet/environments/...
It seems that a cleaner option would be to either print a notice (something like "could not upgrade: CPAN version could not be determined"), or to silently fail to upgrade.
Also, I think better parsing of the cpan version might help (stripping initial [a-zA-Z]*, or successfully matching a versionless installed module to an undefined version of cpan), and would eliminate the errors in both of these examples.
Metadata
Metadata
Assignees
Labels
No labels