From c298544f22b0f1f5f350bec8eae9f5a02578275c Mon Sep 17 00:00:00 2001
From: Oran Nadler <orann>
Date: Tue, 15 May 2018 16:52:08 +0300
Subject: [PATCH] Revert "try"

This reverts commit 2724e671f7bb502c92ebee9f64077037e35a5ed8.
---
 monkey_island/cc/resources/pthmap.py          | 11 +++-------
 monkey_island/cc/resources/pthreport.py       | 22 +------------------
 .../components/pages/PassTheHashMapPage.js    |  4 +---
 3 files changed, 5 insertions(+), 32 deletions(-)

diff --git a/monkey_island/cc/resources/pthmap.py b/monkey_island/cc/resources/pthmap.py
index 05d1bf7ef..5230ef30e 100644
--- a/monkey_island/cc/resources/pthmap.py
+++ b/monkey_island/cc/resources/pthmap.py
@@ -2,7 +2,7 @@ import hashlib
 import binascii
 import copy
 import flask_restful
-from pthreport import PassTheHashReport, Machine, get_report_html
+from pthreport import PassTheHashReport, Machine
 
 from cc.auth import jwt_required
 from cc.services.edge import EdgeService
@@ -19,11 +19,6 @@ class PthMap(flask_restful.Resource):
         
         return \
             {
-                "graph": {
-                    "nodes": [{"id": x, "label": Machine(x).GetIp()} for x in v],
-                    "edges": [{"id": str(s) + str(t), "from": s, "to": t, "label": label} for s, t, label in e]
-                },
-                
-                "report_html": get_report_html()
+                "nodes": [{"id": x, "label": Machine(x).GetIp()} for x in v],
+                "edges": [{"id": str(s) + str(t), "from": s, "to": t, "label": label} for s, t, label in e]
             }
-            
diff --git a/monkey_island/cc/resources/pthreport.py b/monkey_island/cc/resources/pthreport.py
index 30cc83338..313ef6a20 100644
--- a/monkey_island/cc/resources/pthreport.py
+++ b/monkey_island/cc/resources/pthreport.py
@@ -1228,24 +1228,4 @@ def main():
         
     print """</div>"""
 if __name__ == "__main__":
-    main()
-    
-
-from cStringIO import StringIO
-import sys
-
-class Capturing(list):
-    def __enter__(self):
-        self._stdout = sys.stdout
-        sys.stdout = self._stringio = StringIO()
-        return self
-    def __exit__(self, *args):
-        self.extend(self._stringio.getvalue().splitlines())
-        del self._stringio    # free up some memory
-        sys.stdout = self._stdout
-
-def get_report_html():
-    with Capturing() as output:
-        main()
-    
-    return "\n".join(output)
+    main()
\ No newline at end of file
diff --git a/monkey_island/cc/ui/src/components/pages/PassTheHashMapPage.js b/monkey_island/cc/ui/src/components/pages/PassTheHashMapPage.js
index d60ce0abb..26ce71cc9 100644
--- a/monkey_island/cc/ui/src/components/pages/PassTheHashMapPage.js
+++ b/monkey_island/cc/ui/src/components/pages/PassTheHashMapPage.js
@@ -29,7 +29,6 @@ class PassTheHashMapPageComponent extends AuthComponent {
     super(props);
     this.state = {
       graph: {nodes: [], edges: []},
-      report_html: "",
       selected: null,
       selectedType: null,
       killPressed: false,
@@ -56,7 +55,7 @@ class PassTheHashMapPageComponent extends AuthComponent {
     this.authFetch('/api/pthmap')
       .then(res => res.json())
       .then(res => {
-        this.setState({graph: res["graph"], report_html: res["report_html"]});
+        this.setState({graph: res});
         this.props.onStatusChange();
       });
   };
@@ -71,7 +70,6 @@ class PassTheHashMapPageComponent extends AuthComponent {
           <div>
             <Graph graph={this.state.graph} options={options} />
           </div>
-          <div>{this.state.report_html}</div>
         </Col>
       </div>
     );