Skip to content

Comments

(#22474) Update forge/repository.rb to conditionally include zlib#1886

Merged
adrienthebo merged 1 commit intopuppetlabs:stablefrom
haus:ticket/stable/22474_conditionally_require_zlib
Sep 11, 2013
Merged

(#22474) Update forge/repository.rb to conditionally include zlib#1886
adrienthebo merged 1 commit intopuppetlabs:stablefrom
haus:ticket/stable/22474_conditionally_require_zlib

Conversation

@haus
Copy link
Contributor

@haus haus commented Sep 10, 2013

Previously using the --no-zlib flag or using puppet on a ruby without zlib
support would result in a load error and stacktrace, because
lib/puppet/forge/repository.rb requires zlib and uses a constant defined by
Zlib. This commit updates repository.rb to only require zlib and use its
constant if the zlib feature is available and the --no-zlib flag was not passed
(zlib is enabled by default in defaults.rb).
With this commit running puppet on a ruby without zlib does not throw a
stacktrace or other error related to zlib.

Previously using the --no-zlib flag or using puppet on a ruby without zlib
support would result in a load error and stacktrace, because
lib/puppet/forge/repository.rb requires zlib and uses a constant defined by
Zlib. This commit updates repository.rb to only require zlib and use its
constant if the zlib feature is available and the --no-zlib flag was not passed
(zlib is enabled by default in defaults.rb).
With this commit running puppet on a ruby without zlib does not throw a
stacktrace or other error related to zlib.
@haus
Copy link
Contributor Author

haus commented Sep 10, 2013

Note: I tried making a test for this, but it is very hard to test at the spec level because the spec_helper has a require on puppet, which loads zlib.
An acceptance test is even harder, because it would require having a ruby at our disposal that was compiled without zlib support.

If there is a way of testing this that I am missing, I am all ears.

@puppetcla
Copy link

CLA signed by all contributors.

adrienthebo added a commit that referenced this pull request Sep 11, 2013
…require_zlib

(#22474) Update forge/repository.rb to conditionally include zlib
@adrienthebo adrienthebo merged commit 1188879 into puppetlabs:stable Sep 11, 2013
@adrienthebo
Copy link
Contributor

summary: merged into stable in 1188879; this should be released in 3.3.1.

@haus haus deleted the ticket/stable/22474_conditionally_require_zlib branch May 23, 2016 17:17
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

Successfully merging this pull request may close these issues.

3 participants