Skip to content

_do_post() errors #6

@wallnerryan

Description

@wallnerryan

in the function _do_post() at https://github.com/wallnerryan/scaleio-py/blob/master/scaleiopy/scaleio.py#L497 its hard to understand any error the happens in the stack.

For instance, if we see a runtime error like:

ERROR scaleio:_do_post | _do_post() - HTTP response error, data: {"message":"Only a single SDC may be mapped to this volume at a time","httpStatusCode":500,"errorCode":306}

It is impossible to know that by calling map_volume_to_sdc() because we don't get the response back. My suggestion here is to log the error, but return the response to let the client decipher the errors. Or to have a standard set of errors like CannotMapMultpleSdcsError for the one above, and return the error rather than raise which ends the execution.

again happy to help, but ran into the above situation where all I can get back is _do_post() - Communication error with ScaleIO gateway in a snippet like this:

>>> try:
...     resp = (sio.map_volume_to_sdc(sio.get_volume_by_name('testvol001'), sio.get_sdc_by_ip('192.168.50.12')))
... except Exception as e:
...     print e

@swevm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions