Expect file contents from Jenkins job

Change-Id: I4581ae321566e5ab498b283f260920063df78f45
Related-PROD: https://mirantis.jira.com/browse/PRODX-4050
diff --git a/src/com/mirantis/mk/DockerImageScanner.groovy b/src/com/mirantis/mk/DockerImageScanner.groovy
index c1ab392..14acc3c 100644
--- a/src/com/mirantis/mk/DockerImageScanner.groovy
+++ b/src/com/mirantis/mk/DockerImageScanner.groovy
@@ -95,7 +95,6 @@
                 if (s) {
                     if (image_full_name) {
                         def d = dict[issue_key_name.key]['description'] =~ /(?m)\b${image_full_name}\b/
-                        
                         if (d) {
                             found_key = [issue_key_name.key,'']
                         } else {
@@ -126,10 +125,11 @@
     return found_key
 }
 
-def reportJiraTickets(String pathToResultsJSON, String jiraCredentialsID, String jiraUserID) {
+def reportJiraTickets(String reportFileContents, String jiraCredentialsID, String jiraUserID) {
 
     def dict = [:]
 
+    def common = new com.mirantis.mk.Common()
     def cred = common.getCredentialsById(jiraCredentialsID)
     def auth = "${cred.username}:${cred.password}"
     def uri = "${cred.description}/rest/api/2/issue"
@@ -156,11 +156,9 @@
 
     InputJSON['issues'].each { jira_issue ->
         dict = updateDictionary(jira_issue['key'], dict, uri, auth, jiraUserID)
-        sleep(1000)
     }
 
-    def reportFile = new File(pathToResultsJSON)
-    def reportJSON = new JsonSlurper().parseText(reportFile.text)
+    def reportJSON = new JsonSlurper().parseText(reportFileContents)
     def imageDict = [:]
     def cves = []
     reportJSON.each{
@@ -260,6 +258,5 @@
             } else {
                 print "\n\nNothing to process for for ${image_key} and ${image.key}"
             }
-            sleep(10000)
     }
 }