Revision 7e219d1b
b/lib/cmdlib/instance_utils.py | ||
---|---|---|
291 | 291 |
CheckDiskTemplateEnabled(lu.cfg.GetClusterInfo(), instance.disk_template) |
292 | 292 |
|
293 | 293 |
if instance.disk_template in constants.DTS_FILEBASED: |
294 |
file_storage_dir = os.path.dirname(instance.disks[0].logical_id[1]) |
|
294 |
if len(instance.disks) > 0: |
|
295 |
file_storage_dir = os.path.dirname(instance.disks[0].logical_id[1]) |
|
296 |
else: |
|
297 |
if instance.disk_template == constants.DT_SHARED_FILE: |
|
298 |
file_storage_dir = utils.PathJoin(lu.cfg.GetSharedFileStorageDir(), |
|
299 |
instance.name) |
|
300 |
else: |
|
301 |
file_storage_dir = utils.PathJoin(lu.cfg.GetFileStorageDir(), |
|
302 |
instance.name) |
|
295 | 303 |
if target_node_uuid: |
296 | 304 |
tgt = target_node_uuid |
297 | 305 |
else: |
Also available in: Unified diff