Skip to content

Commit

Permalink
model: controller: Keep Image default
Browse files Browse the repository at this point in the history
--keep-image defaults to true, we only try to remove an
image file if it is set to false.

Signed-off-by: Mark D Horn <[email protected]>
  • Loading branch information
mdhorn committed Nov 26, 2019
1 parent f2e376e commit a4f83fd
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 21 deletions.
6 changes: 0 additions & 6 deletions controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,6 @@ func Install(rootDir string, model *model.SystemInstall, options args.Args) erro
log.Warning(msg)
model.MakeISO = false
}
if model.KeepImage {
msg := "Flag --keep-image not valid for physical media; disabling"
fmt.Println(msg)
log.Warning(msg)
model.KeepImage = false
}
}

// prepare all the target block devices
Expand Down
3 changes: 0 additions & 3 deletions model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,9 +612,6 @@ func (si *SystemInstall) InteractiveOptionsValid() error {
if si.MakeISO {
return fmt.Errorf("Incompatible flag '--iso' for the interactive installer")
}
if si.KeepImage {
return fmt.Errorf("Incompatible flag '--keep-image' for the interactive installer")
}

return nil
}
12 changes: 0 additions & 12 deletions model/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,24 +636,12 @@ func TestInterActiveIsoFail(t *testing.T) {
t.Fatalf("Interactive should fail with ISO set to true")
}
}
func TestInterActiveKeepFail(t *testing.T) {
si := &SystemInstall{}
si.ClearInstallSelected()

si.KeepImage = true

if err := si.InteractiveOptionsValid(); err == nil {
t.Fatalf("Interactive should fail with KeepImage set to true")
}
}

func TestInterActivePass(t *testing.T) {
si := &SystemInstall{}
si.ClearInstallSelected()

si.Offline = false
si.MakeISO = false
si.KeepImage = false

if err := si.InteractiveOptionsValid(); err != nil {
t.Fatalf("Interactive should pass: %v", err)
Expand Down

0 comments on commit a4f83fd

Please sign in to comment.