From: Tony Mack <tmack@cs.princeton.edu>
Date: Tue, 29 Jan 2008 21:18:14 +0000 (+0000)
Subject: clean up
X-Git-Tag: 2008-02-11-last-vmware-support~67
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=955e712ee61c93e622eda8e3442236f5add473c7;p=tests.git

clean up
---

diff --git a/qaapi/qa/tests/plc_configure.py b/qaapi/qa/tests/plc_configure.py
index 6a892ce..249c7cc 100644
--- a/qaapi/qa/tests/plc_configure.py
+++ b/qaapi/qa/tests/plc_configure.py
@@ -10,23 +10,23 @@ class plc_configure(Test):
     """
 
     def call(self):
-	tmpname = '/tmp/plc-cinfig-tty-%d' % os.getpid()
+
+	# Get plc configuration variables
+	plc_vars = []
+	for attr in dir(self.config):
+	    if attr.startswith('PLC'):
+		plc_vars.append(attr)
+		
+	# Write temporary plc-config file
+	tmpname = '/tmp/plc-config-tty-%d' % os.getpid()
 	fileconf = open(tmpname, 'w')
-	for var in [ 'PLC_NAME',
-                     'PLC_ROOT_PASSWORD',
-                     'PLC_ROOT_USER',
-                     'PLC_MAIL_ENABLED',
-                     'PLC_MAIL_SUPPORT_ADDRESS',
-                     'PLC_DB_HOST',
-                     'PLC_API_HOST',
-                     'PLC_WWW_HOST',
-                     'PLC_BOOT_HOST',
-                     'PLC_NET_DNS1',
-                     'PLC_NET_DNS2']:
+	for var in plc_vars:
+	    print 'e %s\n%s\n' % (var, getattr(self.config, var))
 	    fileconf.write('e %s\n%s\n' % (var, getattr(self.config, var)))
 	fileconf.write('w\nq\n')
 	fileconf.close()
 
+	# Update config file
 	command = "/sbin/service plc mount && plc-config-tty < %(tmpname)s" % locals()
 	if self.config.verbose:
 	    utils.header(command)