bitkeeper revision 1.1446.1.1 (428b47a7E-qEps_VFpIpa2dT5I_afw)

XendDomain.py:
  Move code to create dominfo entries for unknown domains into
  domain_lookup.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
This commit is contained in:
cl349@firebug.cl.cam.ac.uk committed 2005-05-18 13:48:23 +00:00
1 parent 3887ad07b3
commit 7218d0c4bd
1 file changed
+10 -7
+10 -7
View File
@@ -313,13 +313,7 @@ class XendDomain:
# Add entries for any domains we don't know about.
for (id, d) in doms.items():
if id not in self.domain_by_id:
log.info("Creating entry for unknown domain: id=%s", id)
savedinfo = None
try:
dominfo = XendDomainInfo.vm_recreate(savedinfo, d)
self._add_domain(dominfo)
except Exception, ex:
log.exception("Error creating domain info: id=%s", id)
self.domain_lookup(id)
# Remove entries for domains that no longer exist.
# Update entries for existing domains.
for d in self.domain_by_id.values():
@@ -449,6 +443,15 @@ class XendDomain:
dominfo = self.domain_by_name.get(name) or self.domain_by_id.get(name)
if dominfo:
return dominfo
try:
log.info("Creating entry for unknown domain: id=%s", name)
d = self.xen_domain(name)
if d:
dominfo = XendDomainInfo.vm_recreate(None, d)
self._add_domain(dominfo)
return dominfo
except Exception, ex:
log.exception("Error creating domain info: id=%s", name)
raise XendError('invalid domain: ' + name)
def domain_exists(self, name):
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.