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
Make solo tarballs work on windows; fixes #1515 #1751
Conversation
Adds proper path seperator support to the tarball path, and converts the legacy call to tar via run_command to the Windows-tastic ShellOut. Adds convenience functions for ShellOut helpers being called directly, a-la run_command. Tests are incomplete, since getting the system to behave as if it was on windows means mocking out significant path functionality for dubious results.
This code needs to be manually tested on windows, because writing unit tests quickly turns into a festival of mockitudes. |
@@ -72,6 +72,14 @@ def self.platform_path_separator | |||
end | |||
end | |||
|
|||
def self.platform_path_separator_escaped |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@btm, should this use one of the new helpers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not here specifically, since this just returns special characters as a separator. But the changes in lib/chef/application/solo.rb
could probably use Chef::Util::PathHelper.validate_path.
Also, we're not using Chef::Config.platform_path_separator in other classes yet, we probably shouldn't start. Consider putting this in Chef::Util::PathHelper with a replacement for platform_path_separator that we could use to replace the multiple places in the code that we do ::File::ALT_SEPARATOR ? ::File::ALT_SEPARATOR : ::File::SEPARATOR
currently. Dan also mentioned lib/chef/platform/query_helpers.rb
as a potential place to consider for this new method.
Is there currently anything that is preventing this PR from being merged? |
@adamhjk if you could address dan's and btm's comments and rebase that'd be cool. I believe we also picked up the tarball stuff into chef-client -z recently as well, so it probably needs to get fixed in two places now. |
If this hasn't been fixed and still needs fixing, we should probably fix it |
Let's get this done ourselves. |
Adds Guard support to Chef.
Makes solo tarballs work on windows, by converting to ShellOut and adding smarter path separator support to the regex that detects the cookbook directory to untar into.