diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 0aa71fc4e6..5488b17f8f 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -1709,8 +1709,10 @@ class XendDomainInfo: dom = XendDomain.instance().domain_lookup_nr(name) if dom and dom.info['uuid'] != self.info['uuid']: - raise VmError("VM name '%s' already exists as domain %s" % - (name, str(dom.domid))) + raise VmError("VM name '%s' already exists%s" % + (name, + dom.domid is not None and + ("as domain %s" % str(dom.domid)) or "")) def update(self, info = None, refresh = True):