@@ -113,16 +113,13 @@ def run_build():
113
113
if conf .engine == engine .Engine .DOCKER .value :
114
114
try :
115
115
import docker
116
- import packaging
117
- packaging .version .parse (docker .__version__ )
118
- except ImportError :
116
+ docker .__version__
117
+ except ImportError as e :
119
118
LOG .error ("Error, you have set Docker as container engine, "
120
119
"but the Python library is not found."
121
- "Try running 'pip install docker'" )
120
+ "Try running 'pip install docker'\n "
121
+ "Python error: %s" , e )
122
122
sys .exit (1 )
123
- except AttributeError :
124
- LOG .error ("Error, Docker Python library is too old, "
125
- "Try running 'pip install docker --upgrade'" )
126
123
if conf .squash :
127
124
squash_version = utils .get_docker_squash_version ()
128
125
LOG .info ('Image squash is enabled and "docker-squash" version '
@@ -132,10 +129,11 @@ def run_build():
132
129
try :
133
130
import podman
134
131
podman .__version__
135
- except ImportError :
136
- LOG .error ("Error, you have set podman as container engine, "
137
- "but library is not found."
138
- "Try running pip install podman" )
132
+ except ImportError as e :
133
+ LOG .error ("Error, you have set Podman as container engine, "
134
+ "but the Python library is not found."
135
+ "Try running 'pip install podman'\n "
136
+ "Python error: %s" , e )
139
137
exit (1 )
140
138
141
139
kolla = KollaWorker (conf )
0 commit comments