Changeset 245


Ignore:
Timestamp:
10/14/09 16:12:34 (10 years ago)
Author:
sander
Message:

Pass a string command to Popen on Windows

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/factory/src/backends/cli.py

    r163 r245  
    1010import os 
    1111import logging 
     12import platform 
    1213import subprocess 
    1314 
     
    4748                command  = self.parse(self.command) 
    4849                result   = self.parse(self.result) 
    49                 process  = self.execute(command.split()) 
     50 
     51                if platform.system() == 'Windows': 
     52                        # Popen needs a string on Windows 
     53                        process  = self.execute(command) 
     54                else 
     55                        process  = self.execute(command.split()) 
    5056 
    5157                if process[0] > 0: 
    52                         raise CLIException('The command `%s` returned with a non-zero exit status' % command, True) 
     58                        raise CLIException('The command `%s` returned with a non-zero exit status (%s, %s).' % (command, process[1], process[2]), True) 
    5359 
    5460                logging.info('CLI converted %s to %s' % (self.source_path, result)) 
Note: See TracChangeset for help on using the changeset viewer.