+from traceback import format_exc
from simplejson import dumps, loads
from omnisync.main import OmniSync
from bespin.filesystem import get_project
from bespin.database import User
+log = logging.getLogger("bespin.deploy")
# Ideally, we would have a better "remote server" abstraction than this!
"""A keychain with deployment-specific information."""
"""Handles errors that come up during deployment."""
+ log.debug("Handling deploy error: %s", e)
+ s = database._get_session()
+ user = qi.message['user']
+ # if the user hadn't already been looked up, go ahead and pull
+ # them out of the database
+ if isinstance(user, basestring):
+ user = User.find_user(user)
+ # if we didn't find the user in the database, there's not much
+ # it looks like a programming error and we
+ # want more information
+ message = dict(jobid=qi.id, output=tb, error=True)
+ message['asyncDone'] = True
+ retval = Message(user_id=user.id, message=dumps(message))
def run_deploy(user, project, kcpass):
"""Add the deployment request to the worker queue."""