Comment

Comment by ClutchBand

Maybe I am off here, but I do something a bit more simple

``` def issue_command(self, command):

        if not str(command):
            
            response = None
            
            logger.error('Command argument must be string')
        
        else:
            
            response = os.system(command)
            
            if response != 0:
                
               logger.error('Command returned non-zero status: {}'.format(command))
                
               exit(1)

        return response
```
parent ClutchBand 8 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton