diff options
Diffstat (limited to 'base/utils.py')
-rw-r--r-- | base/utils.py | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/base/utils.py b/base/utils.py index 205c175bb..95d36cf1e 100644 --- a/base/utils.py +++ b/base/utils.py @@ -2222,9 +2222,9 @@ def Is_Process_Running(process_name): if output: for p in output.splitlines(): - cmd = "echo %s | awk {'print $2'}" %p + cmd = "echo '%s' | awk {'print $2'}" %p status,pid = commands.getstatusoutput(cmd) - cmd = "echo %s | awk {'print $11,$12'}" %p + cmd = "echo '%s' | awk {'print $11,$12'}" %p status,cmdline = commands.getstatusoutput(cmd) if pid : process[pid] = cmdline @@ -2250,36 +2250,3 @@ def remove(path, passwordObj = None, cksudo = False): log.debug("Failed to remove=%s "%path) -def validateDownloadFile(downloaded_file, digsig_file, req_checksum='', passwordObj = None): - calc_checksum = get_checksum(file(downloaded_file, 'r').read()) - log.debug("File checksum=%s" % calc_checksum) - - if req_checksum and req_checksum != calc_checksum: - return ERROR_FILE_CHECKSUM - - gpg = which('gpg',True) - if gpg: - cmd = '%s --no-permission-warning --keyserver pgp.mit.edu --recv-keys 0xA59047B9' % gpg - if passwordObj: - cmd = passwordObj.getAuthCmd()%cmd - - log.info("Receiving digital keys: %s" % cmd) - status, output = run(cmd, passwordObj) - log.debug(output) - - if status != 0: - return ERROR_UNABLE_TO_RECV_KEYS - - cmd = '%s --no-permission-warning --verify %s %s' % (gpg, digsig_file, downloaded_file) - if passwordObj: - cmd = passwordObj.getAuthCmd()%cmd - - log.debug("Verifying plugin with digital keys: %s" % cmd) - status, output = run(cmd,passwordObj) - log.debug(output) - log.debug("%s status: %d" % (gpg, status)) - - if status != 0: - return ERROR_DIGITAL_SIGN_BAD - - return ERROR_NONE |