Skip to content
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

Maint/master/refactor ssl file #1252

Merged

Conversation

joshcooper
Copy link
Contributor

No description provided.

Prior to this commit, the code for creating a model and loading it from
a file was duplicated in two places. Also, the
`renaming_files_with_uppercase` method was being called after the
existence checks, complicating the logic.

This commit moves the duplicate code to a single method. It also moves
the `renaming...` method earlier, so that we get into a sane state as
soon as possible.

Finally, it adds a deprecation warning for some crazy behavior in the
`rename_files_in_uppercase`. The `search` method may return an uppercase
name, since it just walks the directory. But if `find` is called on the
uppercase name, then the file gets lowercases, so that subsequent calls
to `search` return the lowercased name. See #17307.
Previously, this would fail:

    rspec --order random:786 spec/unit/indirector/ssl_file_spec.rb

because several of the examples set global state on the
Puppet::Indirector::SslFile class.

This commit adds an after each block to clean up.
Previously, the test was calling into the settings subsystem, which had
the undesirable effect of loading facter, and that generated errors
(though they weren't fatal) due to the expectation on FileTest
interferring with Facter's operatingsystem fact on debian6, at least.

  Could not retrieve operatingsystem: unexpected invocation:
  FileTest.exists?('/etc/debian_version')

This commit changes the test so that we don't calling into the settings
code.
zaphod42 added a commit that referenced this pull request Nov 1, 2012
@zaphod42 zaphod42 merged commit 386293f into puppetlabs:master Nov 1, 2012
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.

None yet

2 participants