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 #33320 - Refer to FQDN instead of "Foreman server" in SmartProx… #988

Merged
merged 1 commit into from
Aug 24, 2021

Conversation

wbclark
Copy link
Contributor

@wbclark wbclark commented Aug 23, 2021

…y registration error messages

@wbclark wbclark force-pushed the 33320_always_refer_to_fqdn branch from 4021df8 to c4c43d2 Compare August 23, 2021 14:56
@wbclark wbclark force-pushed the 33320_always_refer_to_fqdn branch from c4c43d2 to 80c2891 Compare August 23, 2021 15:03
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Overall 👍 for the concept.

lib/puppet/provider/foreman_resource/rest_v3.rb Outdated Show resolved Hide resolved
lib/puppet/provider/foreman_resource/rest_v3.rb Outdated Show resolved Hide resolved
@wbclark wbclark force-pushed the 33320_always_refer_to_fqdn branch from 80c2891 to f414972 Compare August 23, 2021 17:00
@wbclark wbclark force-pushed the 33320_always_refer_to_fqdn branch from f414972 to a567fee Compare August 23, 2021 20:57
@wbclark
Copy link
Contributor Author

wbclark commented Aug 23, 2021

Fixed unit tests.

There are still some failures for acceptance tests on Debian and Ubuntu, but to me they look unrelated to this change.

explanations = {
'400' => 'Something is wrong with the data sent to Foreman server',
'400' => "Something is wrong with the data sent to #{fqdn}",
Copy link
Member

Choose a reason for hiding this comment

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

Should this then also be sent to Foreman at #{fqdn} ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that would be both more specific and more consistent.

I will make the change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll use this consistently throughout, i.e. also changing to "Often this is caused by invalid Oauth credentials sent to Foreman at #{fqdn}" and "The requested resource was not found in Foreman at #{fqdn}" for the explanations for 401 and 404 codes

@wbclark wbclark mentioned this pull request Aug 24, 2021
@wbclark wbclark force-pushed the 33320_always_refer_to_fqdn branch from a567fee to be1c87d Compare August 24, 2021 15:23
'400' => "Something is wrong with the data sent to Foreman at #{fqdn}",
'401' => "Often this is caused by invalid Oauth credentials sent to Foreman at #{fqdn}",
'404' => "The requested resource was not found in Foreman at #{fqdn}",
'500' => "Check /var/log/foreman/production.log on #{fqdn} for detailed information",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
'500' => "Check /var/log/foreman/production.log on #{fqdn} for detailed information",
'500' => "Check Foreman logs at /var/log/foreman/production.log on #{fqdn} for detailed information",

Considering making this change as well

Copy link
Member

Choose a reason for hiding this comment

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

I would keep it short. IMHO the path tells you enough what's there.

Copy link
Contributor Author

@wbclark wbclark Aug 24, 2021

Choose a reason for hiding this comment

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

OK, I basically agree. While this would be more consistent with the overall pattern, it doesn't really inform the user of anything new and therefore doesn't justify the added length.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

I am a bit worried about how long these lines are getting. In Foreman we have unique error codes. I'm starting to get the feeling this may get useful here too.

'503' => 'The webserver was unable to reach the backend service. Is foreman.service running?',
'504' => 'The webserver timed out waiting for a response from the backend service. Is Foreman under unusually heavy load?'
'400' => "Something is wrong with the data sent to Foreman at #{fqdn}",
'401' => "Often this is caused by invalid Oauth credentials sent to Foreman at #{fqdn}",
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure this change really adds anything. At the CLI we have oauth parameters. Those are wrong and the user needs to correct those. Does this comment help them find that out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The change does clarify that the issue is the Oauth credentials that are being sent. So it could dispel the notion that the credentials are wrong somewhere on the Foreman side.

The intent is that the user will compare 1. what does Foreman expect to receive? vs. 2. What am I passing to the CLI?

@wbclark wbclark merged commit 125af72 into theforeman:master Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants