Skip to content

Commit

Permalink
force to decode in pull_log_dump
Browse files Browse the repository at this point in the history
  • Loading branch information
wjo1212 committed Jan 9, 2019
1 parent 9e578ef commit b49a509
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion aliyun/log/logclient_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def dump_worker(client, project_name, logstore_name, from_time, to_time,

count = 0
for data in res:
for log in data.get_flatten_logs_json(decode_bytes=data._is_bytes_type):
for log in data.get_flatten_logs_json(decode_bytes=True):
with open(file_path, "a+") as f:
count += 1
try:
Expand Down
2 changes: 2 additions & 0 deletions aliyun/log/pulllog_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ def loggroups_to_flattern_list(loggroup_list, time_as_str=None, decode_bytes=Non
return flatten_logs_json

def get_flatten_logs_json(self, time_as_str=None, decode_bytes=None):
decode_bytes = decode_bytes or self._is_bytes_type

if self.flatten_logs_json is None:
self.flatten_logs_json = self.loggroups_to_flattern_list(self.loggroup_list, time_as_str=time_as_str,
decode_bytes=decode_bytes)
Expand Down

0 comments on commit b49a509

Please sign in to comment.