Skip to content

Commit

Permalink
onlbuilder: Support Python3
Browse files Browse the repository at this point in the history
Signed-off-by: Wataru Ishida <[email protected]>
  • Loading branch information
ishidawataru committed Sep 14, 2022
1 parent ca7372c commit 9650685
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docker/tools/onlbuilder
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python2
#!/usr/bin/env python

import os
import sys
Expand Down Expand Up @@ -126,10 +126,10 @@ logger.debug('arguments: %s\n' % vars(ops))

if ops.pull:
try:
print "Pulling %s..." % ops.image
print("Pulling %s..." % ops.image)
x = subprocess.check_output(('docker', 'pull', ops.image), stderr=subprocess.STDOUT)
print "done."
except subprocess.CalledProcessError, e:
print("done.")
except subprocess.CalledProcessError as e:
sys.stderr.write("** Failed to pull the docker image %s (%d):\n\n%s\n" % (ops.image, e.returncode, e.output))
sys.exit(1)

Expand Down Expand Up @@ -174,7 +174,7 @@ else:
g_docker_arguments = "docker run --privileged %(interactive)s -t -e DOCKER_IMAGE=%(image)s --name %(name)s %(ssh_options)s %(volume_options)s " % g_arg_d

if ops.isolate is not None:
if len(ops.isolate) is 0:
if len(ops.isolate) == 0:
ops.isolate.append(os.getcwd())

isolates = [ os.path.abspath(i) for i in ops.isolate ]
Expand Down

0 comments on commit 9650685

Please sign in to comment.