예제 #1
0
파일: main.go 프로젝트: tasdomas/juju-nat
func (c *NatOutboundCommand) printNatScripts(pending []natcmd.UnitContainment) {
	for _, uc := range pending {
		fmt.Printf("%s:\n", uc.GatewayMachine.Id)
		natcmd.WriteScriptStart(os.Stdout)
		natcmd.WriteScriptOutbound(os.Stdout, uc)
		fmt.Fprintln(os.Stdout)
	}
}
예제 #2
0
파일: main.go 프로젝트: tasdomas/juju-nat
func (c *NatOutboundCommand) execNatScripts(pending []natcmd.UnitContainment) {
	for _, uc := range pending {
		var natScript bytes.Buffer
		natcmd.WriteScriptStart(&natScript)
		natcmd.WriteScriptOutbound(&natScript, uc)
		err := c.ExecSsh(uc.GatewayMachine, natScript.String())
		if err != nil {
			log.Println("nat script failed on", uc.GatewayMachine.Id(), ":", err)
		}
	}
}