Revision b2b8bcce lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
3273 | 3273 |
result = self.rpc.call_file_storage_dir_rename(inst.primary_node, |
3274 | 3274 |
old_file_storage_dir, |
3275 | 3275 |
new_file_storage_dir) |
3276 |
result.Raise()
|
|
3277 |
if not result.data:
|
|
3278 |
raise errors.OpExecError("Could not connect to node '%s' to rename"
|
|
3276 |
msg = result.RemoteFailMsg()
|
|
3277 |
if msg:
|
|
3278 |
raise errors.OpExecError("Could not rename on node %s"
|
|
3279 | 3279 |
" directory '%s' to '%s' (but the instance" |
3280 |
" has been renamed in Ganeti)" % ( |
|
3281 |
inst.primary_node, old_file_storage_dir, |
|
3282 |
new_file_storage_dir)) |
|
3283 |
|
|
3284 |
if not result.data[0]: |
|
3285 |
raise errors.OpExecError("Could not rename directory '%s' to '%s'" |
|
3286 |
" (but the instance has been renamed in" |
|
3287 |
" Ganeti)" % (old_file_storage_dir, |
|
3288 |
new_file_storage_dir)) |
|
3280 |
" has been renamed in Ganeti): %s" % |
|
3281 |
(inst.primary_node, old_file_storage_dir, |
|
3282 |
new_file_storage_dir, msg)) |
|
3289 | 3283 |
|
3290 | 3284 |
_StartInstanceDisks(self, inst, None) |
3291 | 3285 |
try: |
... | ... | |
4304 | 4298 |
file_storage_dir = os.path.dirname(instance.disks[0].logical_id[1]) |
4305 | 4299 |
result = lu.rpc.call_file_storage_dir_create(pnode, file_storage_dir) |
4306 | 4300 |
|
4307 |
if result.failed or not result.data: |
|
4308 |
raise errors.OpExecError("Could not connect to node '%s'" % pnode) |
|
4301 |
msg = result.RemoteFailMsg() |
|
4309 | 4302 |
|
4310 |
if not result.data[0]:
|
|
4311 |
raise errors.OpExecError("Failed to create directory '%s'" %
|
|
4312 |
file_storage_dir)
|
|
4303 |
if msg:
|
|
4304 |
raise errors.OpExecError("Failed to create directory '%s' on"
|
|
4305 |
" node %s: %s" % (file_storage_dir, msg))
|
|
4313 | 4306 |
|
4314 | 4307 |
# Note: this needs to be kept in sync with adding of disks in |
4315 | 4308 |
# LUSetInstanceParams |
... | ... | |
4354 | 4347 |
file_storage_dir = os.path.dirname(instance.disks[0].logical_id[1]) |
4355 | 4348 |
result = lu.rpc.call_file_storage_dir_remove(instance.primary_node, |
4356 | 4349 |
file_storage_dir) |
4357 |
if result.failed or not result.data: |
|
4358 |
logging.error("Could not remove directory '%s'", file_storage_dir) |
|
4350 |
msg = result.RemoteFailMsg() |
|
4351 |
if msg: |
|
4352 |
lu.LogWarning("Could not remove directory '%s' on node %s: %s", |
|
4353 |
file_storage_dir, instance.primary_node, msg) |
|
4359 | 4354 |
all_result = False |
4360 | 4355 |
|
4361 | 4356 |
return all_result |
Also available in: Unified diff