summaryrefslogtreecommitdiffstats
path: root/scripts/qemucommand.py
diff options
context:
space:
mode:
authorLaurent Bonnans <laurent.bonnans@here.com>2019-07-31 17:54:40 +0200
committerLaurent Bonnans <laurent.bonnans@here.com>2019-08-15 15:38:54 +0200
commit3e54be47b64d9c0e433a3500d7e0c46fa304bbbb (patch)
tree9d474a1f698d108c063ac867b98a3f21bbedc60d /scripts/qemucommand.py
parent02e976e82fae6b26619d42993140a2c1a7c13db6 (diff)
downloadmeta-updater-3e54be47b64d9c0e433a3500d7e0c46fa304bbbb.tar.gz
More helpful error message when running qemu
Signed-off-by: Laurent Bonnans <laurent.bonnans@here.com> (cherry-picked from commit 36f311912372be3150633b4da0f344c70e456d55)
Diffstat (limited to 'scripts/qemucommand.py')
-rw-r--r--scripts/qemucommand.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/qemucommand.py b/scripts/qemucommand.py
index 8b7da2b..daf2dd1 100644
--- a/scripts/qemucommand.py
+++ b/scripts/qemucommand.py
@@ -1,4 +1,4 @@
1from os.path import exists, join, realpath, abspath 1from os.path import exists, isdir, join, realpath, abspath
2from os import listdir 2from os import listdir
3import random 3import random
4import socket 4import socket
@@ -42,6 +42,8 @@ class QemuCommand(object):
42 if args.machine: 42 if args.machine:
43 self.machine = args.machine 43 self.machine = args.machine
44 else: 44 else:
45 if not isdir(args.dir):
46 raise ValueError("Directory %s does not exist, please specify a --machine or a valid images directory" % args.dir)
45 machines = listdir(args.dir) 47 machines = listdir(args.dir)
46 if len(machines) == 1: 48 if len(machines) == 1:
47 self.machine = machines[0] 49 self.machine = machines[0]