8 class plc_install(Test):
13 def call(self, url=None):
15 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('Downloading myplc from url %s' % url)
39 url_parts = url.split(os.sep)
41 download_cmd = "wget %(url)s /tmp/%(rpm_file)s" % locals()
44 rpm_install = "rpm -Uvh /tmp/%(rpm_file)s" % locals()
45 yum_install = "yum -y localinstall /tmp/%(rpm_file)s" % locals()
47 if self.config.verbose:
48 utils.header("Trying: %(rpm_install)s" % locals())
50 (stdout, stderr) = utils.popen(rpm_install)
52 if self.config.verbose:
53 utils.header("Trying %(yum_install)s" % locals())
54 (stdout, stderr) = utils.popen(yum_install)
56 if self.config.verbose:
57 utils.header("\n".join(stdout))
61 if __name__ == '__main__':
62 args = tuple(sys.argv[1:])