When 'cdrom_cd1' or 'floppy' is not assigned in config file,
self.cdrom_cd1 or self.floppy would become $KVM_TEST_DIR, it causes
unattend.py fail when calling clean_old_image(..)

Signed-off-by: Amos Kong <[email protected]>
---
 0 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/client/tests/kvm/scripts/unattended.py 
b/client/tests/kvm/scripts/unattended.py
index ba7d80b..7f78f7f 100755
--- a/client/tests/kvm/scripts/unattended.py
+++ b/client/tests/kvm/scripts/unattended.py
@@ -276,12 +276,14 @@ class UnattendedInstall(object):
             if not os.path.isdir(self.tftp):
                 os.makedirs(self.tftp)
 
-        self.cdrom_cd1 = os.path.join(KVM_TEST_DIR, self.cdrom_cd1)
+        if self.cdrom_cd1:
+            self.cdrom_cd1 = os.path.join(KVM_TEST_DIR, self.cdrom_cd1)
         self.cdrom_cd1_mount = tempfile.mkdtemp(prefix='cdrom_cd1_', 
dir='/tmp')
         if self.medium == 'nfs':
             self.nfs_mount = tempfile.mkdtemp(prefix='nfs_', dir='/tmp')
 
-        self.floppy = os.path.join(KVM_TEST_DIR, self.floppy)
+        if self.floppy:
+            self.floppy = os.path.join(KVM_TEST_DIR, self.floppy)
         if not os.path.isdir(os.path.dirname(self.floppy)):
             os.makedirs(os.path.dirname(self.floppy))
 

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to