Changeset c324ad3


Ignore:
Timestamp:
Dec 1, 2010 10:46:56 AM (14 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master
Children:
1f356d3
Parents:
dee164e
Message:

Mishandling attributes and add directory creation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/access_to_abac.py

    rdee164e rc324ad3  
    8989        if user == '<same>':
    9090            if gu is not None:
    91                 project = gu
     91                user = gu
    9292            else:
    9393                raise parse_error("User cannot be decisively mapped: %s" % l)
     
    9595        # Create a semi-mnemonic name for the destination credential (the one
    9696        # that will be mapped to the local attributes
    97         if project and user:
    98             a = 'project_%s_user_%s' % (project, user)
    99         elif project:
    100             a = 'project_%s' % project
    101         elif user:
    102             a = 'user_%s' % user
     97        if gp and gu:
     98            a = 'project_%s_user_%s' % (gp, gu)
     99        elif gp:
     100            a = 'project_%s' % gp
     101        elif gu:
     102            a = 'user_%s' % gu
    103103        else:
    104104            raise parse_error("No mapping for %s/%s!?" % (gp, gu))
     
    305305
    306306if opts.dir:
     307    if not os.access(opts.dir, os.F_OK):
     308        try:
     309            os.mkdir(opts.dir, 0700)
     310        except EnvironmentError, e:
     311            sys.exit("Cannot create %s: %s" % (e.filename, e.strerror))
    307312    if not os.path.isdir(opts.dir):
    308313        sys.exit('%s is not a directory' % opts.dir)
Note: See TracChangeset for help on using the changeset viewer.