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 #19369 - reports: show puppet compile master #4485

Closed

Conversation

timogoebel
Copy link
Member

The commit adds a field producer to the report model to identify which server (behind a loadbalancer) compiled a puppet catalog.
This is a simple approach that just saves the hostname in a text db field. Other options would be to introduce a new model for that.

To test this, one would need to extend foreman-report_v2.rb by

report['producer'] = %x{hostname -f}.strip

This is how this looks:

image

@mention-bot
Copy link

@timogoebel, thanks for your PR! By analyzing the history of the files in this pull request, we identified @ohadlevy, @shlomizadok and @domcleal to be potential reviewers.

@ares
Copy link
Member

ares commented May 4, 2017

[test foreman]

Copy link
Member

@ares ares left a comment

Choose a reason for hiding this comment

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

One small nit in the code. Is there a PR for foreman-report opened? Since the producer is likely a hostname of a server where smart proxy runs, would it make sense to try to map it to this object? E.g. the producer name could be a link to the proxy if it's matched.

After this gets merged, report format wiki should be updated.

@@ -15,6 +15,10 @@
<%= render 'output', :logs => @config_report.logs%>
<%= render 'metrics', :status => @config_report.status, :metrics => @config_report.metrics["time"] if @config_report.metrics["time"] %>

<% if @config_report.producer.present? %>
<p class='ra'> <%= _("Report generated by %s ") % @config_report.producer %> </p>
Copy link
Member

Choose a reason for hiding this comment

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

the html should be probably indented

@@ -1,4 +1,4 @@
// raw data from Foreman's old parsing of reports, with some readable formtting
// raw data from Foreman's old parsing of reports, with some readable formatting
Copy link
Member

Choose a reason for hiding this comment

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

👍

@ares
Copy link
Member

ares commented May 4, 2017

One more thought, maybe the reported at and generated by could be merged, e.g. "Reported at 2017-04-05 17:33:15 by puppetmaster.example.com" where the "by ..." would be only appended if produced was set.

@theforeman-bot
Copy link
Member

Thank you for your contribution, @timogoebel! This PR has been inactive for 6 months, closing for now.
Feel free to reopen when you return to it. This is an automated process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants