Revision 08137f9e
b/lib/hypervisor/hv_kvm.py | ||
---|---|---|
57 | 57 |
hv_base.BaseHypervisor.__init__(self) |
58 | 58 |
# Let's make sure the directories we need exist, even if the RUN_DIR lives |
59 | 59 |
# in a tmpfs filesystem or has been otherwise wiped out. |
60 |
for dir in self._DIRS: |
|
61 |
if not os.path.exists(dir): |
|
62 |
os.mkdir(dir) |
|
60 |
for mydir in self._DIRS:
|
|
61 |
if not os.path.exists(mydir):
|
|
62 |
os.mkdir(mydir)
|
|
63 | 63 |
|
64 | 64 |
def _WriteNetScript(self, instance, seq, nic): |
65 | 65 |
"""Write a script to connect a net interface to the proper bridge. |
... | ... | |
111 | 111 |
""" |
112 | 112 |
result = [] |
113 | 113 |
for name in os.listdir(self._PIDS_DIR): |
114 |
file = "%s/%s" % (self._PIDS_DIR, name) |
|
115 |
if utils.IsProcessAlive(utils.ReadPidFile(file)): |
|
114 |
filename = "%s/%s" % (self._PIDS_DIR, name)
|
|
115 |
if utils.IsProcessAlive(utils.ReadPidFile(filename)):
|
|
116 | 116 |
result.append(name) |
117 | 117 |
return result |
118 | 118 |
|
... | ... | |
163 | 163 |
""" |
164 | 164 |
data = [] |
165 | 165 |
for name in os.listdir(self._PIDS_DIR): |
166 |
file = "%s/%s" % (self._PIDS_DIR, name) |
|
167 |
if utils.IsProcessAlive(utils.ReadPidFile(file)): |
|
166 |
filename = "%s/%s" % (self._PIDS_DIR, name)
|
|
167 |
if utils.IsProcessAlive(utils.ReadPidFile(filename)):
|
|
168 | 168 |
data.append(self.GetInstanceInfo(name)) |
169 | 169 |
|
170 | 170 |
return data |
... | ... | |
249 | 249 |
raise errors.HypervisorError("Failed to start instance %s: %s" % |
250 | 250 |
(instance.name)) |
251 | 251 |
|
252 |
for file in temp_files: |
|
253 |
utils.RemoveFile(file) |
|
252 |
for filename in temp_files:
|
|
253 |
utils.RemoveFile(filename)
|
|
254 | 254 |
|
255 | 255 |
def StopInstance(self, instance, force=False): |
256 | 256 |
"""Stop an instance. |
Also available in: Unified diff