diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/qemucommand.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/qemucommand.py b/scripts/qemucommand.py index 3045b45..6f744e2 100644 --- a/scripts/qemucommand.py +++ b/scripts/qemucommand.py | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | from os.path import exists, join, realpath, abspath | 1 | from os.path import exists, isdir, join, realpath, abspath |
| 2 | from os import listdir | 2 | from os import listdir |
| 3 | import random | 3 | import random |
| 4 | import socket | 4 | import 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] |
