# so, we force the update of crucial pkgs independently, as
# the whole group is sometimes too much to swallow
# this one is builtin
-CRUCIAL_PACKAGES_BUILTIN=[ 'NodeManager' , 'NodeUpdate' ]
+CRUCIAL_PACKAGES_BUILTIN=[ 'NodeUpdate' , 'nodemanager' ]
# and operations can also try to push a list through a conf_file
# should use the second one for consistency, try the first one as well for legacy
CRUCIAL_PACKAGES_OPTIONAL_PATH1='/etc/planetlab/NodeUpdate.packages'
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
Message ("Successfully removed RPM %s"%rpm)
continue
else:
- Error( "Unable to delete RPM %s, continuing. rc=%d" % (rpm,rc ))
+ Error( "Unable to delete RPM %s, continuing. rc=%d" % (rpm,uninstalled))
else:
Message( "No RPMs list file found." )