Skip to content

Commit

Permalink
improve image check
Browse files Browse the repository at this point in the history
Signed-off-by: Nikhil Dhandre <[email protected]>
  • Loading branch information
digitronik committed Feb 11, 2019
1 parent 40eb396 commit d108edb
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions miqsel/miqsel.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def set_env(hostname=None, browser=None):
"unexpectedAlertBehaviour": "ignore",
"acceptInsecureCerts": True,
"acceptSslCerts": True,
}
},
},
}
}
Expand Down Expand Up @@ -149,9 +149,7 @@ def viewer(ctx, connection, url):
if not url:
host = ctx.invoke(hostname)
if host:
url = "{hostname}:{port}".format(
hostname=host, port=connection.conf.get("vnc_port")
)
url = "{hostname}:{port}".format(hostname=host, port=connection.conf.get("vnc_port"))
else:
click.echo("Selenium server not running...")
exit(0)
Expand Down Expand Up @@ -181,12 +179,9 @@ def start(ctx, connection):
name = connection.conf.get("container_name")

if not container:
try:
connection.client.images.get(img)
except docker.errors.ImageNotFound:
if not connection.client.images.list(name=img):
click.echo("Pulling docker images...")
click.echo("It will take some time; Please wait...")
connection.client.containers.run(img, name=name, detach=True, auto_remove=True)

connection.client.containers.run(img, name=name, detach=True, auto_remove=True)
click.echo("{} container started".format(name))
Expand Down

0 comments on commit d108edb

Please sign in to comment.