@@ -342,27 +342,28 @@ def create_runtime(self,
342
342
runtime .append (u"--env=HOME=%s" % self .builder .outdir )
343
343
344
344
# add parameters to docker to write a container ID file
345
+ if runtimeContext .user_space_docker_cmd is None :
346
+ if runtimeContext .cidfile_dir :
347
+ cidfile_dir = runtimeContext .cidfile_dir
348
+ if not os .path .exists (str (cidfile_dir )):
349
+ _logger .error ("--cidfile-dir %s error:\n %s" , cidfile_dir ,
350
+ "directory doesn't exist, please create it first" )
351
+ exit (2 )
352
+ if not os .path .isdir (cidfile_dir ):
353
+ _logger .error ("--cidfile-dir %s error:\n %s" , cidfile_dir ,
354
+ cidfile_dir + " is not a directory, "
355
+ "please check it first" )
356
+ exit (2 )
357
+ else :
358
+ cidfile_dir = tempfile .mkdtemp (dir = runtimeContext .tmpdir_prefix )
345
359
346
- if runtimeContext .cidfile_dir :
347
- cidfile_dir = runtimeContext .cidfile_dir
348
- if not os .path .exists (str (cidfile_dir )):
349
- _logger .error ("--cidfile-dir %s error:\n %s" , cidfile_dir ,
350
- "directory doesn't exist, please create it first" )
351
- exit (2 )
352
- if not os .path .isdir (cidfile_dir ):
353
- _logger .error ("--cidfile-dir %s error:\n %s" , cidfile_dir ,
354
- cidfile_dir + " is not a directory, "
355
- "please check it first" )
356
- exit (2 )
360
+ cidfile_name = datetime .datetime .now ().strftime ("%Y%m%d%H%M%S-%f" ) + ".cid"
361
+ if runtimeContext .cidfile_prefix is not None :
362
+ cidfile_name = str (runtimeContext .cidfile_prefix + "-" + cidfile_name )
363
+ cidfile_path = os .path .join (cidfile_dir , cidfile_name )
364
+ runtime .append (u"--cidfile=%s" % cidfile_path )
357
365
else :
358
- cidfile_dir = tempfile .mkdtemp (dir = runtimeContext .tmpdir_prefix )
359
-
360
- cidfile_name = datetime .datetime .now ().strftime ("%Y%m%d%H%M%S-%f" ) + ".cid"
361
- if runtimeContext .cidfile_prefix is not None :
362
- cidfile_name = str (runtimeContext .cidfile_prefix + "-" + cidfile_name )
363
- cidfile_path = os .path .join (cidfile_dir , cidfile_name )
364
- runtime .append (u"--cidfile=%s" % cidfile_path )
365
-
366
+ cidfile_path = None
366
367
for key , value in self .environment .items ():
367
368
runtime .append (u"--env=%s=%s" % (key , value ))
368
369
0 commit comments