Commit 4501a443 authored by Guido Trotter's avatar Guido Trotter
Browse files

UploadFile: allow ancillary files



Currently UploadFile is restricted to a static set of files, and thus
gnt-cluster redist-conf (silently) fails to upload all config files.
With this patch we add the new static files we distribute, and all
hypervisor-provided ancillary files.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent f5118ade
......@@ -1463,12 +1463,18 @@ def UploadFile(file_name, data, mode, uid, gid, atime, mtime):
file_name)
return False
allowed_files = [
allowed_files = set([
constants.CLUSTER_CONF_FILE,
constants.ETC_HOSTS,
constants.SSH_KNOWN_HOSTS_FILE,
constants.VNC_PASSWORD_FILE,
]
constants.RAPI_CERT_FILE,
constants.RAPI_USERS_FILE,
])
for hv_name in constants.HYPER_TYPES:
hv_class = hypervisor.GetHypervisor(hv_name)
allowed_files.update(hv_class.GetAncillaryFiles())
if file_name not in allowed_files:
logging.error("Filename passed to UploadFile not in allowed"
......
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