Revision d721894a lib/utils/storage.py

b/lib/utils/storage.py
82 82
  """Retrieves the identifier of the default storage entity for the given
83 83
  storage type.
84 84

  
85
  @type cfg: C{objects.ConfigData}
86
  @param cfg: the configuration data
85 87
  @type disk_template: string
86 88
  @param disk_template: a disk template, for example 'drbd'
87 89
  @rtype: string
......
90 92

  
91 93
  """
92 94
  storage_type = constants.DISK_TEMPLATES_STORAGE_TYPE[disk_template]
95
  cluster = cfg.GetClusterInfo()
93 96
  if disk_template in GetLvmDiskTemplates():
94 97
    return (storage_type, cfg.GetVGName())
95
  # FIXME: Adjust this, once FILE_STORAGE_DIR and SHARED_FILE_STORAGE_DIR
96
  # are not in autoconf anymore.
97 98
  elif disk_template == constants.DT_FILE:
98
    return (storage_type, pathutils.DEFAULT_FILE_STORAGE_DIR)
99
    return (storage_type, cluster.file_storage_dir)
100
  # FIXME: Adjust this, once SHARED_FILE_STORAGE_DIR
101
  # is not in autoconf anymore.
99 102
  elif disk_template == constants.DT_SHARED_FILE:
100 103
    return (storage_type, pathutils.DEFAULT_SHARED_FILE_STORAGE_DIR)
101 104
  else:

Also available in: Unified diff