Repository: dmwm/wmcore
Issue: WorkQueue 1.4.3.pre4 crashes in testbed

**Impact of the bug**
Global workqueue

**Describe the bug**
WMCore 1.4.3.pre4 was deployed today in testbed (HG2012d), and with that a buggy global workqueue went to testbed.
I'm still debugging it, but the problem seems to have been injected with this PR: https://github.com/dmwm/WMCore/pull/10072

**How to reproduce it**
deploying that tag in our private VM

**Expected behavior**
Have a functional workqueue service ;) It seems to be depending on DAOs specific to WMAgent, so we should make sure that code isn't actually required by global workqueue, since it does not hold a relational database.

**Additional context and error message**
This service is now running in kubernetes, so logs can be found in vocms0750, such as:
```
[24/Nov/2020:15:19:51]  ERROR: terminating due to error: Traceback (most recent call last):
  File "/data/srv/HG2012d/sw/slc7_amd64_gcc630/cms/workqueue/1.4.3.pre4/lib/python2.7/site-packages/WMCore/REST/Main.py", line 425, in start_daemon
    self.run()
  File "/data/srv/HG2012d/sw/slc7_amd64_gcc630/cms/workqueue/1.4.3.pre4/lib/python2.7/site-packages/WMCore/REST/Main.py", line 484, in run
    self.install_application()
  File "/data/srv/HG2012d/sw/slc7_amd64_gcc630/cms/workqueue/1.4.3.pre4/lib/python2.7/site-packages/WMCore/REST/Main.py", line 258, in install_application
    module = __import__(module_name, globals(), locals(), [class_name])
  File "/data/srv/HG2012d/sw/slc7_amd64_gcc630/cms/workqueue/1.4.3.pre4/lib/python2.7/site-packages/WMCore/GlobalWorkQueue/CherryPyThreads/CleanUpTask.py", line 5, in <module>
    from WMCore.WorkQueue.WorkQueue import globalQueue
  File "/data/srv/HG2012d/sw/slc7_amd64_gcc630/cms/workqueue/1.4.3.pre4/lib/python2.7/site-packages/WMCore/WorkQueue/WorkQueue.py", line 39, in <module>
    from WMCore.WorkQueue.WMBSHelper import freeSlots
  File "/data/srv/HG2012d/sw/slc7_amd64_gcc630/cms/workqueue/1.4.3.pre4/lib/python2.7/site-packages/WMCore/WorkQueue/WMBSHelper.py", line 12, in <module>
    from WMComponent.DBS3Buffer.DBSBufferDataset import DBSBufferDataset
ImportError: No module named WMComponent.DBS3Buffer.DBSBufferDataset

[24/Nov/2020:15:19:51]  WATCHDOG: server exited with exit code 1
```

connecting to the POD itself does not work because it's getting restarted over and over.

Changed files:
src/python/WMCore/WorkQueue/WorkQueue.py

diff --git a/src/python/WMCore/WorkQueue/WorkQueue.py b/src/python/WMCore/WorkQueue/WorkQueue.py
index f5119425a..b4dfc8592 100644
--- a/src/python/WMCore/WorkQueue/WorkQueue.py
+++ b/src/python/WMCore/WorkQueue/WorkQueue.py
@@ -36,7 +36,6 @@ from WMCore.WorkQueue.DataStructs.WorkQueueElement import possibleSites
 from WMCore.WorkQueue.DataStructs.WorkQueueElementsSummary import getGlobalSiteStatusSummary
 from WMCore.WorkQueue.Policy.End import endPolicy
 from WMCore.WorkQueue.Policy.Start import startPolicy
-from WMCore.WorkQueue.WMBSHelper import freeSlots
 from WMCore.WorkQueue.WorkQueueBackend import WorkQueueBackend
 from WMCore.WorkQueue.WorkQueueBase import WorkQueueBase
 from WMCore.WorkQueue.WorkQueueExceptions import (TERMINAL_EXCEPTIONS, WorkQueueError, WorkQueueNoMatchingElements,
@@ -813,6 +812,7 @@ class WorkQueue(WorkQueueBase):
         is then used to know which work can be acquired from the parent queue or not.
         :return: a tuple of dictionaries (or empty lists)
         """
+        from WMCore.WorkQueue.WMBSHelper import freeSlots
         resources, jobCounts = freeSlots(self.params['QueueDepth'], knownCmsSites=cmsSiteNames())
         # now update jobCounts with work that is already available in the local queue
         _, jobCounts = self.backend.calculateAvailableWork(resources, jobCounts)