Skip to content

Commit 6954e65

Browse files
committed
feat (MySQL): return rowcount on update
1 parent 889337e commit 6954e65

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/DIRAC/Core/Utilities/MySQL.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,7 @@ def _update(self, cmd, *, args=None, conn=None, debug=True):
760760
761761
:return: S_OK with number of updated registers upon success.
762762
S_ERROR upon error.
763+
lastRowId: if set, added to the returned dictionary
763764
"""
764765

765766
self.log.debug(f"_update: {self._safeCmd(cmd)}")
@@ -774,9 +775,11 @@ def _update(self, cmd, *, args=None, conn=None, debug=True):
774775
try:
775776
cursor = connection.cursor()
776777
res = cursor.execute(cmd, args=args)
778+
777779
retDict = S_OK(res)
778780
if cursor.lastrowid:
779781
retDict["lastRowId"] = cursor.lastrowid
782+
780783
except Exception as x:
781784
retDict = self._except("_update", x, "Execution failed.", cmd, debug)
782785

src/DIRAC/DataManagementSystem/Utilities/DMSHelpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ def getAllSEsInGroupAtSite(self, seGroup, site):
402402
return sesAtSite
403403
foundSEs = set(seList) & set(sesAtSite["Value"])
404404
if not foundSEs:
405-
sLog.warn("No SE found at that site", f"in group {seGroup} at {site}")
405+
sLog.verbose("No SE found at that site", f"in group {seGroup} at {site}")
406406
return S_OK()
407407
return S_OK(sorted(foundSEs))
408408

src/DIRAC/DataManagementSystem/scripts/dirac_dms_protocol_matrix.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ def main():
177177
for src, dst in ((x, y) for x in fromSE for y in targetSE):
178178
if ftsTab:
179179
try:
180-
# breakpoint()
181180
fts3TpcProto = fts3Plugin.selectTPCProtocols(sourceSEName=ses[src].name, destSEName=ses[dst].name)
182181
res = ses[dst].generateTransferURLsBetweenSEs(lfn, ses[src], fts3TpcProto)
183182
except ValueError as e:

0 commit comments

Comments
 (0)