Skip to content

Commit 92b3a14

Browse files
committed
wrapper: fix file open modes
Commit e63b489 was all wrong. Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
1 parent 2fe39fd commit 92b3a14

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wrapper/virt-v2v-wrapper.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def get_logs(self):
179179
def handle_finish(self, data, state):
180180
""" Handle finish after successfull conversion """
181181
# Store JSON into annotation
182-
with open('/data/vm/{}.json'.format(data['vm_name']), 'b') as f:
182+
with open('/data/vm/{}.json'.format(data['vm_name']), 'rb') as f:
183183
vm_data = f.read().decode('utf-8')
184184
patch = [{
185185
"op": "add",
@@ -931,7 +931,7 @@ def _is_iso_domain(self, path):
931931
"""
932932
try:
933933
logging.debug('_is_iso_domain check for %s', path)
934-
with open(path, 'r', 'b') as f:
934+
with open(path, 'rb') as f:
935935
for line in f:
936936
if line.rstrip() == b'CLASS=Iso':
937937
return True

0 commit comments

Comments
 (0)