Skip to content

Commit

Permalink
Correct small logic bugs, add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
hexylena committed Sep 23, 2015
1 parent 04c5e68 commit c9e9c95
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/galaxy/web/base/interactive_environments.py
Expand Up @@ -246,11 +246,15 @@ def get_proxied_ports(self, container_id):
containers with multiple ports working.
"""
command = self.attr.viz_config.get("docker", "command")
command.replace(
command = command.replace(
"run {docker_args}",
"inspect %s" % container_id
)
output = check_output(command)
log.info("Inspecting docker container {0} with command [{1}]".format(
container_id,
command
))
output = check_output(command, shell=True)
inspect_data = json.loads(output)
# [{
# "NetworkSettings" : {
Expand All @@ -267,7 +271,7 @@ def get_proxied_ports(self, container_id):
for binding in port_mappings[port_name]:
mappings.append((
port_name.replace('/tcp', '').replace('/udp', ''),
port_mappings[port_name][binding]['HostIp'],
port_mappings[port_name][binding]['HostPort']
binding['HostIp'],
binding['HostPort']
))
return mappings

0 comments on commit c9e9c95

Please sign in to comment.