zones: introduce Zones.GetCephConfig() accessor for m/ceph.conf
Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package zones
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
"git.jpi.io/amery/jpictl/pkg/ceph"
|
||||
)
|
||||
|
||||
// GetCephConfig reads the ceph.conf file
|
||||
func (m *Zones) GetCephConfig() (*ceph.Config, error) {
|
||||
data, err := m.ReadFile("ceph.conf")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
r := bytes.NewReader(data)
|
||||
return ceph.NewConfigFromReader(r)
|
||||
}
|
||||
Reference in New Issue
Block a user