ceph: zones.Zones.WriteCephConfig() and ceph.Config.WriteTo()

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-09-04 19:45:04 +00:00
parent 75dee617ef
commit 5e57fe5f30
2 changed files with 41 additions and 0 deletions
+12
View File
@@ -31,6 +31,18 @@ func (m *Zones) GetCephConfig() (*ceph.Config, error) {
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
}
// GenCephConfig prepares a ceph.Config using the cluster information
func (m *Zones) GenCephConfig() (*ceph.Config, error) {
fsid, err := m.GetCephFSID()