From 3a7cefbf530c80cbc4ab9bdc601d5e81bc7b1cf3 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Mon, 2 Jul 2018 16:15:59 -0500 Subject: [PATCH] * do not fail localCommand if host file does not exist * disabled plugin tests --- onionr/onionrutils.py | 7 +++++-- onionr/tests.py | 5 ++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/onionr/onionrutils.py b/onionr/onionrutils.py index 84225b04..a33bfd30 100644 --- a/onionr/onionrutils.py +++ b/onionr/onionrutils.py @@ -176,8 +176,11 @@ class OnionrUtils: config.reload() self.getTimeBypassToken() # TODO: URL encode parameters, just as an extra measure. May not be needed, but should be added regardless. - with open('data/host.txt', 'r') as host: - hostname = host.read() + try: + with open('data/host.txt', 'r') as host: + hostname = host.read() + except FileNotFoundError: + return False payload = 'http://%s:%s/client/?action=%s&token=%s&timingToken=%s' % (hostname, config.get('client.port'), command, config.get('client.hmac'), self.timingToken) try: retData = requests.get(payload).text diff --git a/onionr/tests.py b/onionr/tests.py index 766f9903..e25f5521 100755 --- a/onionr/tests.py +++ b/onionr/tests.py @@ -116,9 +116,8 @@ class OnionrTests(unittest.TestCase): self.assertTrue(False) self.assertTrue(True) - +''' def testBlockAPI(self): - self.assertTrue(True); return logger.debug('-'*26 + '\n') logger.info('Running BlockAPI test #1...') @@ -216,7 +215,7 @@ class OnionrTests(unittest.TestCase): logger.debug('thread finished.', timestamp = False) self.assertTrue(True) - +''' def testQueue(self): logger.debug('-'*26 + '\n') logger.info('Running daemon queue test...')