]> scripts.mit.edu Git - wizard.git/blobdiff - wizard/shell.py
Add "global style" options after command options.
[wizard.git] / wizard / shell.py
index d38ca1551fb19d3df4feb452fa2905efe7249153..94fe3cdc6242c58b6045e647189465b70510a076 100644 (file)
@@ -55,6 +55,9 @@ class Shell(object):
         uid = kwargs.pop("uid", None)
         kwargs.setdefault("python", is_python(args))
         if not user and not uid: return self.call(*args, **kwargs)
+        if util.get_operator_name():
+            # This might be generalized as "preserve some environment"
+            args.insert(0, "SSH_GSSAPI_NAME=" + util.get_operator_name())
         if uid: return self.call("sudo", "-u", "#" + str(uid), *args, **kwargs)
         if user: return self.call("sudo", "-u", user, *args, **kwargs)