From ce1a58bf58a9fd1f139ceb4fa4e3ba89947f7062 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 11 Jul 2018 13:17:37 -0400 Subject: [PATCH] Provide a more specific error when file doesn't exist nodemedia does check locally, but server should also check it, in case of remote *and* service nodes. --- confluent_server/confluent/firmwaremanager.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/confluent_server/confluent/firmwaremanager.py b/confluent_server/confluent/firmwaremanager.py index 1cfd2583..13e0c205 100644 --- a/confluent_server/confluent/firmwaremanager.py +++ b/confluent_server/confluent/firmwaremanager.py @@ -21,6 +21,8 @@ import confluent.exceptions as exc import confluent.messages as msg import eventlet +import os +import socket updatesbytarget = {} uploadsbytarget = {} @@ -28,6 +30,10 @@ updatepool = eventlet.greenpool.GreenPool(256) def execupdate(handler, filename, updateobj, type): + if not os.path.exists(filename): + raise exc.InvalidArgumentException( + '{0} does not appear to exist on {1}'.format(filename, + socket.gethostname())) try: if type == 'firmware': completion = handler(filename, progress=updateobj.handle_progress,