- Timestamp:
- Sep 15, 2012, 9:53:40 PM (13 years ago)
- Branches:
- master, space-access, stable, stage
- Children:
- cf4b7f4
- Parents:
- 3113644
- git-author:
- Alex Dehnert <adehnert@…> (09/15/12 21:53:40)
- git-committer:
- Alex Dehnert <adehnert@…> (09/15/12 21:53:40)
- File:
-
- 1 edited
-
asadb/mit/__init__.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
asadb/mit/__init__.py
r51b384a r08d4fa6 1 import os 1 2 import subprocess 2 3 import ldap … … 29 30 except ValidationError: 30 31 raise ValidationError('Provide a valid URL or AFS path') 32 33 def pag_check_helper(fn, args, aklog=False, ccname=None, **kwargs): 34 if 'executable' in kwargs: 35 raise ValueError('"executable" not supported with pag_check_*') 36 37 env = None 38 if 'env' in kwargs: 39 env = kwargs['env'] 40 del kwargs['env'] 41 if ccname: 42 if env is not None: 43 env = dict(env) 44 else: 45 env = dict(os.environ) 46 env['KRB5CCNAME'] = ccname 47 48 pagsh_cmd = 'exec "$@"' 49 if aklog: pagsh_cmd = "aklog && " + pagsh_cmd 50 args = ['pagsh', '-c', pagsh_cmd, 'exec', ] + args 51 52 return fn(args, env=env, **kwargs) 53 54 def pag_check_call(args, **kwargs): 55 return pag_check_helper(subprocess.check_call, args, **kwargs) 56 def pag_check_output(args, **kwargs): 57 return pag_check_helper(subprocess.check_output, args, **kwargs) 31 58 32 59 class ScriptsRemoteUserMiddleware(RemoteUserMiddleware):
Note: See TracChangeset
for help on using the changeset viewer.