I am trying to set a label for an ExtraInfo value on a Worker, through the ‘ExtraInfoDictionary’ and then also set the value of one of the ExtraInfo# parameters on a range of Workers for later use.
I’m approaching this by trying to get the ExtraInfoDictionary within Python, so I can see what is in it and then make changes, but I am clearly doing something wrong because although the docs suggest that ExtraInfoDictionary for Workers is a dictionary of string:string - I cannot use the typical python dictionary.keys() to get a list of current key/value pairs.
Can someone suggest how this can be done, with a sample code snippet? What I get back looks like I am not properly resolving the object being passed by .NET. What’s the right way to get this dictionary for use in Python?
Just to be sure we are on the same page here, the ExtraInfoDictionary and the ExtraInfo# keys are not the same thing. The Worker has 10 ExtraInfo# slots that are displayed in the Workers panel list as columns, and the Dictionary is for the extra Key/Value Pairs that can be added when 10 are not enough, but have no UI representation.
Thanks, that was my misunderstanding. I see in the UI that the 10 displayed ExtraInfo# slots may also have custom labels, and I wanted to both change the text for the label for ExtraInfo6 to something describing the contents as well as store information in ExtraInfo6. I see the information storing through SaveSettings, but did not see a way to change the label for ExtraInfo6 shown in the UI through Python.
What would be an approach to programmatically changing the label text shown in the UI for ExtraInfo6?
The Custom Labels for the Worker ExtraInfo columns are configured in the Repository Options dialog, so you need to set them there. I could not locate a dedicated method for setting those options, but deadlinecommand can do it, and the Python API can call commands, so this works:
ClientUtils.ExecuteCommand (["SetRepositoryOption", "SlaveExtraInfo0Name", "Bobo Was Here"])