diff --git a/api/operator.go b/api/operator.go index e4bf8a88f..e05b9103f 100644 --- a/api/operator.go +++ b/api/operator.go @@ -320,7 +320,7 @@ func (op *Operator) LicenseGet(q *QueryOptions) (*LicenseReply, *QueryMeta, erro req.setQueryOptions(q) var reply LicenseReply - _, resp, err := op.c.doRequest(req) + rtt, resp, err := op.c.doRequest(req) if err != nil { return nil, nil, err } @@ -331,9 +331,13 @@ func (op *Operator) LicenseGet(q *QueryOptions) (*LicenseReply, *QueryMeta, erro } err = json.NewDecoder(resp.Body).Decode(&reply) - if err == nil { - return &reply, nil, nil + if err != nil { + return nil, nil, err } - return nil, nil, err + qm := &QueryMeta{} + parseQueryMeta(resp, qm) + qm.RequestTime = rtt + + return &reply, qm, nil } diff --git a/vendor/github.com/hashicorp/nomad/api/operator.go b/vendor/github.com/hashicorp/nomad/api/operator.go index e4bf8a88f..e05b9103f 100644 --- a/vendor/github.com/hashicorp/nomad/api/operator.go +++ b/vendor/github.com/hashicorp/nomad/api/operator.go @@ -320,7 +320,7 @@ func (op *Operator) LicenseGet(q *QueryOptions) (*LicenseReply, *QueryMeta, erro req.setQueryOptions(q) var reply LicenseReply - _, resp, err := op.c.doRequest(req) + rtt, resp, err := op.c.doRequest(req) if err != nil { return nil, nil, err } @@ -331,9 +331,13 @@ func (op *Operator) LicenseGet(q *QueryOptions) (*LicenseReply, *QueryMeta, erro } err = json.NewDecoder(resp.Body).Decode(&reply) - if err == nil { - return &reply, nil, nil + if err != nil { + return nil, nil, err } - return nil, nil, err + qm := &QueryMeta{} + parseQueryMeta(resp, qm) + qm.RequestTime = rtt + + return &reply, qm, nil }