[Commits] act-server branch master updated.

C. Scott Ananian (none) cscott at activation
Fri Jan 9 18:42:04 EST 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "/home/cscott/public_git/act-server".

The branch, master has been updated
       via  7cd52cc6c2f725ef46a4ecde45ba114089492da2 (commit)
      from  774385a9af987d8477f63844e60aad07be49477f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

 scripts/jefferson-airplane.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 7cd52cc6c2f725ef46a4ecde45ba114089492da2
Author: C. Scott Ananian <cscott at activation.(none)>
Date:   Fri Jan 9 18:41:57 2009 -0500

    Fallback to /dev/ttyUSB1 if /dev/ttyUSB0 fails to work.
    
    This works around a hardware problem that occassionally causes a disconnect
    on /dev/ttyUSB0 and an immediate reconnect; the kernel will then reassign
    the /dev/ttyUSB1 to the "new" device.  When this happens again, it will
    assign the newly-free /dev/ttyUSB0.

diff --git a/scripts/jefferson-airplane.py b/scripts/jefferson-airplane.py
index a81e811..b261ba4 100755
--- a/scripts/jefferson-airplane.py
+++ b/scripts/jefferson-airplane.py
@@ -11,6 +11,7 @@ import bitfrost.util.json as json
 import os, os.path, termios, tty
 
 SERIAL_DEVICE = '/dev/ttyUSB0'
+SERIAL_DEVICE_FALLBACK = '/dev/ttyUSB1' # used if SERIAL_DEVICE fails
 BAUD_RATE = termios.B115200
 TIMEOUT_SECONDS = 30
 
@@ -107,7 +108,10 @@ def with_lock(f):
 def main():
     """Send all currently requested leases to the signing machine."""
     from oats.request.models import RequestedLease
-    fd = serial_open(SERIAL_DEVICE, BAUD_RATE)
+    try:
+      fd = serial_open(SERIAL_DEVICE, BAUD_RATE)
+    except:
+      fd = serial_open(SERIAL_DEVICE_FALLBACK, BAUD_RATE)
     try:
         link_up_leases() # take care of leases we already have
         for rl in RequestedLease.objects.filter(lease__isnull=True):
-----------------------------------------------------------------------


--
/home/cscott/public_git/act-server


More information about the Commits mailing list