[test-API 13/17] Substitute '\<gname\>' with 'domname'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



% for i in $(grep '\<gname\>' * -r | awk -F':' '{print $1}'); do \
    sed -i -e 's/\<gname\>/domname/g' $i; \
  done
---
 .../en-US/Writing_a_test_case.xml                  |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/docs/User_Guide/libvirt-test-API_Guide/en-US/Writing_a_test_case.xml b/docs/User_Guide/libvirt-test-API_Guide/en-US/Writing_a_test_case.xml
index 5502cc3..e16fb33 100644
--- a/docs/User_Guide/libvirt-test-API_Guide/en-US/Writing_a_test_case.xml
+++ b/docs/User_Guide/libvirt-test-API_Guide/en-US/Writing_a_test_case.xml
@@ -206,10 +206,10 @@ from utils import xml_builder
 envfile = 'env.ini'
 
 def prepare_cdrom(*args):
-    url, ks, gname, logger = args
+    url, ks, domname, logger = args
     ks_name = os.path.basename(ks)
 
-    new_dir = os.path.join('/tmp', gname)
+    new_dir = os.path.join('/tmp', domname)
     os.makedirs(new_dir)
 
     boot_path = os.path.join(url, 'images/boot.iso')
@@ -231,20 +231,20 @@ def prepare_cdrom(*args):
 
 def install_domain(dict):
     logger = dict['logger']
-    gname = dict['guestname']
+    domname = dict['guestname']
     dict['ifacetype'] = 'bridge'
     dict['bridge'] = 'xenbr0'
-    dict['bootcd'] = '/tmp/%s/custom.iso' %gname
+    dict['bootcd'] = '/tmp/%s/custom.iso' %domname
 
     logger.info('get system environment information')
     global_parser = global_parser.GlobalParser(envfile)
-    url = global_parser.get_value("domain", gname + "src")
-    dict['kickstart'] = global_parser.get_value("domain", gname + "ks")
+    url = global_parser.get_value("domain", domname + "src")
+    dict['kickstart'] = global_parser.get_value("domain", domname + "ks")
     logger.debug('install source: \n    %s' %url)
     logger.debug('kisckstart file: \n    %s' %dict['kickstart'])
 
     logger.info('prepare installation booting cdrom')
-    prepare_cdrom(url, dict['kickstart'], gname, logger)
+    prepare_cdrom(url, dict['kickstart'], domname, logger)
 
     xmlobj = xml_builder.XmlBuilder()
     guestinstxml = xmlobj.build_domain_install(dict)
@@ -256,9 +256,9 @@ def install_domain(dict):
     domobj.define_domain(guestinstxml)
 
     logger.info('start installation domain ...')
-    domobj.start_domain(gname)
+    domobj.start_domain(domname)
 
-    state = domobj.get_domain_state(gname)
+    state = domobj.get_domain_state(domname)
     logger.debug('current domain state: %s' %state)
 </programlisting>
     </example>
-- 
1.7.7.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]