Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »


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')
  • No labels