refactored overlay class
overlay.GetOverlay(name) returns now an error if the overlay doesn't exist. This is the most canonical way to act if there is no overlay.
This commit is contained in:
committed by
Jonathon Anderson
parent
c17fe8d512
commit
6f4fd60d8f
@@ -14,7 +14,10 @@ import (
|
||||
Creates '/etc/hosts' from the host template.
|
||||
*/
|
||||
func Hostfile() (err error) {
|
||||
overlay_ := overlay.GetOverlay("host")
|
||||
overlay_, err := overlay.GetOverlay("host")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
hostTemplate := path.Join(overlay_.Rootfs(), "/etc/hosts.ww")
|
||||
if !(util.IsFile(hostTemplate)) {
|
||||
return fmt.Errorf("'the overlay template '/etc/hosts.ww' does not exists in 'host' overlay")
|
||||
|
||||
Reference in New Issue
Block a user