Mailinglist Archive: yast-devel (246 mails)

< Previous Next >
[yast-devel] Re: [yast-commit] <rest-service> master : system - do reboot/shutdown only in 'production' mode
  • From: Ladislav Slezak <lslezak@xxxxxxx>
  • Date: Fri, 14 Aug 2009 11:12:05 +0200
  • Message-id: <4A852A65.5060307@xxxxxxx>
Hi,

On 13.8.2009 21:31, Klaus Kaempf wrote:
'Reboot' seems to be a function. However according to Ruby naming
conventions 'Reboot' is a class (first letter upper case).

This is a HAL DBus method call, it has

int org.freedesktop.Hal.Device.SystemPowerManagement.Reboot()

function, Ruby conventions cannot be applied here.

+ else
+ Rails.logger.debug "Skipping reboot in
#{ENV['RAILS_ENV']} mode"
+ return true
+ end

The result of the "when :reboot" case is of boolean type. Let the
'reboot' function also return a boolean and drop the comparison with 0

Again, it's a HAL method returning int (see above).

The duplication of the production check is not DRY (don't repeat
yourself). Also think about moving the check into the 'reboot' resp.
'shutdown' functions, because this is "where the action is".

The same here...


--

Best Regards

Ladislav Slez√°k
Yast Developer
------------------------------------------------------------------------
SUSE LINUX, s.r.o. e-mail: lslezak@xxxxxxx
Lihovarsk√° 1060/12 tel: +420 284 028 960
190 00 Prague 9 fax: +420 284 028 951
Czech Republic http://www.suse.cz/
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
References