Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,4 @@ For example::

update 9.0.18
update integration
update 'DIRAC[server] @ git+https://github.com/fstagni/DIRAC.git@test_branch'
update DIRAC[server] @ git+https://github.com/fstagni/DIRAC.git@test_branch
11 changes: 2 additions & 9 deletions src/DIRAC/FrameworkSystem/Client/SystemAdministratorClientCLI.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
########################################################################
""" System Administrator Client Command Line Interface """
"""System Administrator Client Command Line Interface"""

import atexit
import datetime
Expand Down Expand Up @@ -1066,16 +1066,9 @@ def do_update(self, args):

update <version>
"""
try:
version = args.split()[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, timeout=600)
result = client.updateSoftware(args, timeout=600)
if not result["OK"]:
self._errMsg("Failed to update the software")
gLogger.notice(result["Message"])
Expand Down
29 changes: 14 additions & 15 deletions src/DIRAC/FrameworkSystem/Service/SystemAdministratorHandler.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
"""SystemAdministrator service is a tool to control and monitor the DIRAC services and agents"""

import socket
import os
import re
import time
import getpass
import importlib
import shutil
import os
import platform
import tempfile
import re
import shutil
import socket
import subprocess
import tempfile
import time
from datetime import datetime, timedelta
import requests

import psutil
from packaging.version import Version, InvalidVersion

import requests
from diraccfg import CFG
from packaging.version import InvalidVersion, Version

from DIRAC import S_OK, S_ERROR, gConfig, rootPath, gLogger, convertToPy3VersionNumber
from DIRAC import S_ERROR, S_OK, convertToPy3VersionNumber, gConfig, gLogger, rootPath
from DIRAC.ConfigurationSystem.Client import PathFinder
from DIRAC.Core.DISET.RequestHandler import RequestHandler
from DIRAC.Core.Security.Locations import getHostCertificateAndKeyLocation
from DIRAC.Core.Security.X509Chain import X509Chain # pylint: disable=import-error
from DIRAC.Core.Utilities import Os
from DIRAC.Core.Utilities.Extensions import extensionsByPriority, getExtensionMetadata
from DIRAC.Core.Utilities.File import mkLink
from DIRAC.Core.Utilities.TimeUtilities import fromString, hour, day
from DIRAC.Core.Utilities.Subprocess import shellCall
from DIRAC.Core.Utilities.ThreadScheduler import gThreadScheduler
from DIRAC.Core.Security.Locations import getHostCertificateAndKeyLocation
from DIRAC.Core.Security.X509Chain import X509Chain # pylint: disable=import-error
from DIRAC.ConfigurationSystem.Client import PathFinder
from DIRAC.Core.Utilities.TimeUtilities import day, fromString, hour
from DIRAC.FrameworkSystem.Client.ComponentInstaller import gComponentInstaller
from DIRAC.FrameworkSystem.Client.ComponentMonitoringClient import ComponentMonitoringClient

Expand Down Expand Up @@ -311,7 +310,7 @@ def export_updateSoftware(self, version):
installer.flush()
self.log.info("Downloaded DIRACOS installer to", installer.name)

directory = version if released_version else version.split("@")[1].split("#")[0]
directory = version if released_version else version.split()[2].split("@")[1].split("#")[0]
newProPrefix = os.path.join(
rootPath,
"versions",
Expand Down
Loading