Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

<broker> improve Gemfile loading + bug 993250 #3294

Merged
merged 1 commit into from Aug 14, 2013

Conversation

sosiouxme
Copy link
Member

https://bugzilla.redhat.com/show_bug.cgi?id=993250
Bundler load failures are wrapped and re-interpreted for OpenShift
instead of telling the user to "bundle install"
OPENSHIFT_CONF_DIR overrides /etc/openshift base for broker config files
Gemfile loads plugins even if just the -dev.conf file is present
Plugins are loaded in sorted order, in case it matters

@sosiouxme
Copy link
Member Author

Example output:

# oo-admin-ctl-district
Error while loading gems for the broker:
Could not find bigdecimal-1.2.1 in any of the sources
This usually means gem RPMs have been updated and Gemfile.lock is stale.
Please restart the openshift-broker service to update it, and try again.

# touch /etc/openshift/plugins.d/openshift-origin-foo.conf
# oo-admin-ctl-district
Error while loading gems for the broker:
Could not find gem 'openshift-origin-foo (>= 0) ruby' in the gems available on this machine.
You may need to install the rubygem-openshift-origin-foo RPM.
Or, you may need to remove/rename the openshift-origin-foo conf file(s) in /etc/openshift/plugins.d

# touch /etc/openshift/plugins.d/asdfasdfasdfasdfasdf.conf
# oo-admin-ctl-district
Error while loading gems for the broker:
Could not find gem 'asdfasdfasdfasdfasdf (>= 0) ruby' in the gems available on this machine.
You may need to install the rubygem-asdfasdfasdfasdfasdf RPM.

@sosiouxme
Copy link
Member Author

[test]

@openshift-bot
Copy link

Origin Test Results: SUCCESS (https://originci-openshift.rhcloud.com/job/test_pull_requests/1658/)

@openshift-bot
Copy link

plugins = Dir[(ENV['OPENSHIFT_CONF_DIR'] || "/etc/openshift") + '/plugins.d/*.conf'].
map {|file| File.basename(file, ".conf") }
# in development, load if there is a -dev.conf file, even if no prod.conf
group :development do; plugins.map! {|name| name.sub(/-dev$/, '')}; end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't use do; ; end, always break those out:

group :development do
  plugins.map!{ ... }
end

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?
I would have used { } instead of do / end, but ruby didn't seem to like that (guess I could put the symbol in parens...)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our coding style is only use curly braces on the same line, do/end on new lines. However, the standard style for gemfile is for group blocks to always be using the new line indentation. It improves readability and there's no reason to shortcut it

https://bugzilla.redhat.com/show_bug.cgi?id=993250
Bundler load failures are wrapped and re-interpreted for OpenShift
  instead of telling the user to "bundle install"
OPENSHIFT_CONF_DIR overrides /etc/openshift base for broker config files
Gemfile loads plugins even if just the -dev.conf file is present
Plugins are loaded in sorted order, in case it matters
@sosiouxme
Copy link
Member Author

[merge]

@openshift-bot
Copy link

Evaluated for origin up to 0771a6d

@openshift-bot
Copy link

Evaluated for online up to 0771a6d

@openshift-bot
Copy link

Online Merge Results: SUCCESS (https://ci.dev.openshift.redhat.com/jenkins/job/merge_pull_requests/3430/) (Image: devenv_3648)

openshift-bot pushed a commit that referenced this pull request Aug 14, 2013
@openshift-bot openshift-bot merged commit b0e6340 into openshift:master Aug 14, 2013
@sosiouxme sosiouxme deleted the broker-plugin-loading branch August 14, 2013 12:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants