Skip to content

Commit b1af24b

Browse files
authored
Merge pull request #5743 from fstagni/80_fixes9
[8.0] removed isPy3VersionNumber function
2 parents 2ee434a + d772c57 commit b1af24b

File tree

4 files changed

+23
-49
lines changed

4 files changed

+23
-49
lines changed

docs/source/AdministratorGuide/HowTo/SystemAdministratorInterface.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,9 @@ For example, start a service::
223223

224224
WorkloadManagement_PilotManager : Run
225225

226-
Restart services or agents or database server::
226+
Restart services or agents::
227227

228228
restart <system|*> <service|agent|*>
229-
restart mysql
230229

231230
Restarting all the services and agents::
232231

src/DIRAC/FrameworkSystem/Client/SystemAdministratorClientCLI.py

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -987,12 +987,11 @@ def do_start(self, args):
987987

988988
def do_restart(self, args):
989989
"""
990-
Restart services or agents or database server
990+
Restart components (services, agents, executors)
991991
992992
usage:
993993
994994
restart <system|*> <service|agent|*>
995-
restart mysql
996995
"""
997996
if not args:
998997
gLogger.notice(self.do_restart.__doc__)
@@ -1001,32 +1000,29 @@ def do_restart(self, args):
10011000
argss = args.split()
10021001
option = argss[0]
10031002
del argss[0]
1004-
if option != "mysql":
1005-
if option != "*":
1006-
if len(argss) < 1:
1007-
gLogger.notice(self.do_restart.__doc__)
1008-
return
1009-
system = option
1010-
if system != "*":
1011-
component = argss[0]
1012-
else:
1013-
component = "*"
1014-
client = SystemAdministratorClient(self.host, self.port)
1015-
result = client.restartComponent(system, component)
1016-
if not result["OK"]:
1017-
if system == "*":
1018-
gLogger.notice("All systems are restarted, connection to SystemAdministrator is lost")
1019-
else:
1020-
self._errMsg(result["Message"])
1003+
if option != "*":
1004+
if len(argss) < 1:
1005+
gLogger.notice(self.do_restart.__doc__)
1006+
return
1007+
system = option
1008+
if system != "*":
1009+
component = argss[0]
1010+
else:
1011+
component = "*"
1012+
client = SystemAdministratorClient(self.host, self.port)
1013+
result = client.restartComponent(system, component)
1014+
if not result["OK"]:
1015+
if system == "*":
1016+
gLogger.notice("All systems are restarted, connection to SystemAdministrator is lost")
10211017
else:
1022-
if system != "*" and component != "*":
1023-
gLogger.notice("\n%s_%s started successfully, runit status:\n" % (system, component))
1024-
else:
1025-
gLogger.notice("\nComponents started successfully, runit status:\n")
1026-
for comp in result["Value"]:
1027-
gLogger.notice((comp.rjust(32), ":", result["Value"][comp]["RunitStatus"]))
1018+
self._errMsg(result["Message"])
10281019
else:
1029-
gLogger.notice("Not yet implemented")
1020+
if system != "*" and component != "*":
1021+
gLogger.notice("\n%s_%s started successfully, runit status:\n" % (system, component))
1022+
else:
1023+
gLogger.notice("\nComponents started successfully, runit status:\n")
1024+
for comp in result["Value"]:
1025+
gLogger.notice((comp.rjust(32), ":", result["Value"][comp]["RunitStatus"]))
10301026

10311027
def do_stop(self, args):
10321028
"""

src/DIRAC/FrameworkSystem/scripts/dirac_admin_update_instance.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,6 @@ def updateHost(hostName, version):
116116
gLogger.error("Cannot connect to %s" % host)
117117
return result
118118

119-
# If the server is already running python 3,
120-
# convert the version to be installed to python3
121-
existingVersion = result["Value"]["version"]
122-
if DIRAC.isPy3VersionNumber(existingVersion):
123-
version = DIRAC.convertToPy3VersionNumber(version)
124-
125119
gLogger.notice(
126120
"Initiating software update of %s to %s, this can take a while, please be patient ..." % (host, version)
127121
)

src/DIRAC/__init__.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,6 @@
8989
alarmMail = "[email protected]"
9090

9191

92-
def isPy3VersionNumber(releaseVersion):
93-
"""Returns True if the releaseVersion is a PEP-440 style string.
94-
This is the `is_canonical` function defined in PEP-440 Appendix B
95-
96-
:param str releaseVersion: The software version to use
97-
"""
98-
return (
99-
re.match(
100-
r"^([1-9][0-9]*!)?(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*))*((a|b|rc)(0|[1-9][0-9]*))?(\.post(0|[1-9][0-9]*))?(\.dev(0|[1-9][0-9]*))?$",
101-
releaseVersion,
102-
)
103-
is not None
104-
)
105-
106-
10792
def convertToPy3VersionNumber(releaseVersion):
10893
"""Convert the releaseVersion into a PEP-440 style string
10994

0 commit comments

Comments
 (0)