Make fetch_wheels.py python3 compatible
- Exceptions need to be in brackets - readonly mode for open() is 'r' Change-Id: Id2904f3a3938dbe990e997c40ef57e75db3ca143 Story: 2004513
This commit is contained in:
parent
d0ef425ef6
commit
aa972e9f03
|
@ -65,7 +65,7 @@ def protocol_detection(registry, protocol='http'):
|
||||||
elif index < len(PROTOCOLS) - 1:
|
elif index < len(PROTOCOLS) - 1:
|
||||||
return protocol_detection(registry, PROTOCOLS[index + 1])
|
return protocol_detection(registry, PROTOCOLS[index + 1])
|
||||||
else:
|
else:
|
||||||
raise Exception, "Cannot detect protocol for registry: {} due to error: {}".format(registry,err)
|
raise Exception("Cannot detect protocol for registry: {} due to error: {}".format(registry,err))
|
||||||
except:
|
except:
|
||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
|
@ -96,7 +96,7 @@ def main():
|
||||||
if 'WHEELS' in os.environ:
|
if 'WHEELS' in os.environ:
|
||||||
wheels = os.environ['WHEELS']
|
wheels = os.environ['WHEELS']
|
||||||
else:
|
else:
|
||||||
with open('/opt/loci/wheels', 'ro') as f:
|
with open('/opt/loci/wheels', 'r') as f:
|
||||||
wheels = f.read()
|
wheels = f.read()
|
||||||
|
|
||||||
if wheels.startswith('/'):
|
if wheels.startswith('/'):
|
||||||
|
|
Loading…
Reference in New Issue