Skip to content

Issue with the "cpan_module" when requesting a specific version of a CPAN module #48

Description

@mromero-convoso

🗣️ Foreword

When I use the cpan_module resource requesting a specific version of a package, the first convergence run succeeds, but on subsequent runs, an error is thrown. An example resource block that would trigger this issue on an example run:

cpan_module 'Cpanel::JSON::XS' do
  version '==3.23.900'
end

👻 Brief Description

FATAL: NameError: cpan_module[Cpanel::JSON::XS] (vmasterConvoso::perl line 46) had an error: NameError: execute[CPAN :install Cpanel::JSON::XS] (/tmp/kitchen/cache/cookbooks/perl/resources/cpan_module.rb line 10) had an error: NameError: undefined method `==3.23.900' for class `Gem::Version'

🥞 Cookbook version

Version of the cookbook where you are encountering the issue.

7.1.2

👩‍🍳 Chef-Infra Version

Version of chef-client in your environment.

17.6.18

🎩 Platform details

Ubuntu 20.04 LTS

Steps To Reproduce

Steps to reproduce the behavior:

Use the "cpan_module" resource with a specific hard-coded version of a package.

🚓 Expected behavior

The resource should not attempt to reinstall the package again if the package is already installed, and the resource should not fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions