allow create-repo-list to be run without six
Some distros (gentoo) do not come with six in the base image (stage3), it is installed later in the image build. Use the native urlopen/URLError if the six version is not available. Change-Id: Id1c52aa17e565c16369645508e43e4f485defa66
This commit is contained in:
parent
083ddaf2f9
commit
d29d9313d7
@ -19,8 +19,14 @@
|
||||
import os
|
||||
import yaml
|
||||
|
||||
from six.moves.urllib.request import urlopen
|
||||
from six.moves.urllib.error import URLError
|
||||
try:
|
||||
from six.moves.urllib.request import urlopen
|
||||
except ImportError:
|
||||
from urllib.request import urlopen
|
||||
try:
|
||||
from six.moves.urllib.error import URLError
|
||||
except ImportError:
|
||||
from urllib.request import URLError
|
||||
|
||||
URL = ('https://opendev.org/openstack/project-config/'
|
||||
'raw/gerrit/projects.yaml')
|
||||
|
Loading…
Reference in New Issue
Block a user