Skip to content

Commit

Permalink
Issue machine-drivers#21: base: Return error when BundleName is not set
Browse files Browse the repository at this point in the history
An empty bundle name does not make sense, so if its value is "", this
means it was not set while it's mandatory. Return an error when this
happens.

This fixes crc-org#21
  • Loading branch information
cfergeau committed Aug 26, 2019
1 parent 34d5b60 commit edeebfe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libmachine/drivers/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ func (d *BaseDriver) ResolveStorePath(file string) string {
}

// Returns the name of the bundle which was used to create this machine
func (d* BaseDriver) GetBundleName() (string, error) {
func (d *BaseDriver) GetBundleName() (string, error) {
if d.BundleName == "" {
return "", errors.New("Bundle name is not set")
}
return d.BundleName, nil
}

0 comments on commit edeebfe

Please sign in to comment.