Hacker News new | ask | show | jobs
by ClutchBand 2744 days ago
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
```