Links
- Link to discussion on Developer Forum: http://community.pbspro.org/t/design-manager-should-use-python-lists-for-string-arrays/1592
- Link to issue: <issue link if available>
- Link to pull request: https://github.com/PBSPro/pbspro/pull/1122
There are a lot of string arrays in PBS, and trying to handle them in PTL is difficult when you need to worry about quoting strings with spaces, commas, etc.
The easiest way of solving this problem is to use a python list with the strings for the value of the string array.
Here's a current example of hook events, taken from the cgroups hook test:
events = '"execjob_begin,execjob_launch,execjob_attach,'
events += 'execjob_epilogue,execjob_end,exechost_startup,'
events += 'exechost_periodic,execjob_resize,execjob_abort"'
a = {'enabled': 'True',
'freq': '10',
'alarm': 30,
'event': events}
Here's what it would look like with the change:
events = ['execjob_begin', 'execjob_launch', 'execjob_attach',
'execjob_epilogue', 'execjob_end', 'exechost_startup',
'exechost_periodic', 'execjob_resize', 'execjob_abort']
a = {'enabled': 'True',
'freq': '10',
'alarm': 30,
'event': events}
String array resources that are being set with only one string will still work, for example:
self.server.manager(MGR_CMD_SET, PBS_HOOK, {'events': 'execjob_begin'}, id='hook1')