def _statserver(self, attrib_list=None): """Get the server config from the pbs server""" if attrib_list: self._list_2_attrib(attrib_list) else: self.attribs = 'NULL' self._connect() serverinfo = pbs.pbs_statserver(self.con, self.attribs, 'NULL') self._disconnect() self._list_2_dict(serverinfo, server)
def main(): pbs_server = pbs.pbs_default() if not pbs_server: print 'No default server' sys.exit(1) con = pbs.pbs_connect(pbs_server) attr_l = pbs.new_attrl(1) attr_l[0].name = 'pbs_version' server_info = pbs.pbs_statserver(con, attr_l, 'NULL') for entry in server_info: print entry.name for attrib in entry.attribs: print '\t', attrib.name, ' = ', attrib.value