cephfs admin: move rmFlags type to a file for flags handling

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2020-11-30 15:43:24 -05:00 committed by mergify[bot]
parent 36abb07dc5
commit 2f1ee70242
2 changed files with 18 additions and 15 deletions

18
cephfs/admin/flags.go Normal file
View File

@ -0,0 +1,18 @@
// +build !luminous,!mimic
package admin
type rmFlags struct {
force bool
}
func (f rmFlags) Update(m map[string]string) map[string]interface{} {
o := make(map[string]interface{})
for k, v := range m {
o[k] = v
}
if f.force {
o["force"] = true
}
return o
}

View File

@ -143,18 +143,3 @@ func modeString(m int, force bool) string {
func uint64String(v uint64) string {
return strconv.FormatUint(uint64(v), 10)
}
type rmFlags struct {
force bool
}
func (f rmFlags) Update(m map[string]string) map[string]interface{} {
o := make(map[string]interface{})
for k, v := range m {
o[k] = v
}
if f.force {
o["force"] = true
}
return o
}