Skip to content

pystemd.run does not raise exception on collect #36

@aleivag

Description

@aleivag

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions