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

Fixes #11093 - Cockpit journal and console if available #2535

Closed
wants to merge 1 commit into from

Conversation

dLobatog
Copy link
Member

This should allow us to see a button Console/Journal if cockpit is enabled in some host, and that host is contactable by Foreman.

screenshot

@dLobatog dLobatog changed the title Fixes #11089 - Adapt tests to Rails 4 Fixes #11093 - Cockpit journal and console if available Jul 10, 2015
class CockpitTest < ActiveSupport::TestCase
test 'cockpit is enabled if cockpit ping is successful' do
dummy_cockpit = DummyCockpit.new
dummy_cockpit.stubs(:operatingsystem).returns(OpenStruct.new(:type => 'Fedora'))
Copy link
Member Author

Choose a reason for hiding this comment

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

OpenStruct is a bit slow, if you want to suggest another altneratives that'd be great.

Copy link
Member

Choose a reason for hiding this comment

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

I think this may be faster?

Os = Struct.new(:type)
dummy_cockpit.stubs(:operatingsystem).returns(Os.new('Fedora'))

@domcleal
Copy link
Contributor

Would this be better in a plugin?

@dLobatog
Copy link
Member Author

I wondered for some time, the reason why I put this in core is that Cockpit is expected to end up in all major Linux OSs, so far it's on Fedora, CentOS, Red Hat, and Arch, but there are plans to include it in Debian based OSs as well. I don't have an strong opinion on this so if anyone feels strongly against this being in core I'll launch a new plugin.

@domcleal
Copy link
Contributor

Seeing as there's little abstraction, a hardcoded list of OS families and URLs, I'd suggest keeping it in a plugin so it can be developed more rapidly and be updated to suit any changes in Cockpit. I can't really see a reason why it needs to be core, so would default to plugin in my mind.

@daviddavis
Copy link
Contributor

I think I am leaning toward a plugin as well. The code is rather simple but it seems like it would be easier (if we decide later for some reason) to merge a cockpit plugin into foreman than vice versa.

@dLobatog
Copy link
Member Author

I have started moving this code to https://github.com/dLobatog/foreman_cockpit, closing.

@dLobatog dLobatog closed this Oct 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants