crucial packages may need to be install’ed and to update’d
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 17 Jan 2014 09:37:10 +0000 (10:37 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 17 Jan 2014 09:37:10 +0000 (10:37 +0100)
NodeUpdate.py [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 8f890b0..6264b0b
@@ -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