puppetlabs / puppetlabs-apt

Puppet module to help manage Apt
https://forge.puppetlabs.com/puppetlabs/apt
Apache License 2.0
215 stars 462 forks source link

Deal with net-ftp being unavailable #1050

Closed ekohl closed 1 year ago

ekohl commented 1 year ago

In Ruby 3.0 net-ftp changed from a bundled gem to a default gem. This means it may not be available, such as when running unit tests.

Since ftp is becoming less and less common, this changes net-ftp to be an optional dependency. Users who do need ftp support should ensure the gem is installed.

chelnak commented 1 year ago

@ekohl Thank you 👍

joshcooper commented 1 year ago

The require 'net/ftp' gem should really be moved into the source_to_file method to properly handle this. Some context, if you're not using puppet generate types, then puppetserver will load types and providers and call the type's title_patterns method. Agent-side code like require 'net/ftp' needs to be guarded so it's only invoked on the agent, and not during compilation.

chelnak commented 1 year ago

Thanks @joshcooper .. I'll raise this with the team.