Revision 13a6c760 lib/cmdlib/cluster.py
b/lib/cmdlib/cluster.py | ||
---|---|---|
2294 | 2294 |
" but missing on this node: %s", |
2295 | 2295 |
self.cfg.GetNodeName(base.uuid), utils.CommaJoin(missing)) |
2296 | 2296 |
|
2297 |
def _VerifyFileStoragePaths(self, ninfo, nresult, is_master, |
|
2298 |
enabled_disk_templates): |
|
2297 |
def _VerifyAcceptedFileStoragePaths(self, ninfo, nresult, is_master): |
|
2299 | 2298 |
"""Verifies paths in L{pathutils.FILE_STORAGE_PATHS_FILE}. |
2300 | 2299 |
|
2301 | 2300 |
@type ninfo: L{objects.Node} |
... | ... | |
2305 | 2304 |
@param is_master: Whether node is the master node |
2306 | 2305 |
|
2307 | 2306 |
""" |
2307 |
cluster = self.cfg.GetClusterInfo() |
|
2308 | 2308 |
if (is_master and |
2309 |
(utils.storage.IsFileStorageEnabled(enabled_disk_templates) or
|
|
2310 |
utils.storage.IsSharedFileStorageEnabled(enabled_disk_templates))):
|
|
2309 |
(cluster.IsFileStorageEnabled() or
|
|
2310 |
cluster.IsSharedFileStorageEnabled())):
|
|
2311 | 2311 |
try: |
2312 |
fspaths = nresult[constants.NV_FILE_STORAGE_PATHS]
|
|
2312 |
fspaths = nresult[constants.NV_ACCEPTED_STORAGE_PATHS]
|
|
2313 | 2313 |
except KeyError: |
2314 | 2314 |
# This should never happen |
2315 | 2315 |
self._ErrorIf(True, constants.CV_ENODEFILESTORAGEPATHS, ninfo.name, |
... | ... | |
2319 | 2319 |
"Found forbidden file storage paths: %s", |
2320 | 2320 |
utils.CommaJoin(fspaths)) |
2321 | 2321 |
else: |
2322 |
self._ErrorIf(constants.NV_FILE_STORAGE_PATHS in nresult,
|
|
2322 |
self._ErrorIf(constants.NV_ACCEPTED_STORAGE_PATHS in nresult,
|
|
2323 | 2323 |
constants.CV_ENODEFILESTORAGEPATHS, ninfo.name, |
2324 | 2324 |
"Node should not have returned forbidden file storage" |
2325 | 2325 |
" paths") |
... | ... | |
2669 | 2669 |
if cluster.IsFileStorageEnabled() or \ |
2670 | 2670 |
cluster.IsSharedFileStorageEnabled(): |
2671 | 2671 |
# Load file storage paths only from master node |
2672 |
node_verify_param[constants.NV_FILE_STORAGE_PATHS] = \
|
|
2672 |
node_verify_param[constants.NV_ACCEPTED_STORAGE_PATHS] = \
|
|
2673 | 2673 |
self.cfg.GetMasterNodeName() |
2674 |
if cluster.IsFileStorageEnabled(): |
|
2675 |
node_verify_param[constants.NV_FILE_STORAGE_PATH] = \ |
|
2676 |
cluster.file_storage_dir |
|
2674 | 2677 |
|
2675 | 2678 |
# bridge checks |
2676 | 2679 |
# FIXME: this needs to be changed per node-group, not cluster-wide |
... | ... | |
2834 | 2837 |
self._VerifyNodeNetwork(node_i, nresult) |
2835 | 2838 |
self._VerifyNodeUserScripts(node_i, nresult) |
2836 | 2839 |
self._VerifyOob(node_i, nresult) |
2837 |
self._VerifyFileStoragePaths(node_i, nresult, |
|
2838 |
node_i.uuid == master_node_uuid, |
|
2839 |
cluster.enabled_disk_templates) |
|
2840 |
self._VerifyAcceptedFileStoragePaths(node_i, nresult, |
|
2841 |
node_i.uuid == master_node_uuid) |
|
2840 | 2842 |
|
2841 | 2843 |
if nimg.vm_capable: |
2842 | 2844 |
self._UpdateVerifyNodeLVM(node_i, nresult, vg_name, nimg) |
Also available in: Unified diff