Commit f1fd314b authored by Guillaume Tucker's avatar Guillaume Tucker

servod/run-servod: update for pyudev 0.21.0 (Debian Stretch)

Make it work with pyudev 0.21.0 as per Debian Stretch.  Previous
version worked with 0.16.1 as per Jessie.
Signed-off-by: Guillaume Tucker's avatarGuillaume Tucker <guillaume.tucker@collabora.com>
parent 29f6af7e
......@@ -24,7 +24,7 @@
#
# Author: Daniel Stone <daniels@collabora.com>
#
#
#
# A wrapper around servod: fork servod itself, wait for it to start, and create
# any device links.
......@@ -77,7 +77,7 @@ def do_connect(port, board_name):
os.symlink(results[0], "%s/ec-uart" % dev_dir)
os.symlink(results[1], "%s/cpu-uart" % dev_dir)
signal.signal(signal.SIGTERM, handle_sigterm)
# Yes, this should really be python-systemd; however, that's
......@@ -114,11 +114,11 @@ def run_servod():
print "couldn't find udev device from %s" % dev_path
sys.exit(1)
if not "serial" in ud_dev.attributes:
if not "serial" in ud_dev.attributes.available_attributes:
print "parent-of-parent device %s has no serial attribute" % dev_path
sys.exit(1)
target_serial = ud_dev.attributes["serial"]
target_serial = ud_dev.attributes.get("serial")
board_name = None
all_boards = multiservo.parse_rc(logger, "/etc/google-servo.conf")
......@@ -148,7 +148,7 @@ def run_servod():
# A comment in servod says they should fix it to not parse
# sys.argv directly. Quite.
sys.argv = ['servod', '--rcfile', '/etc/google-servo.conf',
'--serialname', ud_dev.attributes["serial"]]
'--serialname', ud_dev.attributes.get("serial")]
servod.main_function()
else: # parent
# Run servod and pull its stdout/stderr.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment