NetApp / netappdvp

A Docker volume plugin for NetApp storage
96 stars 33 forks source link

azgo: Handle SendZapi HTTP Responses #40

Closed dccurtis closed 8 years ago

dccurtis commented 8 years ago

SendZapi returns the HTTP response (http.Response has Status and Header) and an error from http.Client. This error is for a http.Client failure which must be rare since we panic if it happens.

The callers of SendZapi should be interested not only with this error but also the HTTP status codes themselves. The error is propagated back to the callers of ExecuteUsing and the backend drivers are silently missing ZAPI response problems.

For example, specifying invalid credentials in the ontap-nas.json config file:

root@vagrant-ubuntu-trusty-64:~# sudo netappdvp --config=/etc/netappdvp/ontap-nas.json ERRO[0004] Problem initializing storage driver: 'ontap-nas' error: Problem validating OntapNASStorageDriver error: Could not determine system version for admin@CXE

The ONTAPNASStorageDriver Validate() function is skipping the invalid credential error and instead returning the wrong error.