Ejemplo n.º 1
0
func (c *NatResetCommand) printNatScripts(pending []natcmd.UnitContainment) {
	for _, uc := range pending {
		fmt.Printf("%s:\n", uc.GatewayMachine.Id)
		natcmd.WriteScriptStart(os.Stdout)
		natcmd.WriteScriptReset(os.Stdout)
		fmt.Fprintln(os.Stdout)
	}
}
Ejemplo n.º 2
0
func (c *NatResetCommand) execNatScripts(pending []natcmd.UnitContainment) {
	for _, uc := range pending {
		var natScript bytes.Buffer
		natcmd.WriteScriptStart(&natScript)
		natcmd.WriteScriptReset(&natScript)
		err := c.ExecSsh(uc.GatewayMachine, natScript.String())
		if err != nil {
			log.Println("nat script failed on", uc.GatewayMachine.Id(), ":", err)
		}
	}
}