Commit e1b8653f authored by Guido Trotter's avatar Guido Trotter
Browse files

_RedistributeAncillaryFiles: add hypervisor files



Each hypervisor can declare additional files to be shipped to all nodes.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 28eddce5
......@@ -1572,6 +1572,12 @@ def _RedistributeAncillaryFiles(lu, additional_nodes=None):
constants.RAPI_CERT_FILE,
constants.RAPI_USERS_FILE,
])
enabled_hypervisors = lu.cfg.GetClusterInfo().enabled_hypervisors
for hv_name in enabled_hypervisors:
hv_class = hypervisor.GetHypervisor(hv_name)
dist_files.update(hv_class.GetAncillaryFiles())
# 3. Perform the files upload
for fname in dist_files:
if os.path.exists(fname):
......
......@@ -100,6 +100,7 @@ class BaseHypervisor(object):
"""
PARAMETERS = {}
ANCILLARY_FILES = []
def __init__(self):
pass
......@@ -157,6 +158,19 @@ class BaseHypervisor(object):
"""
raise NotImplementedError
@classmethod
def GetAncillaryFiles(cls):
"""Return a list of ancillary files to be copied to all nodes as ancillary
configuration files.
@rtype: list of strings
@return: list of absolute paths of files to ship cluster-wide
"""
# By default we return a member variable, so that if an hypervisor has just
# a static list of files it doesn't have to override this function.
return cls.ANCILLARY_FILES
def Verify(self):
"""Verify the hypervisor.
......
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