diff --git a/src/sugar/activity/activityfactory.py b/src/sugar/activity/activityfactory.py index ee0fd921..30fd14b7 100644 --- a/src/sugar/activity/activityfactory.py +++ b/src/sugar/activity/activityfactory.py @@ -244,8 +244,12 @@ class ActivityCreationHandler(gobject.GObject): self._handle.object_id, self._handle.uri) + dev_null = file('/dev/null', 'w') environment_dir = None - if os.path.exists('/etc/olpc-security'): + rainbow_found = subprocess.call(['which', 'rainbow-run'], + stdout=dev_null, stderr=dev_null) == 0 + use_rainbow = rainbow_found and os.path.exists('/etc/olpc-security') + if use_rainbow: environment_dir = tempfile.mkdtemp() command = ['/usr/bin/sudo', '-E', '--', '/usr/bin/rainbow-run',