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

Base provisioner refactoring #298

Merged
merged 11 commits into from
Dec 20, 2013
Merged

Base provisioner refactoring #298

merged 11 commits into from
Dec 20, 2013

Conversation

fnichol
Copy link
Contributor

@fnichol fnichol commented Dec 20, 2013

This is largely an internal refactoring of the Provisioner API, internal and external (which is not yet considered stable). There are several high level changes:

  • #calculate_path method is extracted to Kitchen::Provisioner::Base
  • A modified #create_sandbox & #cleanup_sandbox are extracted to Kitchen::Provisioner::Base. Now #create_sandbox can be better chained with super calls and no longer returns the sandbox path. A new method #sandbox_path must be used instead in Driver code.
  • A new class method expand_path_for is added to Kitchen::Provisioner::Base so that Provisioner authors can direct local path and file config values to be path expanded. This greatly helps with debugging and diagnostics.
  • Applied new common base functionality in Kitchen::Provisioner::Base back into the newly merged Kitchen::Provisioner::Shell provisioner, thanks to @ChrisLundquist.

This work should lead directly to a refactoring of
`Kitchen::Provisioner::Base` with logic from
`Kitchen::Provisioner::ChefBase`.
This commit changes the behavior of `Provisioner#create_sandbox` in that
it no longer returns the created sandbox path. Now the expected calling
behavior is to call `Provisioner#create_sandbox` and then refer to the
sandbox path with `Provisioner#sandbox_path`. This allows
`#create_sandbox` to make use of calls to super in a clean way and to
decouple the command and query nature of this method.
This is a declarative way, similar to declaring default_config, to have
certain config values be path expanded. This helps when debugging using
`kitchen diganose` and leaves local paths unambiguous as to the source
location.

In general, all local config-related paths and files should be path
expanded.
fnichol added a commit that referenced this pull request Dec 20, 2013
@fnichol fnichol merged commit 6647d67 into master Dec 20, 2013
@fnichol fnichol deleted the base-provisioner-refactoring branch December 20, 2013 06:10
BrentOnRails pushed a commit to BrentOnRails/test-kitchen that referenced this pull request Jul 17, 2017
Don't try to set tags if there aren't any.
@test-kitchen test-kitchen locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant