Exemplo n.º 1
0
 def test_sizes_to_resource(self):
     self.assertEqual(size_to_resources('1gb'), {
         'Mem': 1024,
         'CpuCores': 1,
         'Arch': 'amd64',
         'RootDisk': 30720
     })
Exemplo n.º 2
0
 def run(self):
     client = self.env.connect()
     nonce = "manual:%s" % uuid.uuid4().get_hex()
     result = client.register_machine(
         self.params['name'],
         nonce,
         series=self.options['series'],
         hardware=constraints.size_to_resources(self.params['size_id']),
         addrs=[])
     script = client.provisioning_script(result['Machine'], nonce)
     self.params['user_data'] = "#!/bin/bash\n%s" % script['Script']
     instance = self.provider.launch_instance(self.params)
     instance.machine_id = result['Machine']
     client.close()
     return instance
Exemplo n.º 3
0
 def run(self):
     client = self.env.connect()
     nonce = "manual:%s" % uuid.uuid4().get_hex()
     result = client.register_machine(
         self.params['name'],
         nonce,
         series=self.options['series'],
         hardware=constraints.size_to_resources(self.params['size_id']),
         addrs=[])
     script = client.provisioning_script(result['Machine'], nonce)
     self.params['user_data'] = "#!/bin/bash\n%s" % script['Script']
     instance = self.provider.launch_instance(self.params)
     instance.machine_id = result['Machine']
     client.close()
     return instance
 def test_sizes_to_resource(self):
     self.assertEqual(size_to_resources("1gb"), {"Mem": 1024, "CpuCores": 1, "Arch": "amd64", "RootDisk": 30720})