diff bitten/slave.py @ 47:083e848088ee

* Improvements to the model classes, and a couple of unit tests. * The build master now stores information about ongoing builds in the Trac database. * The web interface displays the status of ongoing builds.
author cmlenz
date Fri, 24 Jun 2005 15:35:23 +0000
parents 8184c7ad896c
children 757aa3bf9594
line wrap: on
line diff
--- a/bitten/slave.py
+++ b/bitten/slave.py
@@ -32,8 +32,9 @@
 
     def greeting_received(self, profiles):
         if OrchestrationProfileHandler.URI not in profiles:
-            logging.error('Peer does not support Bitten profile')
-            raise beep.TerminateSession, 'Peer does not support Bitten profile'
+            err = 'Peer does not support the Bitten orchestration profile'
+            logging.error(err)
+            raise beep.TerminateSession, err
         self.channels[0].profile.send_start([OrchestrationProfileHandler])
 
 
@@ -65,18 +66,16 @@
 
     def handle_msg(self, msgno, msg):
         if msg.get_content_type() == 'application/tar':
-            logging.info('Received snapshot')
             workdir = tempfile.mkdtemp(prefix='bitten')
             archive_name = msg.get('Content-Disposition', 'snapshot.tar.gz')
             archive_path = os.path.join(workdir, archive_name)
             file(archive_path, 'wb').write(msg.get_payload())
-            logging.info('Stored snapshot archive at %s', archive_path)
+            logging.info('Received snapshot archive: %s', archive_path)
 
             # TODO: Spawn the build process
 
             xml = xmlio.Element('ok')
             self.channel.send_rpy(msgno, beep.MIMEMessage(xml))
-            logging.info('Sent <ok/> in reply to build request')
 
         else:
             xml = xmlio.Element('error', code=500)['Sorry, what?']
@@ -104,7 +103,7 @@
         try:
             port = int(args[1])
             assert (1 <= port <= 65535), 'port number out of range'
-        except AssertionError, ValueError:
+        except (AssertionError, ValueError):
             parser.error('port must be an integer in the range 1-65535')
     else:
         port = 7633
Copyright (C) 2012-2017 Edgewall Software