Logical fix
parent
70cb80c176
commit
7073cc64df
|
@ -26,7 +26,7 @@ func get_pool_size(cephconn *Cephconnection, params *Params) *Monanswer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func get_pg_by_pool(cephconn *Cephconnection, params *Params) *[]PlacementGroups {
|
func get_pg_by_pool(cephconn *Cephconnection, params *Params) *[]PlacementGroup {
|
||||||
monjson, err := json.Marshal(Moncommand{Prefix: "pg ls-by-pool", Poolstr: params.pool, Format: "json"})
|
monjson, err := json.Marshal(Moncommand{Prefix: "pg ls-by-pool", Poolstr: params.pool, Format: "json"})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Can't marshal json mon query. Error: %v", err)
|
log.Fatalf("Can't marshal json mon query. Error: %v", err)
|
||||||
|
@ -36,7 +36,7 @@ func get_pg_by_pool(cephconn *Cephconnection, params *Params) *[]PlacementGroups
|
||||||
log.Fatalf("Failed exec monCommand. Error: %v", err)
|
log.Fatalf("Failed exec monCommand. Error: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
monanswer := []PlacementGroups{}
|
monanswer := []PlacementGroup{}
|
||||||
if err := json.Unmarshal([]byte(monrawanswer), &monanswer); err != nil {
|
if err := json.Unmarshal([]byte(monrawanswer), &monanswer); err != nil {
|
||||||
log.Fatalf("Can't parse monitor answer. Error: %v", err)
|
log.Fatalf("Can't parse monitor answer. Error: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ func main() {
|
||||||
monanswersize.Pool, monanswersize.Size, monanswersize.Pool, monanswersize.Pool)
|
monanswersize.Pool, monanswersize.Size, monanswersize.Pool, monanswersize.Pool)
|
||||||
}
|
}
|
||||||
|
|
||||||
monanswerpgs := get_pg_by_pool(cephconn, params)
|
placementGroups := get_pg_by_pool(cephconn, params)
|
||||||
log.Println(monanswerpgs)
|
log.Println(placementGroups)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
4
types.go
4
types.go
|
@ -32,7 +32,7 @@ type Monanswer struct {
|
||||||
Size int `json:"size,omitempty"`
|
Size int `json:"size,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (times *PlacementGroups) StringsToTimes() {
|
func (times *PlacementGroup) StringsToTimes() {
|
||||||
const LongForm = "2006-01-02 15:04:05.000000"
|
const LongForm = "2006-01-02 15:04:05.000000"
|
||||||
times.Last_fresh, _ = time.Parse(LongForm, times.Last_fresh_str)
|
times.Last_fresh, _ = time.Parse(LongForm, times.Last_fresh_str)
|
||||||
times.Last_change, _ = time.Parse(LongForm, times.Last_fresh_str)
|
times.Last_change, _ = time.Parse(LongForm, times.Last_fresh_str)
|
||||||
|
@ -51,7 +51,7 @@ func (times *PlacementGroups) StringsToTimes() {
|
||||||
times.Last_scrub, _ = time.Parse(LongForm, times.Last_scrub_str)
|
times.Last_scrub, _ = time.Parse(LongForm, times.Last_scrub_str)
|
||||||
}
|
}
|
||||||
|
|
||||||
type PlacementGroups struct {
|
type PlacementGroup struct {
|
||||||
Pgid string `json:"pgid"`
|
Pgid string `json:"pgid"`
|
||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
Reported_seq string `json:"reported_seq"`
|
Reported_seq string `json:"reported_seq"`
|
||||||
|
|
Loading…
Reference in New Issue