X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=NodeUpdate.py;h=c6be4511285b4641bb4723e1b68e5040cef264b5;hb=c49aa43c25797e8b5d0a842dd6ea05cc4bd01fab;hp=21512f6b00b02c60e59f7ede25316fd57d3e5ec0;hpb=d065175e5150d06437228e634e4adc2838dac813;p=nodeupdate.git diff --git a/NodeUpdate.py b/NodeUpdate.py index 21512f6..c6be451 100644 --- a/NodeUpdate.py +++ b/NodeUpdate.py @@ -23,7 +23,6 @@ RPM_PATH = "/bin/rpm" RPM_GPG_PATH = "/etc/pki/rpm-gpg" - # location of file containing http/https proxy info, if needed PROXY_FILE = '/etc/planetlab/http_proxy' @@ -37,6 +36,8 @@ SSL_CERT_DIR='/mnt/cdrom/bootme/cacert/' # file containing the list of extensions this node has, each # correspond to a package group in yum repository. +# this is expected to be updated from the 'extensions tag' +# through the 'extensions.php' nodeconfig script EXTENSIONS_FILE='/etc/planetlab/extensions' # file containing a list of rpms that we should attempt to delete @@ -45,6 +46,16 @@ EXTENSIONS_FILE='/etc/planetlab/extensions' # that were not intended to be deleted. DELETE_RPM_LIST_FILE= '/etc/planetlab/delete-rpm-list' +# ok, so the logic should be simple, just yum update the world +# however there are many cases in the real life where this +# just does not work, because of a glitch somewhere +# so, we force the update of crucial pkgs independently, as +# the whole group is sometimes too much to swallow +# this one is builtin +UPDATE_PACKAGES_BUILTIN=[ 'NodeManager' ] +# and operations can also try to push a list through a conf_file +UPDATE_PACKAGES_OPTIONAL_PATH='/etc/planetlab/NodeUpdate.packages' + # print out a message only if we are displaying output def Message(message): @@ -152,9 +163,22 @@ class NodeUpdate: yum_options += " --verbose" else: Message( "Unsupported, not using --verbose option" ) - + + # a configurable list of packages to try and update independently + # cautious.. + try: + crucial_packages = [] + for package in UPDATE_PACKAGES_BUILTIN: crucial_packages.append(package) + try: crucial_packages += file(UPDATE_PACKAGES_OPTIONAL_PATH).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)) + except: + pass + Message( "\nUpdating PlanetLab group" ) - os.system( "%s %s %s -y groupupdate \"PlanetLab\"" % + os.system( "%s %s %s -y groupinstall \"PlanetLab\"" % (YUM_PATH, yum_options, sslcertdir) ) Message( "\nUpdating rest of system" ) @@ -173,7 +197,7 @@ class NodeUpdate: for extension in extensions_contents.split(): group = "extension%s" % extension Message( "\nUpdating %s group" % group ) - os.system( "%s %s %s -y groupupdate \"%s\"" % + os.system( "%s %s %s -y groupinstall \"%s\"" % (YUM_PATH, yum_options, sslcertdir, group) ) else: Message( "No extensions file found" )