Skip to content

Commit

Permalink
Merge pull request DIRACGrid#7624 from fstagni/90_fixes4
Browse files Browse the repository at this point in the history
[integration] minor fixes
  • Loading branch information
fstagni authored May 22, 2024
2 parents 4a7b6b4 + 07f71f8 commit 1806b9a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
""" Class that contains client access to the job monitoring handler. """

import os
from DIRAC.Core.Base.Client import Client, createClient
from DIRAC.Core.Utilities.DEncode import ignoreEncodeWarning
from DIRAC.Core.Utilities.JEncode import strToIntDict
Expand Down
13 changes: 3 additions & 10 deletions src/DIRAC/WorkloadManagementSystem/DB/JobDBUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,11 @@
import zlib

from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations


from DIRAC.Core.Utilities.ReturnValues import S_OK, S_ERROR
from DIRAC.Core.Utilities.DErrno import EWMSSUBM, EWMSJMAN
from DIRAC.Core.Utilities.DErrno import EWMSSUBM
from DIRAC.Core.Utilities.ObjectLoader import ObjectLoader

from DIRAC.WorkloadManagementSystem.Client.JobState.JobManifest import JobManifest
from DIRAC.Core.Utilities.ReturnValues import S_ERROR, S_OK, returnValueOrRaise
from DIRAC.WorkloadManagementSystem.Client import JobStatus


from DIRAC.Core.Utilities.ReturnValues import returnValueOrRaise

from DIRAC.WorkloadManagementSystem.Client.JobState.JobManifest import JobManifest

getDIRACPlatform = returnValueOrRaise(
ObjectLoader().loadObject("ConfigurationSystem.Client.Helpers.Resources", "getDIRACPlatform")
Expand Down
5 changes: 2 additions & 3 deletions src/DIRAC/WorkloadManagementSystem/DB/JobLoggingDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
getWMSTimeStamps()
"""
import datetime
import time

from DIRAC import S_OK, S_ERROR
from DIRAC.Core.Utilities import TimeUtilities
from DIRAC import S_ERROR, S_OK
from DIRAC.Core.Base.DB import DB
from DIRAC.Core.Utilities import TimeUtilities

MAGIC_EPOC_NUMBER = 1270000000

Expand Down
12 changes: 6 additions & 6 deletions src/DIRAC/WorkloadManagementSystem/Executor/InputData.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
import pprint
import time

from DIRAC import S_OK, S_ERROR
from DIRAC.Core.Utilities.Proxy import executeWithUserProxy
from DIRAC import S_ERROR, S_OK
from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations
from DIRAC.Resources.Storage.StorageElement import StorageElement
from DIRAC.Resources.Catalog.FileCatalog import FileCatalog
from DIRAC.DataManagementSystem.Utilities.DMSHelpers import DMSHelpers
from DIRAC.Core.Utilities.Proxy import executeWithUserProxy
from DIRAC.DataManagementSystem.Client.DataManager import DataManager
from DIRAC.WorkloadManagementSystem.Executor.Base.OptimizerExecutor import OptimizerExecutor
from DIRAC.DataManagementSystem.Utilities.DMSHelpers import DMSHelpers
from DIRAC.Resources.Catalog.FileCatalog import FileCatalog
from DIRAC.Resources.Storage.StorageElement import StorageElement
from DIRAC.WorkloadManagementSystem.Client import JobMinorStatus
from DIRAC.WorkloadManagementSystem.Executor.Base.OptimizerExecutor import OptimizerExecutor


class InputData(OptimizerExecutor):
Expand Down
14 changes: 6 additions & 8 deletions src/DIRAC/WorkloadManagementSystem/Executor/JobScheduling.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,20 @@

import random

from DIRAC import S_OK, S_ERROR, gConfig

from DIRAC.Core.Utilities.SiteSEMapping import getSEsForSite
from DIRAC.Core.Utilities.TimeUtilities import fromString, toEpoch
from DIRAC.Core.Security import Properties
from DIRAC import S_ERROR, S_OK
from DIRAC.ConfigurationSystem.Client.Helpers import Registry
from DIRAC.ConfigurationSystem.Client.Helpers.Path import cfgPath
from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations
from DIRAC.Core.Security import Properties
from DIRAC.Core.Utilities.SiteSEMapping import getSEsForSite
from DIRAC.Core.Utilities.TimeUtilities import fromString, toEpoch
from DIRAC.DataManagementSystem.Utilities.DMSHelpers import DMSHelpers
from DIRAC.Resources.Storage.StorageElement import StorageElement
from DIRAC.ResourceStatusSystem.Client.SiteStatus import SiteStatus
from DIRAC.StorageManagementSystem.Client.StorageManagerClient import StorageManagerClient, getFilesToStage
from DIRAC.WorkloadManagementSystem.Client import JobStatus
from DIRAC.WorkloadManagementSystem.Client.JobState.JobState import JobState
from DIRAC.WorkloadManagementSystem.Executor.Base.OptimizerExecutor import OptimizerExecutor
from DIRAC.WorkloadManagementSystem.DB.JobDB import JobDB
from DIRAC.WorkloadManagementSystem.Client import JobStatus
from DIRAC.WorkloadManagementSystem.Executor.Base.OptimizerExecutor import OptimizerExecutor


class JobScheduling(OptimizerExecutor):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ def test_basic():

res = paDB.deletePilot("pilotRef")

# FIXME: to expand...


@patch("DIRAC.WorkloadManagementSystem.DB.PilotAgentsDB.getVOForGroup")
def test_getGroupedPilotSummary(mocked_fcn):
Expand Down Expand Up @@ -187,10 +185,4 @@ def test_PivotedPilotSummaryTable():
# pilot numbers by states:
assert "Total" in columns

# with the setup above there will be only one row, first 3 elements must match the columns.
row = res["Value"][0]
assert row[0] == testSite
assert row[1] == testCE
assert row[2] == testVO

cleanUpPilots(pilotRef)

0 comments on commit 1806b9a

Please sign in to comment.