Repository: wso2/testgrid
Issue: Change integration-test log file path as to refer from databucket

**Description:**
With the introduction of data-buckets, the integration-test log file is downloaded to the data-bucket of the relevant build. So the report generator must refer the log from there.

<!-- Give a brief description of the issue -->

**Suggested Labels:**
Bug

<!-- Optional comma separated list of suggested labels. Non committers can’t assign labels to issues, so this will help issue creators who are not a committer to suggest possible labels-->

**Suggested Assignees:**
pasindujw
<!--Optional comma separated list of suggested team members who should attend the issue. Non committers can’t assign issues to assignees, so this will help issue creators who are not a committer to suggest possible assignees-->

**Affected Product Version:**
m34

Changed files:
common/src/main/java/org/wso2/testgrid/common/util/TestGridUtil.java, reporting/src/main/java/org/wso2/testgrid/reporting/EmailReportProcessor.java

diff --git a/common/src/main/java/org/wso2/testgrid/common/util/TestGridUtil.java b/common/src/main/java/org/wso2/testgrid/common/util/TestGridUtil.java
index 59f676db..f44d1825 100755
--- a/common/src/main/java/org/wso2/testgrid/common/util/TestGridUtil.java
+++ b/common/src/main/java/org/wso2/testgrid/common/util/TestGridUtil.java
@@ -446,22 +446,14 @@ public final class TestGridUtil {
     }
 
     /**
-     * Returns the path of the integration test log file.
+     * Returns the absolute path of the integration test log file.
      *
      * @param testPlan test-plan
-     * @param relative Whether the path need to be returned relative to testgrid.home or not
      * @return log file path
      */
-    public static String deriveTestIntegrationLogFilePath(TestPlan testPlan, Boolean relative)
+    public static String deriveTestIntegrationLogFilePath(TestPlan testPlan)
             throws TestGridException {
-        String productName = testPlan.getDeploymentPattern().getProduct().getName();
-        String testPlanDirName = TestGridUtil.deriveTestPlanDirName(testPlan);
-        String dirPrefix = "";
-        if (!relative) {
-            dirPrefix = getTestGridHomePath();
-        }
-        return Paths.get(dirPrefix, TestGridConstants.TESTGRID_JOB_DIR, productName,
-                TestGridConstants.TESTGRID_BUILDS_DIR, testPlanDirName,
+        return Paths.get(DataBucketsHelper.getOutputLocation(testPlan).toString(),
                 TestGridConstants.TEST_INTEGRATION_LOG_FILE_NAME).toString();
     }
 
diff --git a/reporting/src/main/java/org/wso2/testgrid/reporting/EmailReportProcessor.java b/reporting/src/main/java/org/wso2/testgrid/reporting/EmailReportProcessor.java
index e57b4fb0..e4841fe3 100644
--- a/reporting/src/main/java/org/wso2/testgrid/reporting/EmailReportProcessor.java
+++ b/reporting/src/main/java/org/wso2/testgrid/reporting/EmailReportProcessor.java
@@ -109,7 +109,7 @@ public class EmailReportProcessor {
         StringBuilder stringBuilder = new StringBuilder();
         Path filePath;
         try {
-            filePath = Paths.get(TestGridUtil.deriveTestIntegrationLogFilePath(testPlan, false));
+            filePath = Paths.get(TestGridUtil.deriveTestIntegrationLogFilePath(testPlan));
         } catch (TestGridException e) {
             throw new ReportingException("Error occurred while deriving integration-test log file path to get" +
                     " integration test results for test-plan with id " + testPlan.getId() + "of the product " +