X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/53ce9b61336c5385eb2250267efa69613b5eaec7..75b4699bdfe75c714cc4163e0f726f4987541fa1:/sdk/go/arvados/keep_service.go diff --git a/sdk/go/arvados/keep_service.go b/sdk/go/arvados/keep_service.go index 9797440205..97a62fa7bb 100644 --- a/sdk/go/arvados/keep_service.go +++ b/sdk/go/arvados/keep_service.go @@ -10,24 +10,27 @@ import ( "net/http" "strconv" "strings" + "time" ) // KeepService is an arvados#keepService record type KeepService struct { - UUID string `json:"uuid"` - ServiceHost string `json:"service_host"` - ServicePort int `json:"service_port"` - ServiceSSLFlag bool `json:"service_ssl_flag"` - ServiceType string `json:"service_type"` - ReadOnly bool `json:"read_only"` + UUID string `json:"uuid"` + ServiceHost string `json:"service_host"` + ServicePort int `json:"service_port"` + ServiceSSLFlag bool `json:"service_ssl_flag"` + ServiceType string `json:"service_type"` + ReadOnly bool `json:"read_only"` + CreatedAt time.Time `json:"created_at"` + ModifiedAt time.Time `json:"modified_at"` } type KeepMount struct { - UUID string `json:"uuid"` - DeviceID string `json:"device_id"` - ReadOnly bool `json:"read_only"` - Replication int `json:"replication"` - StorageClasses []string `json:"storage_classes"` + UUID string `json:"uuid"` + DeviceID string `json:"device_id"` + ReadOnly bool `json:"read_only"` + Replication int `json:"replication"` + StorageClasses map[string]bool `json:"storage_classes"` } // KeepServiceList is an arvados#keepServiceList record @@ -127,6 +130,13 @@ func (s *KeepService) index(c *Client, url string) ([]KeepServiceIndexEntry, err scanner := bufio.NewScanner(resp.Body) sawEOF := false for scanner.Scan() { + if scanner.Err() != nil { + // If we encounter a read error (timeout, + // connection failure), stop now and return it + // below, so it doesn't get masked by the + // ensuing "badly formatted response" error. + break + } if sawEOF { return nil, fmt.Errorf("Index response contained non-terminal blank line") }