summaryrefslogtreecommitdiff
path: root/libvirt/utils_volume.go
diff options
context:
space:
mode:
Diffstat (limited to 'libvirt/utils_volume.go')
-rw-r--r--libvirt/utils_volume.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/libvirt/utils_volume.go b/libvirt/utils_volume.go
index 1c97cff7..457bacb9 100644
--- a/libvirt/utils_volume.go
+++ b/libvirt/utils_volume.go
@@ -50,15 +50,15 @@ func (i *localImage) Import(copier func(io.Reader) error, vol libvirtxml.Storage
return fmt.Errorf("Error while opening %s: %s", i.path, err)
}
- if fi, err := file.Stat(); err != nil {
+ fi, err := file.Stat()
+ if err != nil {
return err
- } else {
- // we can skip the upload if the modification times are the same
- if vol.Target.Timestamps != nil && vol.Target.Timestamps.Mtime != "" {
- if fi.ModTime() == timeFromEpoch(vol.Target.Timestamps.Mtime) {
- log.Printf("Modification time is the same: skipping image copy")
- return nil
- }
+ }
+ // we can skip the upload if the modification times are the same
+ if vol.Target.Timestamps != nil && vol.Target.Timestamps.Mtime != "" {
+ if fi.ModTime() == timeFromEpoch(vol.Target.Timestamps.Mtime) {
+ log.Printf("Modification time is the same: skipping image copy")
+ return nil
}
}