2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-02-15 18:19:52 +00:00

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.
This commit is contained in:
Jarrod Johnson 2018-07-11 13:17:37 -04:00
parent 8e9bcbb44f
commit ce1a58bf58

View File

@ -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,