testing finished

This commit is contained in:
Chris Love 2015-11-11 22:42:36 +00:00
parent 671f68599c
commit 54b103b9c7
1 changed files with 8 additions and 11 deletions

View File

@ -381,7 +381,7 @@ func resourceVSphereVirtualMachineRead(d *schema.ResourceData, meta interface{})
var mvm mo.VirtualMachine
collector := property.DefaultCollector(client.Client)
if err := collector.RetrieveOne(context.TODO(), vm.Reference(), []string{"guest", "summary", "datastore"}, &mvm); err != nil {
if err := collector.RetrieveOne(context.TODO(), vm.Reference(), []string{"guest", "summary", "datastore","config.extraConfig"}, &mvm); err != nil {
return err
}
@ -437,21 +437,18 @@ func resourceVSphereVirtualMachineRead(d *schema.ResourceData, meta interface{})
d.Set("memory", mvm.Summary.Config.MemorySizeMB)
d.Set("cpu", mvm.Summary.Config.NumCpu)
log.Printf("[DEBUG] ===============================")
//log.Printf("[DEBUG] Get extra config ===============================")
//log.Printf("[DEBUG] Get extra config %v", mvm.Config)
//log.Printf("[DEBUG] Get extra config %v", mvm.Config.ExtraConfig)
if mvm.Config != nil && mvm.Config.ExtraConfig != nil && len(mvm.Config.ExtraConfig) > 0 {
log.Printf("[DEBUG] reading custom configs")
custom_configs := make(map[string]types.AnyType)
//TODO: can only set specific custom value, not everything
//Would need the config here
//custom_configs := make(map[string]types.AnyType)
for _, v := range mvm.Config.ExtraConfig {
value := v.GetOptionValue()
custom_configs[value.Key] = value.Value
log.Printf("[DEBUG] reading custom configs %s,%s",value.Key, value.Value)
//custom_configs[value.Key] = value.Value
log.Printf("[DEBUG] custom configs %s,%s",value.Key, value.Value)
}
d.Set("custom_configuration_parameters", custom_configs)
//d.Set("custom_configuration_parameters", custom_configs)
}
log.Printf("[DEBUG] ===============================")
d.Set("datastore", rootDatastore)
// Initialize the connection info