Skip to content

Commit 28b39ed

Browse files
committed
fix: vcsim -load Datastore summary.url property
PR #3705 refactored Datastore access, part of which uses the Datastore summary.url property instead of info.url Also fix the Datastore urls for local paths, such as govc object.save of a vcsim instance Signed-off-by: Doug MacEachern <[email protected]>
1 parent e887ea4 commit 28b39ed

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

govc/test/vcsim.bats

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,10 @@ EOF
564564

565565
run govc host.portgroup.add -host DC0_H0 -vswitch vSwitch0 bridge
566566
assert_success # issue #2016
567+
568+
# make sure we can write the save/load-ed Datastore
569+
run govc import.ova "$GOVC_IMAGES/$TTYLINUX_NAME.ova"
570+
assert_success
567571
}
568572

569573
@test "vcsim trace file" {

simulator/datastore.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,19 @@ func (ds *Datastore) model(m *Model) error {
4949
return err
5050
}
5151

52+
info.Url = dir
53+
} else {
54+
// rewrite local path from a saved vcsim instance
55+
dir, err := m.createTempDir(path.Base(u.Path))
56+
if err != nil {
57+
return err
58+
}
59+
5260
info.Url = dir
5361
}
62+
63+
ds.Summary.Url = info.Url
64+
5465
return nil
5566
}
5667

0 commit comments

Comments
 (0)