Skip to content

Commit

Permalink
Set vm.Ip to blank struct
Browse files Browse the repository at this point in the history
  • Loading branch information
subuk committed Aug 21, 2019
1 parent b6c22f4 commit 8ebcfc2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions src/vmango/dal/machinerep_libvirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ func (store *LibvirtMachinerep) fillVm(vm *domain.VirtualMachine, virDomain *lib
vm.Plan = domainConfig.Plan
vm.Creator = domainConfig.Creator
vm.SSHKeys = []*domain.SSHKey{}
vm.Ip = &domain.IP{}
for _, key := range domainConfig.SSHKeys {
vm.SSHKeys = append(vm.SSHKeys, &domain.SSHKey{Name: key.Name, Public: key.Public})
}
Expand Down
2 changes: 0 additions & 2 deletions src/vmango/dal/machinerep_libvirt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ func (suite *MachinerepLibvirtSuite) TestListOk() {
suite.Equal("test", twoVm.SSHKeys[0].Name)
expectedKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXJjuFhloSumFjJRrrZfSinBE0q4e/o0nKzt4QfkD3VR56rrrrCtjHh+/wcZcIdm9I9QODxoFoSSvrPNOzLj0lfF0f64Ic7fUnC4hhRBEeyo/03KVpUQcHWHjeex+5OHQXa8s5Xy/dytZkhdvDYOCgEpMgC2tU6tk/mVuk84Q03QEnSYJQuIgj8VwvxC+22aGSpLzXtenpdXr+O8s7dkuhHQjl1w6WbiLADv0I06bFwW8iB6p7aHZCqJUYAUYa4XaCjXdVwoKAE/J23s17XCZzY10YmBIikRQQIjpvRIbHArzO0om4++2KMnY8m6xoMp2imyceD/0fIVlAqhLTEaBP test@vmango"
suite.Equal(expectedKey, twoVm.SSHKeys[0].Public)
suite.Nil(twoVm.Ip)
suite.Equal("StubOs-1.0", twoVm.OS)
suite.Equal("x86_64", twoVm.Arch.String())
suite.Equal("stubuser", twoVm.Creator)
Expand Down Expand Up @@ -157,7 +156,6 @@ func (suite *MachinerepLibvirtSuite) TestGetOk() {
suite.Equal("test", machine.SSHKeys[0].Name)
expectedKey := "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXJjuFhloSumFjJRrrZfSinBE0q4e/o0nKzt4QfkD3VR56rrrrCtjHh+/wcZcIdm9I9QODxoFoSSvrPNOzLj0lfF0f64Ic7fUnC4hhRBEeyo/03KVpUQcHWHjeex+5OHQXa8s5Xy/dytZkhdvDYOCgEpMgC2tU6tk/mVuk84Q03QEnSYJQuIgj8VwvxC+22aGSpLzXtenpdXr+O8s7dkuhHQjl1w6WbiLADv0I06bFwW8iB6p7aHZCqJUYAUYa4XaCjXdVwoKAE/J23s17XCZzY10YmBIikRQQIjpvRIbHArzO0om4++2KMnY8m6xoMp2imyceD/0fIVlAqhLTEaBP test@vmango"
suite.Equal(expectedKey, machine.SSHKeys[0].Public)
suite.Nil(machine.Ip)
suite.Equal("StubOs-1.0", machine.OS)
suite.Equal("x86_64", machine.Arch.String())
suite.Equal("large", machine.Plan)
Expand Down

0 comments on commit 8ebcfc2

Please sign in to comment.