=== modified file 'lava_dispatcher/client/master.py'
@@ -631,8 +631,12 @@
def hard_reboot(self):
logging.info("Perform hard reset on the system")
- self.proc.send("~$")
- self.proc.sendline("hardreset")
+ cmd = self.device_option("hard_reset_command", "")
+ if cmd != "":
+ logging_system(cmd)
+ else:
+ self.proc.send("~$")
+ self.proc.sendline("hardreset")
def _enter_uboot(self):
self.proc.expect("Hit any key to stop autoboot")
=== modified file 'lava_dispatcher/config.py'
@@ -18,7 +18,7 @@
# along
# with this program; if not, see <http://www.gnu.org/licenses>.
-from ConfigParser import ConfigParser
+from ConfigParser import ConfigParser, NoOptionError
import os
import StringIO
import logging
@@ -72,13 +72,20 @@
_read_into(path, cp)
return cp
+_sentinel = object()
class ConfigWrapper(object):
def __init__(self, cp, config_dir):
self.cp = cp
self.config_dir = config_dir
- def get(self, key):
- return self.cp.get("DEFAULT", key)
+ def get(self, key, default=_sentinel):
+ try:
+ return self.cp.get("DEFAULT", key)
+ except NoOptionError:
+ if default is not _sentinel:
+ return default
+ else:
+ raise
def getint(self, key):
return self.cp.getint("DEFAULT", key)