Revision 0fff97e9 lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
1950 | 1950 |
raise errors.OpPrereqError("Node secondary ip not reachable by TCP" |
1951 | 1951 |
" based ping to noded port") |
1952 | 1952 |
|
1953 |
cp_size = self.cfg.GetClusterInfo().candidate_pool_size |
|
1954 |
node_info = self.cfg.GetAllNodesInfo().values() |
|
1955 |
num_candidates = len([n for n in node_info |
|
1956 |
if n.master_candidate]) |
|
1957 |
master_candidate = num_candidates < cp_size |
|
1958 |
|
|
1953 | 1959 |
self.new_node = objects.Node(name=node, |
1954 | 1960 |
primary_ip=primary_ip, |
1955 |
secondary_ip=secondary_ip) |
|
1961 |
secondary_ip=secondary_ip, |
|
1962 |
master_candidate=master_candidate) |
|
1956 | 1963 |
|
1957 | 1964 |
def Exec(self, feedback_fn): |
1958 | 1965 |
"""Adds the new node to the cluster. |
Also available in: Unified diff