Revision 53c776b5 lib/hypervisor/hv_xen.py
b/lib/hypervisor/hv_xen.py | ||
---|---|---|
51 | 51 |
raise NotImplementedError |
52 | 52 |
|
53 | 53 |
@staticmethod |
54 |
def _RemoveConfigFile(instance): |
|
54 |
def _RemoveConfigFile(instance_name):
|
|
55 | 55 |
"""Remove the xen configuration file. |
56 | 56 |
|
57 | 57 |
""" |
58 |
utils.RemoveFile("/etc/xen/%s" % instance.name)
|
|
58 |
utils.RemoveFile("/etc/xen/%s" % instance_name)
|
|
59 | 59 |
|
60 | 60 |
@staticmethod |
61 | 61 |
def _GetXMList(include_node): |
... | ... | |
155 | 155 |
"""Stop an instance. |
156 | 156 |
|
157 | 157 |
""" |
158 |
self._RemoveConfigFile(instance) |
|
158 |
self._RemoveConfigFile(instance.name)
|
|
159 | 159 |
if force: |
160 | 160 |
command = ["xm", "destroy", instance.name] |
161 | 161 |
else: |
... | ... | |
290 | 290 |
if result.failed: |
291 | 291 |
raise errors.HypervisorError("Failed to migrate instance %s: %s" % |
292 | 292 |
(instance, result.output)) |
293 |
# remove old xen file after migration succeeded |
|
294 |
try: |
|
295 |
self._RemoveConfigFile(instance) |
|
296 |
except EnvironmentError, err: |
|
297 |
logger.Error("Failure while removing instance config file: %s" % |
|
298 |
str(err)) |
|
293 | 299 |
|
294 | 300 |
|
295 | 301 |
class XenPvmHypervisor(XenHypervisor): |
Also available in: Unified diff