295 |
|
else: |
296 |
|
return False |
297 |
|
|
298 |
+ |
def py_sg_shutdown(): |
299 |
+ |
if sg_shutdown() == 0: |
300 |
+ |
return True |
301 |
+ |
else: |
302 |
+ |
return False |
303 |
+ |
|
304 |
+ |
def py_sg_snapshot(): |
305 |
+ |
if sg_snapshot() == 0: |
306 |
+ |
return True |
307 |
+ |
else: |
308 |
+ |
return False |
309 |
+ |
|
310 |
|
def py_sg_drop_privileges(): |
311 |
|
if sg_drop_privileges() == 0: |
312 |
|
return True |
609 |
|
raise StatgrabException, 'sg_get_process_stats() returned NULL' |
610 |
|
list = [] |
611 |
|
for i from 0 <= i < entries: |
612 |
< |
if s.process_name == NULL: |
613 |
< |
s.process_name = '' |
614 |
< |
if s.proctitle == NULL: |
615 |
< |
s.proctitle = '' |
612 |
> |
if s.process_name is NULL: |
613 |
> |
process_name = '' |
614 |
> |
else: |
615 |
> |
process_name = s.process_name |
616 |
> |
if s.proctitle is NULL: |
617 |
> |
proctitle = '' |
618 |
> |
else: |
619 |
> |
proctitle = s.proctitle |
620 |
|
list.append(Result( |
621 |
< |
{'process_name': s.process_name, |
622 |
< |
'proctitle' : s.proctitle, |
621 |
> |
{'process_name': process_name, |
622 |
> |
'proctitle' : proctitle, |
623 |
|
'pid' : s.pid, |
624 |
|
'parent' : s.parent, |
625 |
|
'pgid' : s.pgid, |