From 290ccecfb9742b694eb2a26bec0fb8aa59970856 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 29 Jan 2018 14:36:44 -0500 Subject: [PATCH] Exit if requested upload file does not exist It was fruitlessly sending to server, when it could detect the problem up front without bothering the server. --- confluent_client/bin/nodemedia | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/confluent_client/bin/nodemedia b/confluent_client/bin/nodemedia index a9fbc999..1f32031d 100644 --- a/confluent_client/bin/nodemedia +++ b/confluent_client/bin/nodemedia @@ -101,6 +101,10 @@ def detach_media(noderange, media): def upload_media(noderange, media): global exitcode + if not os.path.exists(media): + sys.stderr.write('Unable to locate requested file {0}\n'.format( + media)) + sys.exit(404) session = client.Command() output = sq.ScreenPrinter(noderange, session) filename = os.path.abspath(media)