Fix exception when an error occurs during upload
Test: local run with no images
Change-Id: I4a354411b111a5006cefb59d8a19b2f464635ae9
diff --git a/tools/upload_via_ssh.py b/tools/upload_via_ssh.py
index 7b41aee..c20a57f 100755
--- a/tools/upload_via_ssh.py
+++ b/tools/upload_via_ssh.py
@@ -14,7 +14,7 @@
os.chdir(args.image_dir)
images = glob.glob('*.img')
if len(images) == 0:
- raise OSError('File not found: %s' + image_pat)
+ raise OSError('File not found: ' + args.image_dir + '/*.img')
subprocess.check_call(
'tar -c -f - --lzop -S ' + ' '.join(images) +
' | ssh %s@%s -- tar -x -f - --lzop -S' % (