SubmitFailed not reporting site in wmstats
for pdmvserv_task_HIG-RunIIFall18wmLHEGS-00388__v1_T_181126_083424_8286 for example, job failed with SubmitFailed but the site is not reported in wmstat (while it should to my understanding, @amaltaro ?)
diff --git a/src/python/WMComponent/JobSubmitter/JobSubmitterPoller.py b/src/python/WMComponent/JobSubmitter/JobSubmitterPoller.py
index 5d326981b..82cf7d5d5 100644
--- a/src/python/WMComponent/JobSubmitter/JobSubmitterPoller.py
+++ b/src/python/WMComponent/JobSubmitter/JobSubmitterPoller.py
@@ -482,7 +482,8 @@ class JobSubmitterPoller(BaseWorkerThread):
             job['fwjr'] = Report()
             if exitCode in [71102, 71104]:
                 job['fwjr'].addError("JobSubmit", exitCode, "SubmitFailed",
-                                     WM_JOB_ERROR_CODES[exitCode] + ', '.join(job['possibleSites']))
+                                     WM_JOB_ERROR_CODES[exitCode] + ', '.join(job['possibleSites']),
+                                     ', '.join(job['possibleSites']))
             elif exitCode in [71101]:
                 # there is no possible site
                 if job.get("fileLocations"):
diff --git a/src/python/WMCore/FwkJobReport/Report.py b/src/python/WMCore/FwkJobReport/Report.py
index eace07937..06e93c611 100644
--- a/src/python/WMCore/FwkJobReport/Report.py
+++ b/src/python/WMCore/FwkJobReport/Report.py
@@ -278,6 +278,18 @@ class Report(object):
         """
         return getattr(self.data, 'siteName', {})
 
+
+    def _setSiteName(self, site):
+        """
+        _setSiteName_
+
+        Set the site name attribute (no step specific)
+        """
+        setattr(self.data, 'siteName', site)
+
+        return
+
+
     def getExitCodes(self):
         """
         _getExitCodes_
@@ -554,12 +566,13 @@ class Report(object):
         self.report.cleanup.removed.fileCount += 1
         return
 
-    def addError(self, stepName, exitCode, errorType, errorDetails):
+    def addError(self, stepName, exitCode, errorType, errorDetails, siteName=None):
         """
         _addError_
 
         Add an error report with an exitCode, type/class of error and
-        details of the error as a string
+        details of the error as a string.
+        Also, report attempted site if error happened before landing on it.
         """
         if self.retrieveStep(stepName) is None:
             # Create a step and set it to failed
@@ -583,6 +596,10 @@ class Report(object):
 
         setattr(stepSection.errors, "errorCount", errorCount + 1)
         self.setStepStatus(stepName=stepName, status=exitCode)
+
+        if siteName:
+            self._setSiteName(site=siteName)
+
         return
 
     def addSkippedFile(self, lfn, pfn):
['src/python/WMComponent/JobSubmitter/JobSubmitterPoller.py', 'src/python/WMCore/FwkJobReport/Report.py']