From: Thierry Parmentelat Date: Tue, 4 Mar 2008 17:01:13 +0000 (+0000) Subject: spliting step install_rpm was not basically a good idea, just check in one step if... X-Git-Tag: tests-4.2-4~213 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=9e9425bf6ed2515d5f148cb2a153c39968887b81;p=tests.git spliting step install_rpm was not basically a good idea, just check in one step if the rpm is there, if not curl it and then install it --- diff --git a/system/TestPlc.py b/system/TestPlc.py index 38bdd84..641961c 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -259,19 +259,20 @@ class TestPlc: return self.install_chroot(options) ### install_rpm - def cache_rpm(self,options): + def cache_rpm(self,url): self.run_in_host('rm -rf *.rpm') - utils.header('Curling rpm from %s'%options.myplc_url) - url=options.myplc_url + utils.header('Curling rpm from %s'%url) id= self.run_in_host('curl -O '+url) if (id != 0): - raise Exception,"Could not get rpm from %s"%options.myplc_url + raise Exception,"Could not get rpm from %s"%url return False return True def install_rpm_chroot(self,options): rpm = os.path.basename(options.myplc_url) - utils.header('Installing the : %s'%rpm) + if (not os.path.isfile(rpm)): + self.cache_rpm(options.myplc_url) + utils.header('Installing the : %s'%rpm) self.run_in_host('rpm -Uvh '+rpm) self.run_in_host('service plc mount') return True