[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Code for discussion: broker plugin loading




----- Original Message -----
> From: "Clayton Coleman" <ccoleman redhat com>
> To: "Luke Meyer" <lmeyer redhat com>
> Cc: "Openshift Dev" <dev lists openshift redhat com>, "Krishna Raman" <kraman gmail com>
> Sent: Tuesday, July 30, 2013 4:40:39 PM
> Subject: Re: Code for discussion: broker plugin loading
> 
> 
> 
> ----- Original Message -----
> > 
> > 
> > ----- Original Message -----
> > > From: "Clayton Coleman" <ccoleman redhat com>
> > > > 
> > > > ... which results in e.g.:
> > > > # oo-admin-ctl-district
> > > > Error while loading bundler. Bundler said:
> > > > Could not find gem 'o-o-akjsdfhklajsdf (>= 0) ruby' in the gems
> > > > available on
> > > > this machine.
> > > > Run `bundle install` to install missing gems.
> > > > But don't do that!
> > > > 
> > > > 
> > > > 
> > > > Meaning, we can at least capture and rephrase what bundler
> > > > says, although
> > > > I
> > > > don't see any way to do this at the Gemfile level. Might be
> > > > nice to have
> > > > an
> > > > "optional" parameter on gem so that if it fails, bundler just
> > > > kind of
> > > > complains and keeps going, but I'm thinking the bundler
> > > > maintainers would
> > > > frown on that.
> > > > 
> > > > The exception, BTW, is System::Exit.
> > > > 
> > > > So is this what we would like to do?
> > > > 
> > > 
> > > Could we not simply rescue and rethrow our own exception with a
> > > message?  That guarantees it's shown last.
> > 
> > Bundler's message is sent to stdout in bright glowing colors and tells the
> > user to run bundle install. It is hard to miss.
> > 
> > Also, I would like to scan the output for missing openshift-origin-* and let
> > the user know that's probably a plugin/conf issue, vs other infrastructure
> > ruby gems just not being there (could even give the commands for installing
> > the RPMs).
> > 
> > Downside is, this will really make a mess of boot.rb ...
> > 
> 
> And it probably has to be copied into console as well.

Well, at least there are no plugins there (yet...). It would be pretty straightforward.

One more thing we could do on the broker - have the Gemfile output which plugins it's trying to install according to which files; it would be intercepted at the same block that catches bundler output, and shown if something goes wrong.

Annoyingly, bundler does not tell you *all* the gems that failed to load. Just the last.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]