Design to import/export hook config file in PTL:
Description:
Design to import and export the hook config file.
Forum Discussion at http://community.pbspro.org/t/design-for-importing-hook-config-file-in-ptl/1550
Details:
File : lib/pbs_testlib.py
Class : Server
Interface-1:import_hook_config
import_hook_config(self, hook_name, hook_conf, hook_type, level=logging.INFO)
name: The name of the hook to import body to
type name: str
body: The body of the hook as a string.
hook_conf: body
hook_type: Type of the hook ("site" or "pbs")
type hook_type: str
returns: True on success.
raises: PbsManagerError
This method is used to import hook config file.
hook_body = """
{
cpus : {
enabled: True
}
}""
Example : self.import_hook_config("pbs_cgroups", hook_body, "site")
Interface-2: export_hook_config
export_hook_config(self, hook_name, hook_type)
hook_name: The name of the hook to export config from
type hook_name: str
hook_type: Type of the hook ("site" or "pbs")
type hook_type: str
return type : returns dict on success
raises: PbsManagerError
This method is used to export hook config file.
Example: out = self.export_hook_config("pbs_cgroups", "site")
out will have contents of "pbs_cgroups.CF" file.
Project Documentation Main Page