Commit 3439fd6b authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Check fingerprint of file with allowed file storage paths



This makes differences show up in “gnt-cluster verify”.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 1a770ce5
......@@ -215,6 +215,9 @@ def _BuildUploadFileList():
hv_class = hypervisor.GetHypervisorClass(hv_name)
allowed_files.update(hv_class.GetAncillaryFiles()[0])
assert pathutils.FILE_STORAGE_PATHS_FILE not in allowed_files, \
"Allowed file storage paths should never be uploaded via RPC"
return frozenset(allowed_files)
......
......@@ -4291,12 +4291,12 @@ def _ComputeAncillaryFiles(cluster, redist):
pathutils.RAPI_USERS_FILE,
])
 
if not redist:
files_all.update(pathutils.ALL_CERT_FILES)
files_all.update(ssconf.SimpleStore().GetFileList())
else:
if redist:
# we need to ship at least the RAPI certificate
files_all.add(pathutils.RAPI_CERT_FILE)
else:
files_all.update(pathutils.ALL_CERT_FILES)
files_all.update(ssconf.SimpleStore().GetFileList())
 
if cluster.modify_etc_hosts:
files_all.add(constants.ETC_HOSTS)
......@@ -4317,6 +4317,12 @@ def _ComputeAncillaryFiles(cluster, redist):
if not redist:
files_mc.add(pathutils.CLUSTER_CONF_FILE)
 
# File storage
if (not redist and
(constants.ENABLE_FILE_STORAGE or constants.ENABLE_SHARED_FILE_STORAGE)):
files_all.add(pathutils.FILE_STORAGE_PATHS_FILE)
files_opt.add(pathutils.FILE_STORAGE_PATHS_FILE)
# Files which should only be on VM-capable nodes
files_vm = set(
filename
......@@ -4338,6 +4344,10 @@ def _ComputeAncillaryFiles(cluster, redist):
assert all_files_set.issuperset(files_opt), \
"Optional file not in a different required list"
 
# This one file should never ever be re-distributed via RPC
assert not (redist and
pathutils.FILE_STORAGE_PATHS_FILE in all_files_set)
return (files_all, files_opt, files_mc, files_vm)
 
 
......
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