2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-25 19:10:10 +00:00

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.
This commit is contained in:
Jarrod Johnson 2018-01-29 14:36:44 -05:00
parent 0431e42452
commit 290ccecfb9

View File

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