File tree Expand file tree Collapse file tree
openstack/objectstorage/v1/containers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ package containers
33import (
44 "encoding/json"
55 "fmt"
6- "strconv"
76 "strings"
87 "time"
98
@@ -105,17 +104,16 @@ type GetHeader struct {
105104 StoragePolicy string `json:"X-Storage-Policy"`
106105 TempURLKey string `json:"X-Container-Meta-Temp-URL-Key"`
107106 TempURLKey2 string `json:"X-Container-Meta-Temp-URL-Key-2"`
108- Timestamp float64 `json:"- "`
107+ Timestamp float64 `json:"X-Timestamp,string "`
109108}
110109
111110func (r * GetHeader ) UnmarshalJSON (b []byte ) error {
112111 type tmp GetHeader
113112 var s struct {
114113 tmp
115- Write string `json:"X-Container-Write"`
116- Read string `json:"X-Container-Read"`
117- Date gophercloud.JSONRFC1123 `json:"Date"`
118- Timestamp string `json:"X-Timestamp"`
114+ Write string `json:"X-Container-Write"`
115+ Read string `json:"X-Container-Read"`
116+ Date gophercloud.JSONRFC1123 `json:"Date"`
119117 }
120118
121119 err := json .Unmarshal (b , & s )
@@ -130,11 +128,6 @@ func (r *GetHeader) UnmarshalJSON(b []byte) error {
130128
131129 r .Date = time .Time (s .Date )
132130
133- r .Timestamp , err = strconv .ParseFloat (s .Timestamp , 64 )
134- if err != nil {
135- return err
136- }
137-
138131 return err
139132}
140133
Original file line number Diff line number Diff line change @@ -157,6 +157,7 @@ func TestGetContainer(t *testing.T) {
157157 TransID : "tx554ed59667a64c61866f1-0057b4ba37" ,
158158 Write : []string {"test2" , "user4" },
159159 StoragePolicy : "test_policy" ,
160+ Timestamp : 1471298837.95721 ,
160161 }
161162 actual , err := res .Extract ()
162163 th .AssertNoErr (t , err )
You can’t perform that action at this time.
0 commit comments