Last change
on this file since 356 was
356,
checked in by martijk, 6 years ago
|
python3 compatible print #26732
|
-
Property svn:keywords set to
Id
|
File size:
592 bytes
|
Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | # Author: Bas van der Vlies <basv@sara.nl> |
---|
3 | # Date : 17 Aug 2001 |
---|
4 | # Desc. : print version of pbs_server |
---|
5 | # |
---|
6 | # CVS info: |
---|
7 | # $Id: pbs_version.py 356 2018-04-11 11:57:42Z martijk $ |
---|
8 | # |
---|
9 | # |
---|
10 | import sys |
---|
11 | import pbs |
---|
12 | |
---|
13 | def main(): |
---|
14 | |
---|
15 | pbs_server = pbs.pbs_default() |
---|
16 | if not pbs_server: |
---|
17 | print('No default server') |
---|
18 | sys.exit(1) |
---|
19 | |
---|
20 | con = pbs.pbs_connect(pbs_server) |
---|
21 | |
---|
22 | attr_l = pbs.new_attrl(1) |
---|
23 | attr_l[0].name = 'pbs_version' |
---|
24 | |
---|
25 | server_info = pbs.pbs_statserver(con, attr_l, 'NULL') |
---|
26 | for entry in server_info: |
---|
27 | print(entry.name) |
---|
28 | for attrib in entry.attribs: |
---|
29 | print('\t', attrib.name, ' = ', attrib.value) |
---|
30 | |
---|
31 | main() |
---|
Note: See
TracBrowser
for help on using the repository browser.