~ed.so/duplicity/reuse-passphrase-for-signing-fix

« back to all changes in this revision

Viewing changes to duplicity/gpg.py

  • Committer: loafman
  • Date: 2009-04-21 18:26:26 UTC
  • Revision ID: vcs-imports@canonical.com-20090421182626-rmz273hsaaw8g5i3
bug #25976: Password requested when not needed.
https://savannah.nongnu.org/bugs/?25976

Show diffs side-by-side

added added

removed removed

Lines of Context:
147
147
        return res
148
148
 
149
149
    def gpg_failed(self):
150
 
        self.print_log(0)
151
 
        log.FatalError("GPG Failed, see log above", log.ErrorCode.gpg_failed)
152
 
 
153
 
    def print_log(self, level):
154
 
        log.Log("===== Begin GnuPG log =====", level)
 
150
        msg = "GPG Failed, see log below:\n"
 
151
        msg += "===== Begin GnuPG log =====\n"
155
152
        self.logger_fp.seek(0)
156
153
        for line in self.logger_fp:
157
 
            log.Log(line.strip(), level)
158
 
        log.Log("===== End GnuPG log =====", level)
 
154
            msg += line.strip() + "\n"
 
155
        msg += "===== End GnuPG log =====\n"
 
156
        raise GPGError, msg
159
157
 
160
158
    def close(self):
161
159
        if self.encrypt:
187
185
                self.gpg_process.wait()
188
186
            except:
189
187
                self.gpg_failed()
190
 
        self.print_log(5)
191
188
        self.logger_fp.close()
192
189
        self.closed = 1
193
190