4 from qa.Test import Test
9 Configure the myplc from config options in config file
12 def call(self, system_type, root_dir):
13 tmpname = '/tmp/plc-cinfig-tty-%d' % os.getpid()
14 fileconf = open(tmpname, 'w')
15 for var in [ 'PLC_NAME',
19 'PLC_MAIL_SUPPORT_ADDRESS',
26 fileconf.write('e %s\n%s\n' % (var, self.config[var]))
27 fileconf.write('w\nq\n')
31 if system_type in ['vserv', 'vserver']:
32 full_command += " vserver %(root_dir)s exec "
33 elif system_type in ['chroot']:
34 full_commnd += " chroot %(root_dir)s "
36 raise Exception, "Invalid system type %(sytem_type)s" % locals()
38 full_command = full_command + " plc-config-tty < %(tmpname)s" % locals()
39 (stdout, stderr) = utils.popen(full_command)
40 (stdout, stderr) = utils.popen("rm %s" % tmpname)