4 log = logging.getLogger(__name__)
7 class CommandError(Exception):
14 log.debug('executing "%s"' % ' '.join(cmd))
15 pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE)
16 stdout, _ = pipe.communicate()
17 if pipe.returncode != 0:
18 raise CommandError('openssl exited with status %d' % (
23 def run_with_config(config_file, *args):
26 return run(cmd, '-config', config_file, '-batch', *args)