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

don't raise error on cluster config not found #757

Open
johrstrom opened this issue May 20, 2022 · 0 comments
Open

don't raise error on cluster config not found #757

johrstrom opened this issue May 20, 2022 · 0 comments

Comments

@johrstrom
Copy link
Contributor

johrstrom commented May 20, 2022

I'm not really sure why we raise an error here - but we really shouldn't. Instead it should just be graceful degradation instead of a fatal error. Maybe we warn to stderr that it's empty, but raising an error here seems a bit strong. So you didn't find a configuration? Let the upper layer deal with the fact that there are no clusters.

raise ConfigurationNotFound, "configuration file '#{config}' does not exist"

This is the error I get running rake tasks.

== Preparing database ==
rails aborted!
OodCore::ConfigurationNotFound: configuration file '/etc/ood/config/clusters.d' does not exist
/users/PZS0714/johrstrom/ondemand/dev/osc-reporting/vendor/bundle/ruby/2.7.0/gems/ood_core-0.19.0/lib/ood_core/clusters.rb:52:in `load_file'
/users/PZS0714/johrstrom/ondemand/dev/osc-reporting/app/models/active_jobs.rb:25:in `block in clusters'
/users/PZS0714/johrstrom/ondemand/dev/osc-reporting/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.3/lib/active_support/cache.rb:804:in `block in save_block_result_to_cache'
/users/PZS0714/johrstrom/ondemand/dev/osc-reporting/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.3/lib/active_support/cache.rb:778:in `block in instrument'
/users/PZS0714/johrstrom/ondemand/dev/osc-reporting/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.3/lib/active_support/notifications.rb:208:in `instrument'
/users/PZS0714/johrstrom/ondemand/dev/osc-reporting/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.3/lib/active_support/cache.rb:778:in `instrument'
/users/PZS0714/johrstrom/ondemand/dev/osc-reporting/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.3/lib/active_support/cache.rb:803:in `save_block_result_to_cache'
/users/PZS0714/johrstrom/ondemand/dev/osc-reporting/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.3/lib/active_support/cache.rb:369:in `fetch'
/users/PZS0714/johrstrom/ondemand/dev/osc-reporting/app/models/active_jobs.rb:23:in `clusters'

┆Issue is synchronized with this Asana task by Unito

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

1 participant