Skip to content

Commit

Permalink
Fix datastore data type for instance var (#480)
Browse files Browse the repository at this point in the history
* Fix datastore data type for instance var

* revert days history change
  • Loading branch information
aarontp authored Dec 11, 2019
1 parent 4ab2652 commit dc9bf73
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions turbinia/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def wait_for_request(
log.info('All {0:d} Tasks completed'.format(len(task_results)))

def get_task_data(
self, instance, project, region, days=1000, task_id=None, request_id=None,
self, instance, project, region, days=0, task_id=None, request_id=None,
user=None, function_name='gettasks'):
"""Gets task data from Google Cloud Functions.
Expand Down Expand Up @@ -609,7 +609,7 @@ def format_task_statistics(
return '\n'.join(report)

def format_task_status(
self, instance, project, region, days=1000, task_id=None, request_id=None,
self, instance, project, region, days=0, task_id=None, request_id=None,
user=None, all_fields=False, full_report=False,
priority_filter=Priority.HIGH):
"""Formats the recent history for Turbinia Tasks.
Expand Down
2 changes: 2 additions & 0 deletions turbinia/state_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ def get_task_dict(self, task):
# TODO(aarontp): Migrate this to actual Datastore namespaces
config.LoadConfig()
task_dict.update({'instance': config.INSTANCE_ID})
if isinstance(task_dict['instance'], six.binary_type):
task_dict['instance'] = codecs.decode(task_dict['instance'], 'utf-8')
return task_dict

def _validate_data(self, data):
Expand Down
2 changes: 1 addition & 1 deletion turbinia/turbiniactl.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def main():
help='When used with --statistics, the output will be in CSV format',
required=False)
parser_status.add_argument(
'-d', '--days_history', default=1000, type=int,
'-d', '--days_history', default=0, type=int,
help='Number of days of history to show', required=False)
parser_status.add_argument(
'-f', '--force', help='Gatekeeper for --close_tasks', action='store_true',
Expand Down

0 comments on commit dc9bf73

Please sign in to comment.