Revision 72b35807 lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
2784 | 2784 |
"OSes present on reference node %s but missing on this node: %s", |
2785 | 2785 |
base.name, utils.CommaJoin(missing)) |
2786 | 2786 |
|
2787 |
def _VerifyFileStoragePaths(self, ninfo, nresult, is_master): |
|
2788 |
"""Verifies paths in L{pathutils.FILE_STORAGE_PATHS_FILE}. |
|
2789 |
|
|
2790 |
@type ninfo: L{objects.Node} |
|
2791 |
@param ninfo: the node to check |
|
2792 |
@param nresult: the remote results for the node |
|
2793 |
@type is_master: bool |
|
2794 |
@param is_master: Whether node is the master node |
|
2795 |
|
|
2796 |
""" |
|
2797 |
node = ninfo.name |
|
2798 |
|
|
2799 |
if (is_master and |
|
2800 |
(constants.ENABLE_FILE_STORAGE or |
|
2801 |
constants.ENABLE_SHARED_FILE_STORAGE)): |
|
2802 |
try: |
|
2803 |
fspaths = nresult[constants.NV_FILE_STORAGE_PATHS] |
|
2804 |
except KeyError: |
|
2805 |
# This should never happen |
|
2806 |
self._ErrorIf(True, constants.CV_ENODEFILESTORAGEPATHS, node, |
|
2807 |
"Node did not return forbidden file storage paths") |
|
2808 |
else: |
|
2809 |
self._ErrorIf(fspaths, constants.CV_ENODEFILESTORAGEPATHS, node, |
|
2810 |
"Found forbidden file storage paths: %s", |
|
2811 |
utils.CommaJoin(fspaths)) |
|
2812 |
else: |
|
2813 |
self._ErrorIf(constants.NV_FILE_STORAGE_PATHS in nresult, |
|
2814 |
constants.CV_ENODEFILESTORAGEPATHS, node, |
|
2815 |
"Node should not have returned forbidden file storage" |
|
2816 |
" paths") |
|
2817 |
|
|
2787 | 2818 |
def _VerifyOob(self, ninfo, nresult): |
2788 | 2819 |
"""Verifies out of band functionality of a node. |
2789 | 2820 |
|
... | ... | |
3126 | 3157 |
node_verify_param[constants.NV_DRBDLIST] = None |
3127 | 3158 |
node_verify_param[constants.NV_DRBDHELPER] = drbd_helper |
3128 | 3159 |
|
3160 |
if constants.ENABLE_FILE_STORAGE or constants.ENABLE_SHARED_FILE_STORAGE: |
|
3161 |
# Load file storage paths only from master node |
|
3162 |
node_verify_param[constants.NV_FILE_STORAGE_PATHS] = master_node |
|
3163 |
|
|
3129 | 3164 |
# bridge checks |
3130 | 3165 |
# FIXME: this needs to be changed per node-group, not cluster-wide |
3131 | 3166 |
bridges = set() |
... | ... | |
3279 | 3314 |
self._VerifyNodeNetwork(node_i, nresult) |
3280 | 3315 |
self._VerifyNodeUserScripts(node_i, nresult) |
3281 | 3316 |
self._VerifyOob(node_i, nresult) |
3317 |
self._VerifyFileStoragePaths(node_i, nresult, |
|
3318 |
node == master_node) |
|
3282 | 3319 |
|
3283 | 3320 |
if nimg.vm_capable: |
3284 | 3321 |
self._VerifyNodeLVM(node_i, nresult, vg_name) |
Also available in: Unified diff