提交 09859570 编写于 作者: P Priya Wadhwa

Add further debugging for DRV_CP_ENDPOINT failure

上级 e573b928
......@@ -100,8 +100,10 @@ func tryCreateDockerNetwork(subnetAddr string, subnetMask int, name string) (net
// returns subnet and gate if exists
func dockerNetworkInspect(name string) (*net.IPNet, net.IP, error) {
rr, err := runCmd(exec.Command(Docker, "network", "inspect", name, "--format", "{{(index .IPAM.Config 0).Subnet}},{{(index .IPAM.Config 0).Gateway}}"))
cmd := exec.Command(Docker, "network", "inspect", name, "--format", "{{(index .IPAM.Config 0).Subnet}},{{(index .IPAM.Config 0).Gateway}}")
rr, err := runCmd(cmd)
if err != nil {
logDockerNetworkInspect(name)
if strings.Contains(rr.Output(), "No such network") {
return nil, nil, ErrNetworkNotFound
}
......@@ -124,6 +126,15 @@ func dockerNetworkInspect(name string) (*net.IPNet, net.IP, error) {
return subnet, gateway, nil
}
func logDockerNetworkInspect(name string) {
cmd := exec.Command(Docker, "network", "inspect", name)
rr, err := runCmd(cmd)
if err != nil {
glog.Infof("error running %v: %v", rr.Args, err)
}
glog.Infof("output of %v: %v", rr.Args, rr.Output())
}
// RemoveNetwork removes a network
func RemoveNetwork(name string) error {
if !networkExists(name) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册