modulesync
modulesync copied to clipboard
print warning when module from filter isn't in managed_modules.yml
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.
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 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: