logger.info("the directory is %s" % new_dir)
boot_path = os.path.join(ostree, 'images/boot.iso')
@@ -65,10 +70,10 @@ def prepare_cdrom(*args):
urllib.urlretrieve(ks, '%s/%s' % (new_dir, ks_name))[0]
logger.info("the url of kickstart is %s" % ks)
- shutil.copy('utils/ksiso.sh', new_dir)
+ shutil.debug('utils/ksiso.sh', new_dir)
src_path = os.getcwd()
- logger.info("enter into the workshop folder: %s" % new_dir)
+ logger.debug("enter into the workshop folder: %s" % new_dir)
os.chdir(new_dir)
shell_cmd = 'sh ksiso.sh %s' % ks_name
@@ -76,8 +81,11 @@ def prepare_cdrom(*args):
(status, text) = commands.getstatusoutput(shell_cmd)
logger.debug(text)
- logger.info("make custom.iso file, change to original directory:
%s" %
- src_path)
+
+ logger.debug("copy custom.iso to %s" % customiso_dir)
+ shutil.copy('custom.iso', customiso_dir)
+
+ logger.debug("go back to original directory: %s" % src_path)
os.chdir(src_path)
def prepare_boot_guest(domobj, xmlstr, guestname, installtype,
logger):
@@ -196,7 +204,7 @@ def install_linux_cdrom(params):
logger.info('prepare installation...')
bootcd = '%s/custom.iso' % \
- (os.path.join(HOME_PATH, guestname))
+ (os.path.join(BOOT_ISO_DIR, guestname))
logger.debug("the bootcd path is %s" % bootcd)
logger.info("begin to customize the custom.iso file")
prepare_cdrom(ostree, ks, guestname, logger)
diff --git a/repos/domain/install_linux_check.py
b/repos/domain/install_linux_check.py
index d034aba..ab1e7db 100644
--- a/repos/domain/install_linux_check.py
+++ b/repos/domain/install_linux_check.py
@@ -15,7 +15,7 @@ from src import sharedmod
from src import env_parser
from utils import utils
-required_params = ('guestname', 'virt_type', 'hdmodel', 'nicmodel',)
+required_params = ('guestname', 'virt_type', 'hddriver', 'nicdriver',)
optional_params = {}
HOME_PATH = os.getcwd()
@@ -71,8 +71,8 @@ def install_linux_check(params):
logger.info("Now checking guest health after installation")
domain_name=guestname
- blk_type=params['hdmodel']
- nic_type=params['nicmodel']
+ blk_type=params['hddriver']
+ nic_type=params['nicdriver']
Test_Result = 0
# Ping guest from host
diff --git a/repos/network/create.py b/repos/network/create.py
index 839e93b..399328c 100644
--- a/repos/network/create.py
+++ b/repos/network/create.py
@@ -39,6 +39,7 @@ def create(params):
"""Create a network from xml"""
logger = params['logger']
networkname = params['networkname']
+ netmode = params['netmode']
xmlstr = params['xml']
conn = sharedmod.libvirtobj['conn']
@@ -47,6 +48,9 @@ def create(params):
logger.error("the %s network is running" % networkname)
return 1
+ if netmode == 'isolate':
+ xmlstr = re.sub('<forward.*\n', '', xmlstr)
+
logger.debug("%s network xml:\n%s" % (networkname, xmlstr))
net_num1 = conn.numOfNetworks()
diff --git a/repos/network/define.py b/repos/network/define.py
index 923db29..dd054f7 100644
--- a/repos/network/define.py
+++ b/repos/network/define.py
@@ -42,14 +42,18 @@ def define(params):
"""Define a network from xml"""
logger = params['logger']
networkname = params['networkname']
+ netmode = params['netmode']
xmlstr = params['xml']
conn = sharedmod.libvirtobj['conn']
if check_network_define(networkname, logger):
- logger.error("%s network is defined" % networkname)
+ logger.error("%s network is already defined" % networkname)
return 1
+ if netmode == 'isolate':
+ xmlstr = re.sub('<forward.*\n', '', xmlstr)
+
logger.debug("network xml:\n%s" % xmlstr)
net_num1 = conn.numOfDefinedNetworks()
diff --git a/repos/snapshot/delete.py b/repos/snapshot/delete.py
index 19689b1..bab043e 100644
--- a/repos/snapshot/delete.py
+++ b/repos/snapshot/delete.py
@@ -24,7 +24,7 @@ def check_domain_state(conn, guestname, logger):
else:
return True
-def delete_check(guestname, snapshotname, expected_flag, logger):
+def check_xml(guestname, snapshotname, expected_flag, logger):
""" after deleting, check if appropriate xml file exists or not"""
guest_snapshot_dir = os.path.join(SNAPSHOT_DIR, guestname)
snapshot_entries = os.listdir(guest_snapshot_dir)
@@ -54,7 +54,7 @@ def delete(params):
logger.error("checking failed")
return 1
- if not delete_check(guestname, snapshotname, "exist", logger):
+ if not check_xml(guestname, snapshotname, "exist", logger):
logger.error("no snapshot %s exists" % snapshotname)
logger.debug("not corresponding xml file in %s" %
SNAPSHOT_DIR)
return 1
@@ -64,7 +64,7 @@ def delete(params):
domobj = conn.lookupByName(guestname)
snapobj = domobj.snapshotLookupByName(snapshotname, 0)
snapobj.delete(0)
- if not delete_check(guestname, snapshotname, "noexist",
logger):
+ if not check_xml(guestname, snapshotname, "noexist", logger):
logger.error("after deleting, the corresponding \
xmlfile still exists in %s" % SNAPSHOT_DIR)
return 1