summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2018-01-30 18:21:09 +0100
committerMichał Górny <mgorny@gentoo.org>2018-01-30 18:21:09 +0100
commit80a1c67a741897ebf6c8bc34f23ff6105461ce27 (patch)
tree0f3d35373ce7d305cf1ec70e356732152c20d0e3
parent925831adc81857ad9062aa9499ba6656790a257e (diff)
downloadgemato-80a1c67a741897ebf6c8bc34f23ff6105461ce27.tar.gz
openpgp: Set trust-model via config file
-rw-r--r--gemato/openpgp.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/gemato/openpgp.py b/gemato/openpgp.py
index 1f3d72e..c97aeb2 100644
--- a/gemato/openpgp.py
+++ b/gemato/openpgp.py
@@ -184,6 +184,12 @@ class OpenPGPEnvironment(OpenPGPSystemEnvironment):
super(OpenPGPEnvironment, self).__init__()
self._home = tempfile.mkdtemp()
+ with open(os.path.join(self._home, 'gpg.conf'), 'w') as f:
+ f.write('''# autogenerated by gemato
+
+# we are using an isolated keyring, so always trust our keys
+trust-model always
+''')
with open(os.path.join(self._home, 'gpg-agent.conf'), 'w') as f:
f.write('''# autogenerated by gemato
@@ -227,5 +233,4 @@ disable-scdaemon
def _spawn_gpg(self, options, stdin):
env = {'GNUPGHOME': self.home}
- options = ['--trust-model', 'always'] + options
return super(OpenPGPEnvironment, self)._spawn_gpg(options, stdin, env)