2
2
"""Processes cloud artifacts using a remote Turbinia instance."""
3
3
from __future__ import unicode_literals
4
4
from __future__ import absolute_import
5
+ from __future__ import print_function
5
6
6
7
import os
7
8
import tempfile
17
18
18
19
19
20
class TurbiniaProcessor (BaseModule ):
20
- """Process cloud disks with remote Turbinia instance.
21
+ """Process cloud disks with a remote Turbinia instance.
21
22
22
23
Attributes:
23
24
client: A TurbiniaClient object
@@ -52,6 +53,8 @@ def setup(self, disk_name, project, zone): # pylint: disable=arguments-differ
52
53
project: The project containing the disk to process
53
54
zone: The zone containing the disk to process
54
55
"""
56
+ # TODO: Consider the case when multiple disks are provided by the previous
57
+ # module or by the CLI.
55
58
if self .state .input and not disk_name :
56
59
_ , disk = self .state .input [0 ]
57
60
disk_name = disk .name
@@ -81,6 +84,7 @@ def setup(self, disk_name, project, zone): # pylint: disable=arguments-differ
81
84
self .client = turbinia_client .TurbiniaClient ()
82
85
except TurbiniaException as e :
83
86
self .state .add_error (e , critical = True )
87
+ return
84
88
85
89
def cleanup (self ):
86
90
pass
@@ -107,9 +111,9 @@ def process(self):
107
111
task_data = self .client .get_task_data (
108
112
instance = self .instance , project = self .project , region = self .region ,
109
113
request_id = request .request_id )
110
- print self .client .format_task_status (
114
+ print ( self .client .format_task_status (
111
115
instance = self .instance , project = self .project , region = self .region ,
112
- request_id = request .request_id , all_fields = True )
116
+ request_id = request .request_id , all_fields = True ))
113
117
except TurbiniaException as e :
114
118
self .state .add_error (e , critical = True )
115
119
return
@@ -138,6 +142,7 @@ def process(self):
138
142
139
143
# For files remote in GCS we copy each plaso file back from GCS and then add
140
144
# to output paths
145
+ # TODO: Externalize fetching files from GCS buckets to a different module.
141
146
for path in gs_paths :
142
147
local_path = None
143
148
try :
0 commit comments