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

puppet_module_install excludes too much #725

Closed
alexjfisher opened this issue Mar 2, 2015 · 4 comments
Closed

puppet_module_install excludes too much #725

alexjfisher opened this issue Mar 2, 2015 · 4 comments

Comments

@alexjfisher
Copy link
Member

Hi
I'd like to be able to do something like...

puppet_module_install(:source => File.join(module_root, 'spec/fixtures/modules/functions'), :module_name => 'functions')

... but, 'spec' is in the default PUPPET_MODULE_INSTALL_IGNORE and as a result, nothing gets scp'ed

I believe the ignore paths should only be used if they appear in the module being copied itself, and not if they appear earlier in the path.

@electrical
Copy link
Contributor

I've done some digging when @alexjfisher mentioned it on IRC.
https://github.com/puppetlabs/beaker/blob/master/lib/beaker/host.rb#L390-L392 does a glob of all the potential directories and rejects anything that matches the ignore_re.
The issue with this is that the Regex is not specific enough and matches anything that is in the path.
So if you have a path called /foo/bar/spec/something it gets ignored because it has spec in the path name.
We should only process the ignoring of directories in the source dir it self.

A potential fix is to do f.gsub(source, '') =~ ignore_re at https://github.com/puppetlabs/beaker/blob/master/lib/beaker/host.rb#L391
which strips out the source path so we only evaluate the directories that are in the source path.

@anodelman any opinions on this?

@anodelman
Copy link
Contributor

I think that our scp ignore is pretty much a mess and I'm going to be reviewing it this week. The difficulty here is that some code depends upon our flexible attitude towards what is a match, yet, in this case, it is stabbing us in the back.

What really needs to happen here is better doc-ing that makes it clear what ignore does/doesn't do and then stick to i.

@anodelman
Copy link
Contributor

A fix for this is actually included in #730 - to only match against subdirs of the provided dir.

@anodelman
Copy link
Contributor

PR merged.

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

No branches or pull requests

3 participants