lib/mkit/app/helpers/docker_helper.rb in mkit-0.2.0 vs lib/mkit/app/helpers/docker_helper.rb in mkit-0.3.0

- old
+ new

@@ -36,12 +36,12 @@ def create_network(network_name) MKIt::CmdRunner.run("docker network create #{network_name}") end - def inspect_network(network_name) - x = MKIt::CmdRunner.run("docker network inspect #{network_name}") - JSON.parse(x).first + def network_exists?(network_name) + x = MKIt::CmdRunner.run("docker network ls") + x.match(/\b#{network_name}\b/) end def dettach_network(network_id, instance_id) MKIt::CmdRunner.run("docker network disconnect #{network_id} #{instance_id}") end