Use python3 for fuel_logs.py to support XZ compression for tarfile

- set python3 as an interpretator
- add '.decode()' to convert strings from 'binary' mode for python3

Change-Id: I92fe5fcee471af44e2c0bad3bf437480f12df703
Closes-Bug: #1439135
This commit is contained in:
Dennis Dmitriev 2015-04-01 14:10:28 +03:00
parent c56b4674a6
commit 587cd6e418
1 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2015 Mirantis, Inc. # Copyright 2015 Mirantis, Inc.
# #
@ -284,7 +284,7 @@ class AbstractLog(object):
:return: iter :return: iter
""" """
for record in self.content: for record in self.content:
yield record yield record.decode()
def parse(self, content): def parse(self, content):
""" """
@ -367,7 +367,8 @@ class AstuteLog(AbstractLog):
""" """
record = '' record = ''
date_regexp = re.compile(r'^\d+-\d+-\S+\s') date_regexp = re.compile(r'^\d+-\d+-\S+\s')
for line in self.content: for bline in self.content:
line = bline.decode()
if re.match(date_regexp, line): if re.match(date_regexp, line):
yield record yield record
record = line record = line