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() {
|
||||
params := params{"ceph","admin","/etc/ceph/ceph.conf"}
|
||||
connection,err := rados.NewConnWithClusterAndUser(params.cluster,params.user)
|
||||
fmt.Println("Creating connection object")
|
||||
conn,err := rados.NewConn()
|
||||
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 {
|
||||
log.Fatalln("Cannot read config file\n")
|
||||
poolnames,err := conn.ListPools()
|
||||
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 {
|
||||
cluster string
|
||||
user string
|
||||
config string
|
||||
}
|
||||
// type params struct {
|
||||
// cluster string
|
||||
// user string
|
||||
// config string
|
||||
// }
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user