Ubuntu Pastebin

Paste from TheMue at Thu, 30 Jul 2015 08:32:30 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
	w, err := addresser.NewWorker(s.api)
	c.Assert(err, jc.ErrorIsNil)
	defer s.assertStop(c, w)
	s.waitForInitialDead(c)
	opsChan := dummyListen()

	// Add special test machine.
	machine, err := s.State.AddMachine("quantal", state.JobHostUnits)
	c.Assert(err, jc.ErrorIsNil)
	err = machine.SetProvisioned("foo", "really-fake", nil)
	c.Assert(err, jc.ErrorIsNil)

	// This one with a new machine is never seen in the logs.
	addr := network.NewAddress("0.1.2.9")
	ipAddr, err := s.State.AddIPAddress(addr, "foobar")
	c.Assert(err, jc.ErrorIsNil)
	err = ipAddr.AllocateTo(machine.Id(), "foo", "")
	c.Assert(err, jc.ErrorIsNil)
	c.Assert(ipAddr.InstanceId(), gc.Equals, instance.Id("foo"))

	// This one on an existing machine before NewWorker() above
        // leads to output in the logs.
	daddr := network.NewAddress("0.1.2.10")
	dipAddr, err := s.State.AddIPAddress(daddr, "foobar")
	c.Assert(err, jc.ErrorIsNil)
	err = dipAddr.AllocateTo(s.machine.Id(), "wobble", "")
	c.Assert(err, jc.ErrorIsNil)
Download as text