On 2011-11-10 17:08, Dejan Muhamedagic wrote: > Hi Lars, > > Pity I didn't see this earlier, could've saved meself some time :) > > On Thu, Nov 10, 2011 at 04:33:02PM +0100, Lars Ellenberg wrote: >> On Thu, Nov 10, 2011 at 04:11:16PM +0100, Florian Haas wrote: >>> Hi Dejan, >>> >>> thanks for the feedback! We've worked in most of your suggested changes, >>> see below: >> >>>> More direct would be: >>>> >>>> if [ $? -ne 0 ]; then >> >> $? in a test is almost always an error. > > Unless you don't need the outcome later.
I'm with you, however Lars did evidently spot the one occasion where we used $? twice trying to get the same return code. So he wins. :) https://github.com/fghaas/resource-agents/commit/2cbb26648c133ce04b0d51e439c41541dac039e1 I left one invocation in there: "asterisk_validate || exit $?". I hope that one is acceptable. :) >> Btw, >> "User $OCF_RESKEY_user doesn't exit" >> there is an s missing. > > "user doesn't exit" sounds good too ;-) https://github.com/fghaas/resource-agents/commit/1568a990dfcac03ddfe5785c5d65940ed230068c We also tossed in a few more changes: Properly handle multiple instances of the "astcanary" watchdog daemon: https://github.com/fghaas/resource-agents/commit/c257d4a57f9131a4353143991fe101f02b51d790 Remove a pointless "return $?" https://github.com/fghaas/resource-agents/commit/812f2b55b9a7a9f8bdd270cca8d037f07f0e980a Fix a couple of log messages, and exit where we shouldn't return: https://github.com/fghaas/resource-agents/commit/58b5f55da4ac5537acf9a36b56f8b35f2b96da56 Cheers, Florian -- Need help with High Availability? http://www.hastexo.com/now _______________________________________________________ Linux-HA-Dev: [email protected] http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev Home Page: http://linux-ha.org/
