File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,13 @@ def get_co_group(gid):
144
144
return grouplist [0 ]
145
145
146
146
147
+ def get_identifier (id_ ):
148
+ idfs = call_api ("identifiers/%s.json" % id_ ) | get_datalist ("Identifiers" )
149
+ if not idfs :
150
+ raise RuntimeError ("No such Identifier Id: %s" % id_ )
151
+ return idfs [0 ]
152
+
153
+
147
154
# @rorable
148
155
# def foo(x): ...
149
156
# x | foo -> foo(x)
@@ -236,10 +243,26 @@ def main(args):
236
243
237
244
if options .gname :
238
245
options .gid = gname_to_gid (options .gname )
246
+ else :
247
+ options .gname = get_co_group (options .gid )["Name" ]
248
+
249
+ print ('Creating new Identifier for project "%s"\n '
250
+ 'for CO Group "%s" (%s)'
251
+ % (options .project , options .gname , options .gid ))
252
+ print ("" )
253
+
254
+ resp = add_project_identifier_to_group (options .gid , options .project )
255
+
256
+ print ("Server Response:" )
257
+ print (json .dumps (resp , indent = 2 , sort_keys = True ))
239
258
240
- add_project_identifier_to_group (options .gid , options .project )
259
+ new_identifier = get_identifier (resp ["Id" ])
260
+ print ("" )
261
+ print ("New Identifier Object:" )
262
+ print (json .dumps (new_identifier , indent = 2 , sort_keys = True ))
241
263
242
264
# no exceptions, must have worked
265
+ print ("" )
243
266
print (":thumbsup:" )
244
267
245
268
You can’t perform that action at this time.
0 commit comments