Changeset 5d7f1e8


Ignore:
Timestamp:
Dec 3, 2010 9:37:31 AM (13 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master
Children:
a0e20ac
Parents:
3cec20c
Message:

Fix a bug where single string-valued local attributes were output as a comma-separated list of characters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/access_to_abac.py

    r3cec20c r5d7f1e8  
    431431                    f = sys.stdout
    432432                for k, c in to_id.items():
     433                    # Keys are either a single string or a tuple of them; join
     434                    # the tuples into a comma-separated string.
     435                    if isinstance(k, basestring): rhs = k
     436                    else: rhs = join(k, ', ')
     437
    433438                    for a in set(["%s.%s" % (x.principal, x.attr) for x in c]):
    434                         print >>f, "%s -> (%s)" % ( a, join(k, ', '))
     439                        print >>f, "%s -> (%s)" % (a, rhs)
    435440            except EnvironmentError, e:
    436441                sys.exit("Cannot open %s: %s" % (e.filename or '!?',
     
    449454                a.save(auth_dir)
    450455            except EnvironmentError, e:
    451                 sys.exit("Can't create or write %s: %s" % (e.filename, e.strerror))
     456                sys.exit("Can't create or write %s: %s" % \
     457                        (e.filename, e.strerror))
    452458            except abac_authorizer.bad_cert_error, e:
    453459                sys.exit("Error creating authorizer: %s" % e)
Note: See TracChangeset for help on using the changeset viewer.