Repository: dmwm/wmcore
Issue: RequestManager GetRequest DAO not propagating all request properties

WMCore/src/python/WMCore/RequestManager/RequestDB/Interface/Request/GetRequest.py (GetRequest.getRequestByName(requestName))

does not propagate Campaign and AcquisitionEra remains at default None. Other bunch of properties is probably missing as well.
Some of the extra that ReqMgrWebTools.requestDetails() does is missing there.

Also not sure why there is a number of get-request-details methods or wrappers, while some not entirely correct.


Changed files:
src/python/WMCore/RequestManager/RequestDB/Interface/Request/GetRequest.py, src/python/WMCore/HTTPFrontEnd/RequestManager/ReqMgrRESTModel.py

diff --git a/src/python/WMCore/HTTPFrontEnd/RequestManager/ReqMgrRESTModel.py b/src/python/WMCore/HTTPFrontEnd/RequestManager/ReqMgrRESTModel.py
index 0d134f6f4..bc0e8b189 100644
--- a/src/python/WMCore/HTTPFrontEnd/RequestManager/ReqMgrRESTModel.py
+++ b/src/python/WMCore/HTTPFrontEnd/RequestManager/ReqMgrRESTModel.py
@@ -256,9 +256,6 @@ class ReqMgrRESTModel(RESTModel):
         Otherwise, return an overview of all requests """
         if requestName == None:
             result = GetRequest.getRequests()
-            # is not returning e.g. Campaign which
-            # Utilities.requestDetails(requestName) does since it queries values
-            # from helper (spec) (getRequestNames does but is wrong) 
         else:
             result = Utilities.requestDetails(requestName)
             try:
@@ -649,10 +646,7 @@ class ReqMgrRESTModel(RESTModel):
         helper = Utilities.loadWorkload(request)
         couchDocId = requestName
         helper.deleteCouch(self.couchUrl, self.workloadDBName, couchDocId)
-        
-        # request = GetRequest.getRequestDetails(requestName)
-        #helper = loadWorkload(request)
-        
+                
         # #4289 - Request delete operation deletes the request from
         # MySQL/Oracle but not from CouchDB, fix here
         # Seangchan shall also fix here deleting such requests from WMStats (#4398)
diff --git a/src/python/WMCore/RequestManager/RequestDB/Interface/Request/GetRequest.py b/src/python/WMCore/RequestManager/RequestDB/Interface/Request/GetRequest.py
index ba10d4cbb..6d6dab25d 100644
--- a/src/python/WMCore/RequestManager/RequestDB/Interface/Request/GetRequest.py
+++ b/src/python/WMCore/RequestManager/RequestDB/Interface/Request/GetRequest.py
@@ -62,7 +62,6 @@ def getRequest(requestId, reverseTypes=None, reverseStatus=None):
     
     request["Group"] = groupData['group_name']
     request["Requestor"] = userData['requestor_hn_name']
-     
 
     updates = ChangeState.getProgress(requestName)
     request['percent_complete'], request['percent_success'] = percentages(updates)
@@ -81,8 +80,13 @@ def getRequest(requestId, reverseTypes=None, reverseStatus=None):
     request['InputDatasets'] = datasetsIn.keys()
     request['OutputDatasets'] = datasetsOut
     
+    # fetch AcquisitionEra from spec, it's not stored in Oracle at all
+    import WMCore.HTTPFrontEnd.RequestManager.ReqMgrWebTools as Utilities
+    helper = Utilities.loadWorkload(request)
+    request["AcquisitionEra"] = str(helper.getAcquisitionEra())
     return request
 
+
 def requestID(requestName):
     """ Finds the ReqMgr database ID for a request """
     factory = DBConnect.getConnection()
@@ -143,18 +147,6 @@ def getRequestDetails(requestName):
             request['percent_success'] = update['percent_success']
     return request
 
-def getAllRequestDetails():
-    requests = ListRequests.listRequests()
-    result = []
-    for request in requests:
-        requestName = request['RequestName']
-        details = getRequestDetails(requestName)
-        # take out excessive information
-        del details['RequestUpdates']
-        del details['RequestMessages']
-        result.append(details)
-    return result
-
 
 def getRequestAssignments(requestId):
     """