diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 35c14b13f04cba6c3d0e8ca47c0b41d6dd5aa7f8..27dfe5f455086f64e179cd968ff1b262f509f902 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -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): diff --git a/lib/hypervisor/hv_base.py b/lib/hypervisor/hv_base.py index 7f100476f011085d57eb1dd04e606560778c347b..442cd810d1663e47154897a4583422a96c4990a3 100644 --- a/lib/hypervisor/hv_base.py +++ b/lib/hypervisor/hv_base.py @@ -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.