• Iustin Pop's avatar
    Fix backend import errors from GetHypervisorClass · e5a45a16
    Iustin Pop authored
    The merge of commit 360b0dc2
    
     into branch-2.1 broke import of backend,
    since it uses hypervisor.GetHypervisor() which returns an instance of
    the hypervisor. Some of the hypervisors create directories at init time,
    thus the import of backend failed due this chain if it's not done on a
    (proper) ganeti node, such as during unittest time.
    
    This patch adds in hypervisor a GetHypervisorClass() function, which
    returns the class not the instance of the hypervisor, and uses that in
    _BuildUploadFiles(). The existing GetHypervisor is then changed to use
    this function.
    Signed-off-by: default avatarIustin Pop <iustin@google.com>
    Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
    e5a45a16
backend.py 80.6 KB