7 class plc_install(Test):
12 def call(self, system_type, root_dir, url=None):
14 url_path = self.config.path
19 url_file = open("%s/URL" % url_path)
20 url = url_file.read().strip()
25 print "URL not specified"
29 if self.config.verbose:
30 utils.header('Saving current myplc url into %s/URL' % url_path)
31 fsave=open('%s/URL' % url_path, "w")
35 # Instal myplc from url
36 if self.config.verbose:
37 utils.header('Installing myplc from url %s' % url)
41 install_command = " rpm -Uvh %(url)s "
42 if system_type in ['vserv', 'vserver']:
43 full_command += " vserver %(root_dir)s exec "
44 elif system_type in ['chroot']:
47 raise Exception, "Invalid system type %(system_type)s" % locals()
49 full_command += install_command % locals()
50 try: (stdout, stderr) = utils.popen(full_command)
51 except: (stdout, stderr) = utils.popen("yum localupdate %(url)s")
53 if self.config.verbose:
54 utils.header("\n".join(stdout))
58 if __name__ == '__main__':
59 args = tuple(sys.argv[1:])