From: Thierry Parmentelat Date: Fri, 17 Jan 2014 09:37:10 +0000 (+0100) Subject: crucial packages may need to be install’ed and to update’d X-Git-Tag: nodeupdate-0.5-11~2 X-Git-Url: http://git.onelab.eu/?p=nodeupdate.git;a=commitdiff_plain;h=54b77d7dee54fa4970f41a13bcd0391995cb07a0 crucial packages may need to be install’ed and to update’d --- diff --git a/NodeUpdate.py b/NodeUpdate.py old mode 100644 new mode 100755 index 8f890b0..6264b0b --- a/NodeUpdate.py +++ b/NodeUpdate.py @@ -176,8 +176,14 @@ class NodeUpdate: try: crucial_packages += file(CRUCIAL_PACKAGES_OPTIONAL_PATH2).read().split() except: pass for package in crucial_packages: - Message( "\nUpdating crucial package %s" % package) - os.system( "%s %s -y update %s" %(YUM_PATH, yum_options, package)) + # if package is not yet installed, like e.g. slice images, + # need to yum install, not yum update + if os.system("rpm -q %s > /dev/null"%package)==0: + Message( "\nUpdating crucial package %s" % package) + os.system( "%s %s -y update %s" %(YUM_PATH, yum_options, package)) + else: + Message( "\Installing crucial package %s" % package) + os.system( "%s %s -y install %s" %(YUM_PATH, yum_options, package)) except: pass