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

RhnSatellite::Connection::Handler.default_https not respected #3

Closed
bflad opened this issue Dec 1, 2012 · 2 comments
Closed

RhnSatellite::Connection::Handler.default_https not respected #3

bflad opened this issue Dec 1, 2012 · 2 comments

Comments

@bflad
Copy link
Contributor

bflad commented Dec 1, 2012

Hi there,

This plugin is really nice, but I found that its not possible to set a default https value via RhnSatellite::Connection::Handler.default_https. I think its also not possible to set a different default_timeout as well due to the same logic.

Because every RhnSatellite::X class extends RhnSatellite::Connection::Base, which will always default to https = true because of this line: https://github.com/duritong/ruby-rhn_satellite/blob/master/lib/rhn_satellite/connection/base.rb#L19

So when I make a call to say RhnSatellite::System.details(1000001), its calling:
RhnSatellite::Connection::Handler.instance_for("System", nil, nil, nil, 30, true).default_call('system.getDetails',1000001)

Here's the line that determines whether or not to use default_https: https://github.com/duritong/ruby-rhn_satellite/blob/master/lib/rhn_satellite/connection/handler.rb#L17

Since true is being passed to instance_for, it'll always use HTTPS unless I specifically set RhnSatellite::System.https = false.

The fix is either not defaulting RhnSatellite::Connection::Base to a HTTPS value, or (personally I think this is better), adjusting RhnSatellite::Connect::Handler to respect the default_https if its set.

Thanks and let me know if you would like me to submit a pull request!
Brian

@bflad
Copy link
Contributor Author

bflad commented Dec 1, 2012

Actually on second thought, it might be better to not default HTTPS to true on RhnSatellite::Connection::Base, which will pass nil to RhnSatellite::Connection::Handler.instance_for, which will always default to true (or false if you set default_https). I think the same applies to the timeout in RhnSatellite::Connection::Base as well. Hope this helps!

@bflad
Copy link
Contributor Author

bflad commented Dec 1, 2012

Submitted PR 4: #4

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

2 participants