コード例 #1
0
 def test_render_validate_bootstrap(self):
     cloud_init = CloudInit()
     cloud_init.enable_bootstrap()
     error = self.assertRaises(CloudInitError, cloud_init.render)
     self.assertEquals(
         str(error),
         "Incomplete cloud-init: you need to call add_ssh_key, "
         "set_machine_id, set_provider_type, set_instance_id_accessor, "
         "set_zookeeper_secret, set_constraints")
コード例 #2
0
ファイル: test_cloudinit.py プロジェクト: mcclurmc/juju
 def test_render_validate_bootstrap(self):
     cloud_init = CloudInit()
     cloud_init.enable_bootstrap()
     error = self.assertRaises(CloudInitError, cloud_init.render)
     self.assertEquals(
         str(error),
         "Incomplete cloud-init: you need to call add_ssh_key, "
         "set_machine_id, set_provider_type, set_instance_id_accessor, "
         "set_zookeeper_secret")
コード例 #3
0
ファイル: test_cloudinit.py プロジェクト: mcclurmc/juju
 def construct_normal(self):
     cloud_init = CloudInit()
     cloud_init.add_ssh_key("chubb")
     cloud_init.set_machine_id("passport")
     cloud_init.set_provider_type("dummy")
     cloud_init.set_zookeeper_machines([
         DummyMachine("blah", "blah", "cotswold"),
         DummyMachine("blah", "blah", "longleat")])
     return cloud_init
コード例 #4
0
 def construct_normal(self):
     cloud_init = CloudInit()
     cloud_init.add_ssh_key("chubb")
     cloud_init.set_machine_id("passport")
     cloud_init.set_provider_type("dummy")
     cloud_init.set_zookeeper_machines([
         DummyMachine("blah", "blah", "cotswold"),
         DummyMachine("blah", "blah", "longleat")])
     return cloud_init
コード例 #5
0
ファイル: test_cloudinit.py プロジェクト: mcclurmc/juju
 def test_render_validate_normal(self):
     cloud_init = CloudInit()
     error = self.assertRaises(CloudInitError, cloud_init.render)
     self.assertEquals(
         str(error),
         "Incomplete cloud-init: you need to call add_ssh_key, "
         "set_machine_id, set_provider_type, set_zookeeper_machines")
コード例 #6
0
ファイル: test_cloudinit.py プロジェクト: mcclurmc/juju
 def test_source_validate(self):
     bad_choices = (
         (None,      False, False),
         (None,      True,  True),
         ("lp:blah", True,  True),
         ("lp:blah", False, True),
         ("lp:blah", True,  False))
     cloud_init = CloudInit()
     for choice in bad_choices:
         error = self.assertRaises(
             CloudInitError, cloud_init.set_juju_source, *choice)
         self.assertEquals(str(error), "Please specify one source")
コード例 #7
0
 def construct_bootstrap(self, with_zookeepers=False):
     cloud_init = CloudInit()
     cloud_init.enable_bootstrap()
     cloud_init.add_ssh_key("chubb")
     cloud_init.set_machine_id("passport")
     cloud_init.set_provider_type("dummy")
     cloud_init.set_instance_id_accessor("token")
     cloud_init.set_zookeeper_secret("seekrit")
     cloud_init.set_constraints(
         dummy_cs.parse(["cpu=20"]).with_series("astonishing"))
     cloud_init.set_juju_source(distro=True)
     if with_zookeepers:
         cloud_init.set_zookeeper_machines([
             DummyMachine("blah", "blah", "cotswold"),
             DummyMachine("blah", "blah", "longleat")])
     return cloud_init
コード例 #8
0
ファイル: test_cloudinit.py プロジェクト: mcclurmc/juju
 def construct_bootstrap(self, with_zookeepers=False):
     cloud_init = CloudInit()
     cloud_init.enable_bootstrap()
     cloud_init.add_ssh_key("chubb")
     cloud_init.set_machine_id("passport")
     cloud_init.set_provider_type("dummy")
     cloud_init.set_instance_id_accessor("token")
     cloud_init.set_zookeeper_secret("seekrit")
     cloud_init.set_juju_source(distro=True)
     if with_zookeepers:
         cloud_init.set_zookeeper_machines([
             DummyMachine("blah", "blah", "cotswold"),
             DummyMachine("blah", "blah", "longleat")])
     return cloud_init