示例#1
0
 def test_agent_build_get_by_triple(self):
     self.mox.StubOutWithMock(db, 'agent_build_get_by_triple')
     db.agent_build_get_by_triple(self.context, 'fake-hv', 'fake-os',
                                  'fake-arch').AndReturn('it worked')
     self.mox.ReplayAll()
     result = self.conductor.agent_build_get_by_triple(
         self.context, 'fake-hv', 'fake-os', 'fake-arch')
     self.assertEqual(result, 'it worked')
示例#2
0
 def test_agent_build_get_by_triple(self):
     self.mox.StubOutWithMock(db, 'agent_build_get_by_triple')
     db.agent_build_get_by_triple(self.context, 'fake-hv', 'fake-os',
                                  'fake-arch').AndReturn('it worked')
     self.mox.ReplayAll()
     result = self.conductor.agent_build_get_by_triple(self.context,
                                                       'fake-hv',
                                                       'fake-os',
                                                       'fake-arch')
     self.assertEqual(result, 'it worked')
示例#3
0
 def modify(self, os, architecture, version, url, md5hash,
            hypervisor='xen'):
     """Update an existing agent build."""
     ctxt = context.get_admin_context()
     agent_build_ref = db.agent_build_get_by_triple(ctxt,
                               hypervisor, os, architecture)
     db.agent_build_update(ctxt, agent_build_ref['id'],
                           {'version': version,
                            'url': url,
                            'md5hash': md5hash})
示例#4
0
 def test_agent_build_get_by_triple(self):
     self.mox.StubOutWithMock(db, "agent_build_get_by_triple")
     db.agent_build_get_by_triple(self.context, "fake-hv", "fake-os", "fake-arch").AndReturn("it worked")
     self.mox.ReplayAll()
     result = self.conductor.agent_build_get_by_triple(self.context, "fake-hv", "fake-os", "fake-arch")
     self.assertEqual(result, "it worked")
示例#5
0
文件: agent.py 项目: Dynavisor/nova
 def get_by_triple(cls, context, hypervisor, os, architecture):
     db_agent = db.agent_build_get_by_triple(context, hypervisor,
                                             os, architecture)
     if not db_agent:
         return None
     return cls._from_db_object(context, objects.Agent(), db_agent)
示例#6
0
文件: fake.py 项目: gajen/nova
 def agent_build_get_by_triple(self, context, hypervisor, os, architecture):
     return db.agent_build_get_by_triple(context,
                                         hypervisor, os, architecture)
示例#7
0
文件: fake.py 项目: pengkui/nova
 def agent_build_get_by_triple(self, context, hypervisor, os, architecture):
     return db.agent_build_get_by_triple(context, hypervisor, os,
                                         architecture)
示例#8
0
 def get_by_triple(cls, context, hypervisor, os, architecture):
     db_agent = db.agent_build_get_by_triple(context, hypervisor, os,
                                             architecture)
     if not db_agent:
         return None
     return cls._from_db_object(context, objects.Agent(), db_agent)
示例#9
0
 def delete(self, os, architecture, hypervisor='xen'):
     """Deletes an existing agent build."""
     ctxt = context.get_admin_context()
     agent_build_ref = db.agent_build_get_by_triple(ctxt,
                               hypervisor, os, architecture)
     db.agent_build_destroy(ctxt, agent_build_ref['id'])
示例#10
0
文件: manage.py 项目: comstud/nova
 def modify(self, os, architecture, version, url, md5hash, hypervisor="xen"):
     """Update an existing agent build."""
     ctxt = context.get_admin_context()
     agent_build_ref = db.agent_build_get_by_triple(ctxt, hypervisor, os, architecture)
     db.agent_build_update(ctxt, agent_build_ref["id"], {"version": version, "url": url, "md5hash": md5hash})