GENI-NSF / geni-tools

Omni, stitcher, GCF sample aggregate manager, and other GENI tools.
Other
11 stars 15 forks source link

Return the AM error if a call to a single AM fails #166

Open innnkkki opened 9 years ago

innnkkki commented 9 years ago

While working on the readyToLogin.py script I noticed that sometimes Omni returns an error when something is wrong (e.g. an AM doesn't speak the right version number) and sometimes it returns success (e.g. an AM times out)

I am not sure if this is a bug, since Omni might be talking to multiple AMs, but maybe if the '-a' flag is passed then the error should propagate all the way to the caller.

So: if you are doing a call to a single server and that single server returns an error, make Omni exit with that error

Imported from trac ticket #166, created by nriga on 08-29-2012 at 15:55, last modified: 05-15-2015 at 08:54

ahelsing commented 9 years ago

In all amhandler methods, if # of clients == 1, then auto-set the option "raise-error-on-v2-amapi-error". That should do it.

Trac comment by ahelsing on 01-21-2015 at 11:36

ahelsing commented 9 years ago

If we use that option of raising an error, then if there is an error the user does not get the nice command summary. For example:

Current:

10:42:16 INFO    : Status of Slice urn:publicid:IDN+ch.geni.net:ahtest+slice+ahtest:
10:42:23 INFO    :  ------------------------------------------------------
10:42:23 INFO    :  Completed sliverstatus:

  Options as run:
        aggregate: ['gpo-ig']
        configfile: my_oc
        framework: portal
        useSliceMembers: False

  Args: sliverstatus ahtest

  Result Summary: Slice urn:publicid:IDN+ch.geni.net:ahtest+slice+ahtest expires on 2015-02-01 00:00:00 UTC

Failed to get SliverStatus on ahtest at AM gpo-ig: Error from Aggregate: code 12. protogeni AM code: 12: No slice or aggregate here (PG log url - look here for details on any failures: https://boss.instageni.gpolab.bbn.com/spewlogfile.php3?logfile=4130db971578d7047f3e726b7294ec65).
Returned status of slivers on 0 of 1 possible aggregates. 
10:42:23 INFO    :  ======================================================

With this change:

11:24:04 INFO    : Status of Slice urn:publicid:IDN+ch.geni.net:ahtest+slice+ahtest:
11:24:10 ERROR   :  {'output': 'No slice or aggregate here', 'code': {'protogeni_error_log': 'urn:publicid:IDN+instageni.gpolab.bbn.com+log+3877e05a9de371c0fe43553323fa0966', 'am_type': 'protogeni', 'geni_code': 12, 'am_code': 12, 'protogeni_error_url': 'https://boss.instageni.gpolab.bbn.com/spewlogfile.php3?logfile=3877e05a9de371c0fe43553323fa0966'}, 'value': 0}

Is this what we want?

Trac comment by ahelsing on 01-23-2015 at 11:27