From 75f433cc14ab2086c5cf79b23d208809f78451be Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Mon, 03 Dec 2012 15:57:20 +0000 Subject: Refactor a bit to keep devbot somewhat generic --- (limited to 'commands/run') diff --git a/commands/run b/commands/run index bef41f2..f3a5f4a 100755 --- a/commands/run +++ b/commands/run @@ -1,8 +1,23 @@ #!/usr/bin/python +import os +import sys + import common from devbot import run +from devbot import config common.setup() -run.run_sugar() + +profile_env = os.environ.get("SUGAR_PROFILE", None) +profile_pref = config.get_pref("PROFILE") + +if profile_env is not None: + if profile_pref is None: + config.set_pref("PROFILE", _get_random_id()) + elif profile_pref == profile_env: + print "Cannot run two instances with the same profile." + sys.exit(1) + +run.run("sugar-runner") -- cgit v0.9.1