Closed tylerauerbeck closed 5 years ago
This seems to be another python2 vs. python3 issue here
Python 2 throws IOError
and Python 3 throws ValueError
Python 2
python2 -c 'from urllib import urlopen;urlopen("openshift//postgresql-ephemeral")'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib64/python2.7/urllib.py", line 87, in urlopen
return opener.open(url)
File "/usr/lib64/python2.7/urllib.py", line 213, in open
return getattr(self, name)(url)
File "/usr/lib64/python2.7/urllib.py", line 469, in open_file
return self.open_local_file(url)
File "/usr/lib64/python2.7/urllib.py", line 483, in open_local_file
raise IOError(e.errno, e.strerror, e.filename)
IOError: [Errno 2] No such file or directory: 'openshift//postgresql-ephemeral'
Python 3
python3 -c 'from urllib.request import urlopen;urlopen("openshift//postgresql-ephemeral")'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib64/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib64/python3.7/urllib/request.py", line 510, in open
req = Request(fullurl, data)
File "/usr/lib64/python3.7/urllib/request.py", line 328, in __init__
self.full_url = url
File "/usr/lib64/python3.7/urllib/request.py", line 354, in full_url
self._parse()
File "/usr/lib64/python3.7/urllib/request.py", line 383, in _parse
raise ValueError("unknown url type: %r" % self.full_url)
ValueError: unknown url type: 'openshift//postgresql-ephemeral'
Looks like the fix is something like:
try:
urlopen("foo//bar")
except (ValueError,IOError):
return return_vals
I'll submit a PR shortly
Due to the recent changes made in v2.0.7 -- it appears that we're no longer handling referring to templates already on the cluster appropriately.
Given an applier like the one below:
We get the following error:
I've confirmed that this works without any issues in
v2.0.6