def do_update(self, args): """ Update the software on the target host to a given version usage: update <version> """ argss = args.split() version = argss[0] client = SystemAdministratorClient(self.host, self.port) print "Software update can take a while, please wait ..." result = client.updateSoftware(version) if not result['OK']: self.__errMsg("Failed to update the software") print result['Message'] else: print "Software successfully updated." print "You should restart the services to use the new software version." print "Think of updating /Operation/<vo>/<setup>/Versions section in the CS"
def do_update( self, args ): """ Update the software on the target host to a given version usage: update <version> """ argss = args.split() version = argss[0] client = SystemAdministratorClient( self.host, self.port ) print "Software update can take a while, please wait ..." result = client.updateSoftware( version ) if not result['OK']: self.__errMsg( "Failed to update the software" ) print result['Message'] else: print "Software successfully updated." print "You should restart the services to use the new software version." print "Think of updating /Operation/<vo>/<setup>/Versions section in the CS"
def do_update( self, args ): """ Update the software on the target host to a given version usage: update <version> [ -r <rootPath> ] [ -g <lcgVersion> ] where rootPath - path to the DIRAC installation lcgVersion - version of the LCG bindings to install """ try: argss = args.split() version = argss[0] rootPath = '' lcgVersion = '' del argss[0] while len( argss ) > 0: if argss[0] == '-r': rootPath = argss[1] del argss[0] del argss[0] elif argss[0] == '-g': lcgVersion = argss[1] del argss[0] del argss[0] except Exception as x: gLogger.notice( "ERROR: wrong input:", str( x ) ) gLogger.notice( self.do_update.__doc__ ) return client = SystemAdministratorClient( self.host, self.port ) gLogger.notice( "Software update can take a while, please wait ..." ) result = client.updateSoftware( version, rootPath, lcgVersion, timeout = 300 ) if not result['OK']: self._errMsg( "Failed to update the software" ) gLogger.notice( result['Message'] ) else: gLogger.notice( "Software successfully updated." ) gLogger.notice( "You should restart the services to use the new software version." ) gLogger.notice( "Think of updating /Operations/<vo>/<setup>/Pilot/Versions section in the CS" )
def do_update( self, args ): """ Update the software on the target host to a given version usage: update <version> [ -r <rootPath> ] [ -g <lcgVersion> ] where rootPath - path to the DIRAC installation lcgVersion - version of the LCG bindings to install """ try: argss = args.split() version = argss[0] rootPath = '' lcgVersion = '' del argss[0] while len( argss ) > 0: if argss[0] == '-r': rootPath = argss[1] del argss[0] del argss[0] elif argss[0] == '-g': lcgVersion = argss[1] del argss[0] del argss[0] except Exception as x: gLogger.notice( "ERROR: wrong input:", str( x ) ) gLogger.notice( self.do_update.__doc__ ) return client = SystemAdministratorClient( self.host, self.port ) gLogger.notice( "Software update can take a while, please wait ..." ) result = client.updateSoftware( version, rootPath, lcgVersion, timeout = 300 ) if not result['OK']: self._errMsg( "Failed to update the software" ) gLogger.notice( result['Message'] ) else: gLogger.notice( "Software successfully updated." ) gLogger.notice( "You should restart the services to use the new software version." ) gLogger.notice( "Think of updating /Operations/<vo>/<setup>/Pilot/Versions section in the CS" )
def updateHost(hostName, version): """ Apply update to specific host :param str hostName: name of the host you want to update :param str version: version vArBpC you want to update to """ host, port = parseHostname(hostName) client = SystemAdministratorClient(host, port) result = client.ping() if not result['OK']: gLogger.error("Cannot connect to %s" % host) return result gLogger.notice( "Initiating software update of %s, this can take a while, please be patient ..." % host) result = client.updateSoftware(version, '', '', timeout=600) if not result['OK']: return result return S_OK()