Katello / katello-packaging

[DEPRECATED] Packaging for Katello
7 stars 33 forks source link

Fixes #20925 - k-change-hostname should check exit codes #530

Closed johnpmitsch closed 7 years ago

johnpmitsch commented 7 years ago

We should check the exit codes on each command ran in the script and exit if they fail.

theforeman-bot commented 7 years ago

Issues: #20925

evgeni commented 7 years ago

run_cmd("hammer ping", [0], "There is a problem with the server, please check 'hammer ping'")

this will fail on a proxy. the old code had a unless block around it.

evgeni commented 7 years ago

you can add a || true at the end of the command. also hacky. but will always exit 0.

johnpmitsch commented 7 years ago

@evgeni thanks, I still have to test on a foreman-proxy!

evgeni commented 7 years ago

unrelated, but just realized, is the port really always 9090? shouldn't we read the old port and re use it?

evgeni commented 7 years ago

the puppet server/master restart will fail, as it's either puppetserver or httpd (for puppet3) which we have to restart.

johnpmitsch commented 7 years ago

unrelated, but just realized, is the port really always 9090? shouldn't we read the old port and re use it?

@evgeni I'm not sure about the 9090 port, @ehelms or @jlsherrill do you know?

johnpmitsch commented 7 years ago

the puppet server/master restart will fail, as it's either puppetserver or httpd (for puppet3) which we have to restart.

The original cause of adding those lines is here. In what scenario is this going to fail?

evgeni commented 7 years ago

if you have a Puppet3 setup, the puppet master is running inside Apache httpd using mod_passenger. With Puppet 4 you have the stand-alone puppetserver process. depending on that you have to restart different services. and with run_cmd this will now really fail and wont be silently discarded on a puppet 3 install which has no puppetserver.

ehelms commented 7 years ago

I think its 99% safe to assume smart proxies are running on 9090 in Katello deployments.

johnpmitsch commented 7 years ago

@evgeni I'm not sure of the exact cause of updating the capsule w/ hammer working but throwing an error. Its a bad bug and we should fix soon! In my experience, it is consistent. I've tried out of the script too.