Revision cb91d46e lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
738 | 738 |
bad = True |
739 | 739 |
return bad |
740 | 740 |
|
741 |
|
|
742 | 741 |
def _VerifyOrphanInstances(self, instancelist, node_instance, feedback_fn): |
743 | 742 |
"""Verify the list of running instances. |
744 | 743 |
|
... | ... | |
754 | 753 |
bad = True |
755 | 754 |
return bad |
756 | 755 |
|
757 |
def _VerifyNodeConfigFiles(self, ismaster, node, file_list, feedback_fn): |
|
758 |
"""Verify the list of node config files""" |
|
759 |
|
|
760 |
bad = False |
|
761 |
for file_name in constants.MASTER_CONFIGFILES: |
|
762 |
if ismaster and file_name not in file_list: |
|
763 |
feedback_fn(" - ERROR: master config file %s missing from master" |
|
764 |
" node %s" % (file_name, node)) |
|
765 |
bad = True |
|
766 |
elif not ismaster and file_name in file_list: |
|
767 |
feedback_fn(" - ERROR: master config file %s should not exist" |
|
768 |
" on non-master node %s" % (file_name, node)) |
|
769 |
bad = True |
|
770 |
|
|
771 |
for file_name in constants.NODE_CONFIGFILES: |
|
772 |
if file_name not in file_list: |
|
773 |
feedback_fn(" - ERROR: config file %s missing from node %s" % |
|
774 |
(file_name, node)) |
|
775 |
bad = True |
|
776 |
|
|
777 |
return bad |
|
778 |
|
|
779 | 756 |
def CheckPrereq(self): |
780 | 757 |
"""Check prerequisites. |
781 | 758 |
|
... | ... | |
801 | 778 |
|
802 | 779 |
# FIXME: verify OS list |
803 | 780 |
# do local checksums |
804 |
file_names = constants.CLUSTER_CONF_FILES |
|
781 |
file_names = list(self.sstore.GetFileList()) |
|
782 |
file_names.append(constants.SSL_CERT_FILE) |
|
783 |
file_names.append(constants.CLUSTER_CONF_FILE) |
|
805 | 784 |
local_checksums = utils.FingerprintFiles(file_names) |
806 | 785 |
|
807 | 786 |
feedback_fn("* Gathering data (%d nodes)" % len(nodelist)) |
808 |
all_configfile = rpc.call_configfile_list(nodelist) |
|
809 | 787 |
all_volumeinfo = rpc.call_volume_list(nodelist, vg_name) |
810 | 788 |
all_instanceinfo = rpc.call_instance_list(nodelist) |
811 | 789 |
all_vglist = rpc.call_vg_list(nodelist) |
... | ... | |
823 | 801 |
all_vglist[node], all_nvinfo[node], |
824 | 802 |
all_rversion[node], feedback_fn) |
825 | 803 |
bad = bad or result |
826 |
# node_configfile |
|
827 |
nodeconfigfile = all_configfile[node] |
|
828 |
|
|
829 |
if not nodeconfigfile: |
|
830 |
feedback_fn(" - ERROR: connection to %s failed" % (node)) |
|
831 |
bad = True |
|
832 |
continue |
|
833 |
|
|
834 |
bad = bad or self._VerifyNodeConfigFiles(node==master, node, |
|
835 |
nodeconfigfile, feedback_fn) |
|
836 | 804 |
|
837 | 805 |
# node_volume |
838 | 806 |
volumeinfo = all_volumeinfo[node] |
... | ... | |
1452 | 1420 |
logger.Error("copy of file %s to node %s failed" % |
1453 | 1421 |
(fname, to_node)) |
1454 | 1422 |
|
1455 |
to_copy = [constants.MASTER_CRON_FILE] |
|
1456 |
to_copy.extend(ss.GetFileList()) |
|
1423 |
to_copy = ss.GetFileList() |
|
1457 | 1424 |
for fname in to_copy: |
1458 | 1425 |
if not ssh.CopyFileToNode(node, fname): |
1459 | 1426 |
logger.Error("could not copy file %s to node %s" % (fname, node)) |
Also available in: Unified diff