From d0a93ef2de4b9f42b8f9ff0a01d5ebf58a4fec4f Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Sat, 20 Jan 2018 12:23:01 -0600 Subject: [PATCH] added check for travis in gpg homedir --- onionr/core.py | 5 ++++- onionr/onionrutils.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/onionr/core.py b/onionr/core.py index 4f9d8c54..fb6c5eea 100644 --- a/onionr/core.py +++ b/onionr/core.py @@ -38,7 +38,10 @@ class Core: ''' Generate the main PGP key for our client. Should not be done often. Uses own PGP home folder in the data/ directory. ''' # Generate main pgp key - gpg = gnupg.GPG(gnupghome='./data/pgp/') + if os.getenv('TRAVIS') == 'true': + gpg = gnupg.GPG(homedir='./data/pgp/') + else: + gpg = gnupg.GPG(gnupghome='./data/pgp/') input_data = gpg.gen_key_input(key_type="RSA", key_length=2048, name_real=myID, name_email='anon@onionr') #input_data = gpg.gen_key_input(key_type="RSA", key_length=1024) key = gpg.gen_key(input_data) diff --git a/onionr/onionrutils.py b/onionr/onionrutils.py index 15809828..65661988 100644 --- a/onionr/onionrutils.py +++ b/onionr/onionrutils.py @@ -66,7 +66,10 @@ class OnionrUtils(): '''Export our PGP key if it exists''' if not os.path.exists(self.fingerprintFile): raise Exception("No fingerprint found, cannot export our PGP key.") - gpg = gnupg.GPG(gnupghome='./data/pgp/') + if os.getenv('TRAVIS') == 'true': + gpg = gnupg.GPG(homedir='./data/pgp/') + else: + gpg = gnupg.GPG(gnupghome='./data/pgp/') with open(self.fingerprintFile,'r') as f: fingerprint = f.read() ascii_armored_public_keys = gpg.export_keys(fingerprint)