From 4801a11c067fb00eeb430e5d866e186f6a37e88f Mon Sep 17 00:00:00 2001 From: Alina Quereilhac Date: Fri, 18 Oct 2013 12:25:56 +0200 Subject: [PATCH] Decreasing retries for LinuxNode is_alive and other methods --- src/nepi/resources/linux/node.py | 8 ++++---- src/nepi/resources/linux/rpmfuncs.py | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/nepi/resources/linux/node.py b/src/nepi/resources/linux/node.py index b50d7fad..1163f6d9 100644 --- a/src/nepi/resources/linux/node.py +++ b/src/nepi/resources/linux/node.py @@ -291,7 +291,7 @@ class LinuxNode(ResourceManager): # until the result is not empty string out = "" retrydelay = 1.0 - for i in xrange(10): + for i in xrange(2): try: (out, err), proc = self.execute("cat /etc/issue", retry = 5, @@ -910,7 +910,7 @@ class LinuxNode(ResourceManager): pid = ppid = None delay = 1.0 - for i in xrange(4): + for i in xrange(2): pidtuple = self.getpid(home = home, pidfile = pidfile) if pidtuple: @@ -967,7 +967,7 @@ class LinuxNode(ResourceManager): # To work arround this, repeat the operation N times or # until the result is not empty string retrydelay = 1.0 - for i in xrange(10): + for i in xrange(2): try: (out, err), proc = self.execute("echo 'ALIVE'", retry = 5, @@ -1000,7 +1000,7 @@ class LinuxNode(ResourceManager): # To work arround this, repeat the operation N times or # until the result is not empty string retrydelay = 1.0 - for i in xrange(10): + for i in xrange(2): try: (out, err), proc = self.execute("echo ${HOME}", retry = 5, diff --git a/src/nepi/resources/linux/rpmfuncs.py b/src/nepi/resources/linux/rpmfuncs.py index 5497a57f..e458cd41 100644 --- a/src/nepi/resources/linux/rpmfuncs.py +++ b/src/nepi/resources/linux/rpmfuncs.py @@ -19,6 +19,8 @@ RPM_FUSION_URL = 'http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm' RPM_FUSION_URL_F12 = 'http://download1.rpmfusion.org/free/fedora/releases/12/Everything/x86_64/os/rpmfusion-free-release-12-1.noarch.rpm' +RPM_FUSION_URL_F14 = 'http://download1.rpmfusion.org/free/fedora/releases/14/Everything/i386/os/rpmfusion-free-release-14-0.4.noarch.rpm' + # TODO: Investigate using http://nixos.org/nix/ @@ -27,7 +29,7 @@ def install_packages_command(os, packages): packages = [packages] cmd = install_rpmfusion_command(os) - if cmd: cmd += " && " + if cmd: cmd += " ; " cmd += " && ".join(map(lambda p: " { rpm -q %(package)s || sudo -S yum -y install %(package)s ; } " % { 'package': p}, packages)) @@ -56,7 +58,7 @@ def install_rpmfusion_command(os): cmd = cmd % {'package': RPM_FUSION_URL_F12} elif os == OSType.FEDORA_14: # For f13+ - cmd = cmd % {'package': RPM_FUSION_URL} + cmd = cmd % {'package': RPM_FUSION_URL_F14} else: # Fedora 8 is unmaintained cmd = "" -- 2.43.0