Changeset 0a49bd7 for fedd/fedd_image.py
- Timestamp:
- Jan 15, 2011 5:52:15 PM (14 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master
- Children:
- aaf7f41
- Parents:
- ac15159 (diff), 944b746 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Ted Faber <faber@…> (01/15/11 17:51:40)
- git-committer:
- Ted Faber <faber@…> (01/15/11 17:52:15)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/fedd_image.py
rac15159 r0a49bd7 8 8 9 9 from federation import topdl 10 from federation.proof import proof 10 11 from federation.remote_service import service_caller 11 12 from federation.client_lib import client_opts, exit_with_fault, RPCException, \ 12 wrangle_standard_options, do_rpc, get_experiment_names, save_certfile 13 wrangle_standard_options, do_rpc, get_experiment_names, save_certfile,\ 14 log_authentication 13 15 14 16 … … 17 19 client_opts.__init__(self) 18 20 self.add_option("--experiment_cert", dest="exp_certfile", 19 type="string", help="experiment certificate file") 21 action='callback', callback=self.expand_file, type='str', 22 help="experiment certificate file") 20 23 self.add_option("--experiment_name", dest="exp_name", 21 24 type="string", help="human readable experiment name") 22 self.add_option("--output", dest="outfile", type="string", 25 self.add_option("--output", dest="outfile", 26 action='callback', callback=self.expand_file, type='str', 23 27 help="output image file") 24 28 self.add_option("--format", dest="format", type="choice", … … 38 42 help="Size of output in pixels (diagrams are square") 39 43 self.add_option("--file", dest="file", 44 action='callback', callback=self.expand_file, type='str', 40 45 help="experiment description file") 41 46 self.add_option("--group", dest="group", action="append", default=[], … … 293 298 caller=service_caller('Info'), responseBody="InfoResponseBody") 294 299 300 proof = proof.from_dict(resp_dict.get('proof', {})) 301 if proof and opts.auth_log: 302 log_authentication(opts.auth_log, 'Image', 'succeeded', proof) 295 303 return extract_topo_from_message(resp_dict, opts.serialize_only) 296 304 … … 333 341 (opts, args) = parser.parse_args() 334 342 335 # Note that if we're converting a local topdl file, the absence of a cert may336 # not be a big deal. It's checked if needed below343 # Note that if we're converting a local topdl file, the absence of a cert or 344 # abac directory may not be a big deal. It's checked if needed below 337 345 try: 338 346 cert, fid, url = wrangle_standard_options(opts) 339 347 except RuntimeError, e: 340 348 cert = None 341 print >>sys.stderr, "Warning: %s e"349 print >>sys.stderr, "Warning: %s" % e 342 350 343 351 … … 371 379 top = get_experiment_topo(opts, cert, url) 372 380 except RPCException, e: 373 exit_with_fault(e )381 exit_with_fault(e, 'image', opts) 374 382 except RuntimeError, e: 375 383 sys.exit("%s" % e) … … 383 391 except RPCException, e: 384 392 print >>sys.stderr, "Cannot extract a topology from %s" % opts.file 385 exit_with_fault(e )393 exit_with_fault(e, 'image', opts) 386 394 except RuntimeError, e: 387 395 sys.exit("Cannot extract a topology from %s: %s" % (opts.file, e))
Note: See TracChangeset
for help on using the changeset viewer.