systemd/pystemd

pystemd.run does not raise exception on collect

Opened this issue · 0 comments

collect stop a pystemd.run from raising exception

In [15]: pystemd.run( 
    ...:     ['/bin/false'], 
    ...:     stdin=sys.stdin, stdout=sys.stdout,  
    ...:     wait=True, pty=True, collect=False, 
    ...:     name='mys.service', raise_on_fail=True,  
    ...: )                                                                                                          
---------------------------------------------------------------------------
PystemdRunError                           Traceback (most recent call last)
/home/aleivag/code/asg-lt/lt.py in <module>
      3     stdin=sys.stdin, stdout=sys.stdout,
      4     wait=True, pty=True, collect=False,
----> 5     name='mys.service', raise_on_fail=True,
      6 )

while

In [18]: pystemd.run( 
    ...:     ['/bin/false'], 
    ...:     stdin=sys.stdin, stdout=sys.stdout,  
    ...:     wait=True, pty=True, collect=True, 
    ...:     name='mys.service', raise_on_fail=True,  
    ...: )                                                                                                          
Out[18]: <pystemd.systemd1.unit.Unit at 0x7f703479ddd0>

In [19]:  

and both should raise exception