Quantcast
Channel: VMware Communities : All Content - vSphere Management SDK
Viewing all articles
Browse latest Browse all 1860

ExtendedFault message, variable substitution

$
0
0

I'm having trouble substituting strings in error messages that I've defined via ExtensionManager.

 

I define a couple of tasks and faults and added the localization resources. I read documentation indicating that I could do variable substitution in my localized strings (http://communities.vmware.com/# http://pubs.vmware.com/vsphere-55/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc%2Fvmodl.LocalizableMessage.html).

 

For example, if my localized string is "The IP {ip} is already taken", then I could substitute {ip} with a "127.0.0.1".

 

I expected the vsphere GUI to show me the error message "The IP 127.0.0.1 is already taken" but I only get "The IP is already taken".

 

I explored the error object in the MOB and it appears fine. The key value pair ip/127.0.0.1 is definitely set. Am I using it wrong? I'm using vsphere 5.1.

 

------------------------------------------------

 

My extension defines the following localization resource (type=fault):

 

my_fault.summary = "The IP {ip} is already taken"

 

Data Object Type: ExtendedFault
Parent Managed Object ID: task-1098
Property Path: info.error

Properties

NAMETYPEVALUE
dataKeyValue[]
data["ip"]KeyValue
dynamicPropertyDynamicProperty[]Unset
dynamicTypestringUnset
faultCauseMethodFaultUnset
faultMessageLocalizableMessage[]Unset
faultTypeIdstring"my_fault"

 

Data Object Type: KeyValue
Parent Managed Object ID: task-1099
Property Path: info.error.data["ip"]

Properties

NAMETYPEVALUE
dynamicPropertyDynamicProperty[]Unset
dynamicTypestringUnset
keystring"ip"
valuestring"127.0.0.1"

Viewing all articles
Browse latest Browse all 1860

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>