Changeset 7bb03f0
- Timestamp:
- Aug 22, 2012 11:51:02 AM (12 years ago)
- Branches:
- compt_changes
- Parents:
- 0a16b28
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/access_to_abac.py
r0a16b28 r7bb03f0 180 180 else: 181 181 raise parse_error("Badly formatted local mapping: %s" % l) 182 182 def parse_starbed(l,creds,me, to_id,p,gp, gu, lr): 183 ''' 184 Parse the starbed credientials 185 ''' 186 right_side_str = '\s*,\s*\(\s*(%s)\s*,\s*(%s)\s*,\s*(%s)\s*\)' % \ 187 (id_str,id_str,id_str) 188 m = re.match(right_side_str,l) 189 if m: 190 user,passwd,project = m.group(1,2,3) 191 if gp and gu: 192 a = 'project_%s_user_%s' % (gp, gu) 193 elif gp: 194 a = 'project_%s' % gp 195 elif gu: 196 a = 'user_%s' % gu 197 else: 198 raise parse_error("No mapping for %s/%s!?" % (gp, gu)) 199 c = credential(me, a, 200 [attribute(p, x, lr) for x in (gp, gu) if x is not None]) 201 creds.add(c) 202 if (user,passwd,project) in to_id: to_id[(user,passwd,project)].append(c) 203 else: to_id[(user,passwd,project)] = [ c ] 204 else: 205 raise parse_error("Badly formatted local mapping: %s" % l) 183 206 # internal plug-ins have no local attributes. 184 207 def parse_internal(l, creds, me, to_id, p, gp, gu, lr): pass … … 236 259 'skel': parse_skel, 237 260 'protogeni': parse_protogeni, 261 'starbed' : parse_starbed, 238 262 } 239 263
Note: See TracChangeset
for help on using the changeset viewer.