Commit c16915bd authored by Guido Trotter's avatar Guido Trotter
Browse files

Add DTS_FILEBASED constant


Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent 9afa0de1
......@@ -6158,7 +6158,7 @@ class LUInstanceRename(LogicalUnit):
old_name = inst.name
rename_file_storage = False
if (inst.disk_template in (constants.DT_FILE, constants.DT_SHARED_FILE) and
if (inst.disk_template in constants.DTS_FILEBASED and
self.op.new_name != inst.name):
old_file_storage_dir = os.path.dirname(inst.disks[0].logical_id[1])
rename_file_storage = True
......@@ -7591,7 +7591,7 @@ def _CreateDisks(lu, instance, to_skip=None, target_node=None):
pnode = target_node
all_nodes = [pnode]
if instance.disk_template in (constants.DT_FILE, constants.DT_SHARED_FILE):
if instance.disk_template in constants.DTS_FILEBASED:
file_storage_dir = os.path.dirname(instance.disks[0].logical_id[1])
result = lu.rpc.call_file_storage_dir_create(pnode, file_storage_dir)
......
......@@ -388,6 +388,8 @@ DTS_MUST_ADOPT = frozenset([DT_BLOCK])
# the set of disk templates that allow migrations
DTS_MIRRORED = frozenset.union(DTS_INT_MIRROR, DTS_EXT_MIRROR)
# the set of file based disk templates
DTS_FILEBASED = frozenset([DT_FILE, DT_SHARED_FILE])
# logical disk types
LD_LV = "lvm"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment