From c2e7dbdcf7ba69ce068fc06a01aac9178785e98a Mon Sep 17 00:00:00 2001 From: Fabio Rauber Date: Tue, 26 Mar 2019 11:47:16 -0300 Subject: [PATCH] Only download boot2docker ISO when necessary --- xenserver/xenserver.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/xenserver/xenserver.go b/xenserver/xenserver.go index 47802c2..236f367 100644 --- a/xenserver/xenserver.go +++ b/xenserver/xenserver.go @@ -305,13 +305,14 @@ func (d *Driver) GetState() (state.State, error) { } func (d *Driver) PreCreateCheck() error { - // Downloading boot2docker to cache should be done here to make sure - // that a download failure will not leave a machine half created. - b2dutils := mcnutils.NewB2dUtils(d.StorePath) - if err := b2dutils.UpdateISOCache(d.Boot2DockerURL); err != nil { - return err + if d.osTemplateLabelName == "Other install media" { + // Downloading boot2docker to cache should be done here to make sure + // that a download failure will not leave a machine half created. + b2dutils := mcnutils.NewB2dUtils(d.StorePath) + if err := b2dutils.UpdateISOCache(d.Boot2DockerURL); err != nil { + return err + } } - return nil }