modulesync icon indicating copy to clipboard operation
modulesync copied to clipboard

print warning when module from filter isn't in managed_modules.yml

Open bastelfreak opened this issue 8 years ago • 2 comments

I tried to update two modules today that weren't in our managed_modules.yml:

bastelfreak@bastelfreak-ws ~/modulesync_config $ bundle exec msync update -f hiera --message "modulesync 0.6.2" 
bastelfreak@bastelfreak-ws ~/modulesync_config $ bundle exec msync update -f jenkins --message "modulesync 0.6.2" 
bastelfreak@bastelfreak-ws ~/modulesync_config $

the output is nothing, which is very missleading. A warning/message would be cool instead.

bastelfreak avatar May 21 '16 20:05 bastelfreak

I suspect the problem is the use of a filter rather than a strict parameter...

https://github.com/voxpupuli/modulesync/blob/master/lib/modulesync.rb#L50

ways I can see this working is to add an option to provide a specific module which would could work without existing in the managed_modules.yml file... but this feels a bit risky... so perhaps validation of presence is desired...

alternatively an error could be thrown if nothing is found via:

raise 'filter did not match any of the modules in managed_modules.yml' if managed_modules.empty?

I would be happy to submit a PR for either solution

james-powis avatar Jan 05 '17 05:01 james-powis

@james-powis The word "filter" suggests like we're actually filtering a list of modules (not overriding), so the latter solution resonates with the usage pattern. :+1:

bittner avatar May 27 '18 07:05 bittner