From 7135de66d28590d4e418617b47ef990727008a90 Mon Sep 17 00:00:00 2001 From: jowj Date: Sun, 7 Oct 2018 16:28:17 -0500 Subject: [PATCH] Update file monitor to look for shared-vol '/shared/' location. --- mojojojo-bot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mojojojo-bot.py b/mojojojo-bot.py index edebce8..d9880a6 100644 --- a/mojojojo-bot.py +++ b/mojojojo-bot.py @@ -129,11 +129,11 @@ def react_to_message(reaction): def react_to_monitoring(): - results_file = Path("/results.json") + results_file = Path("/shared/results.json") does_file_exist = results_file.is_file() logging.info(f"file exists: {does_file_exist}") if results_file.is_file(): - open_file = open("/results.json","r") + open_file = open("/shared/results.json","r") logging.info('in file exists conditional') for line in open_file: logging.info('examining item: '+line) @@ -142,7 +142,7 @@ def react_to_monitoring(): channel = get_channel_ID("bots-like-gaston"), text = line ) - os.remove("/results.json") + os.remove("/shared/results.json") def get_channel_ID(channelName): @@ -155,7 +155,7 @@ def get_channel_ID(channelName): if __name__ == "__main__": logging.basicConfig(filename='mojojojo.log', level=logging.INFO) logging.info('Started') - results_file = Path("/results.json") + results_file = Path("/shared/results.json") if slack_client.rtm_connect(with_team_state=False): print("mojo jojo online, connected, and running!") # Read bot's user ID by calling Web API method `auth.test`