Don't touch non-existent pubring.gpg and secring.gpg, let GnuPG handle it.

feature/documentation-builds-html
Isis Lovecruft 2013-04-15 00:48:06 +00:00
parent 25a10567d0
commit 8f2204f464
No known key found for this signature in database
GPG Key ID: A3ADB67A2CDB8B35
1 changed files with 10 additions and 13 deletions

View File

@ -256,20 +256,17 @@ class GPG(object):
pubring = 'pubring.gpg' if pubring is None else _fix_unsafe(pubring)
self.secring = os.path.join(self.gpghome, secring)
self.pubring = os.path.join(self.gpghome, pubring)
## XXX should eventually be changed throughout to 'secring', but until
## then let's not break backward compatibility
self.keyring = self.pubring
for ring in [self.secring, self.pubring]:
if ring and not os.path.isfile(ring):
with open(ring, 'a+') as ringfile:
ringfile.write("")
ringfile.flush()
try:
assert _has_readwrite(ring), \
("Need r+w for %s" % ring)
except AssertionError as ae:
logger.debug(ae.message)
#for ring in [self.secring, self.pubring]:
# if ring and not os.path.isfile(ring):
# with open(ring, 'a+') as ringfile:
# ringfile.write("")
# ringfile.flush()
# try:
# assert util._has_readwrite(ring), \
# ("Need r+w for %s" % ring)
# except AssertionError as ae:
# logger.debug(ae.message)
self.options = _sanitise(options) if options else None