ceph: zones.Zones.WriteCephConfig() and ceph.Config.WriteTo() [WIP]

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-09-04 19:45:04 +00:00
parent 1037ed4bae
commit 9e8a19d00d
2 changed files with 20 additions and 0 deletions
+12
View File
@@ -16,3 +16,15 @@ func (m *Zones) GetCephConfig() (*ceph.Config, error) {
r := bytes.NewReader(data)
return ceph.NewConfigFromReader(r)
}
// WriteCephConfig writes the ceph.conf file
func (m *Zones) WriteCephConfig(cfg *ceph.Config) error {
f, err := m.CreateTruncFile("ceph.conf")
if err != nil {
return err
}
defer f.Close()
_, err = cfg.WriteTo(f)
return err
}