git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f3849c8
)
added -t --type option
author
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Thu, 5 May 2011 20:23:04 +0000
(16:23 -0400)
committer
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Thu, 5 May 2011 20:23:04 +0000
(16:23 -0400)
sfa/server/sfa-ca.py
patch
|
blob
|
history
diff --git
a/sfa/server/sfa-ca.py
b/sfa/server/sfa-ca.py
index
b8c7f23
..
08f3daa
100755
(executable)
--- a/
sfa/server/sfa-ca.py
+++ b/
sfa/server/sfa-ca.py
@@
-43,6
+43,8
@@
def main():
help="gid file to import into the registry")
parser.add_option("-e", "--export", dest="export",
help="name of gid to export from registry")
help="gid file to import into the registry")
parser.add_option("-e", "--export", dest="export",
help="name of gid to export from registry")
+ parser.add_option("-t", "--type", dest="type",
+ help="record type", default=None)
parser.add_option("-o", "--outfile", dest="outfile",
help="where to write the exprted gid")
parser.add_option("-v", "--verbose", dest="verbose", default=False,
parser.add_option("-o", "--outfile", dest="outfile",
help="where to write the exprted gid")
parser.add_option("-v", "--verbose", dest="verbose", default=False,
@@
-139,10
+141,13
@@
def export_gid(options):
from sfa.util.table import SfaTable
# lookup the record for the specified hrn
hrn = options.export
from sfa.util.table import SfaTable
# lookup the record for the specified hrn
hrn = options.export
-
- # check sfa table first
+ type = options.type
+ # check sfa table first
+ filter = {'hrn': hrn}
+ if type:
+ filter['type'] = type
table = SfaTable()
table = SfaTable()
- records = table.find(
{'hrn': hrn, type: 'authority'}
)
+ records = table.find(
filter
)
if not records:
# check the authorities hierarchy
hierarchy = Hierarchy()
if not records:
# check the authorities hierarchy
hierarchy = Hierarchy()