sdf
This commit is contained in:
parent
287fd560a8
commit
c271101ef1
17
ceph/ceph.go
17
ceph/ceph.go
|
|
@ -9,14 +9,19 @@ import (
|
||||||
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
params := params{"ceph","admin","/etc/ceph/ceph.conf"}
|
fmt.Println("Creating connection object")
|
||||||
connection,err := rados.NewConnWithClusterAndUser(params.cluster,params.user)
|
conn,err := rados.NewConn()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
log.Fatal("Cannot create Connection object\n")
|
||||||
}
|
}
|
||||||
fmt.Printf("%#v", connection)
|
conn.ReadConfigFile("/etc/ceph/ceph.conf")
|
||||||
|
conn.Connect()
|
||||||
|
defer conn.Shutdown()
|
||||||
|
|
||||||
if err = connection.ReadConfigFile(params.config); err != nil {
|
poolnames,err := conn.ListPools()
|
||||||
log.Fatalln("Cannot read config file\n")
|
if err != nil {
|
||||||
|
log.Fatal("Cannot list pools")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Printf("Pools: %v\n",poolnames)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
package main
|
// package main
|
||||||
|
|
||||||
const config = "/etc/ceph/ceph.conf"
|
// const config = "/etc/ceph/ceph.conf"
|
||||||
|
|
||||||
type params struct {
|
// type params struct {
|
||||||
cluster string
|
// cluster string
|
||||||
user string
|
// user string
|
||||||
config string
|
// config string
|
||||||
}
|
// }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user