PBM govmomi dependencies
This commit is contained in:
committed by
System Administrator
parent
199465c3a5
commit
23ee1745d3
2
vendor/github.com/vmware/govmomi/vim25/xml/extras.go
generated
vendored
2
vendor/github.com/vmware/govmomi/vim25/xml/extras.go
generated
vendored
@@ -23,6 +23,8 @@ import (
|
||||
|
||||
var xmlSchemaInstance = Name{Space: "http://www.w3.org/2001/XMLSchema-instance", Local: "type"}
|
||||
|
||||
var xsiType = Name{Space: "xsi", Local: "type"}
|
||||
|
||||
var stringToTypeMap = map[string]reflect.Type{
|
||||
"xsd:boolean": reflect.TypeOf((*bool)(nil)).Elem(),
|
||||
"xsd:byte": reflect.TypeOf((*int8)(nil)).Elem(),
|
||||
|
||||
4
vendor/github.com/vmware/govmomi/vim25/xml/read.go
generated
vendored
4
vendor/github.com/vmware/govmomi/vim25/xml/read.go
generated
vendored
@@ -272,13 +272,15 @@ var (
|
||||
func (p *Decoder) typeForElement(val reflect.Value, start *StartElement) reflect.Type {
|
||||
t := ""
|
||||
for i, a := range start.Attr {
|
||||
if a.Name == xmlSchemaInstance {
|
||||
if a.Name == xmlSchemaInstance || a.Name == xsiType {
|
||||
t = a.Value
|
||||
// HACK: ensure xsi:type is last in the list to avoid using that value for
|
||||
// a "type" attribute, such as ManagedObjectReference.Type for example.
|
||||
// Note that xsi:type is already the last attribute in VC/ESX responses.
|
||||
// This is only an issue with govmomi simulator generated responses.
|
||||
// Proper fix will require finding a few needles in this xml package haystack.
|
||||
// Note: govmomi uses xmlSchemaInstance, other clients (e.g. rbvmomi) use xsiType.
|
||||
// They are the same thing to XML parsers, but not to this hack here.
|
||||
x := len(start.Attr) - 1
|
||||
if i != x {
|
||||
start.Attr[i] = start.Attr[x]
|
||||
|
||||
Reference in New Issue
Block a user