소스 검색

a-o-i: Better method for identifying master_lb

The previous check was less than reliable thanks to
potential differences between hostname / ip / connect_to.
This check should cover all instances.
Samuel Munilla 9 년 전
부모
커밋
4c84eebdda
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      utils/src/ooinstall/cli_installer.py

+ 3 - 1
utils/src/ooinstall/cli_installer.py

@@ -533,7 +533,9 @@ def get_installed_hosts(hosts, callback_facts):
     try:
         first_master = next(host for host in hosts if host.master)
         lb_hostname = callback_facts[first_master.connect_to]['master'].get('cluster_hostname', '')
-        lb_host = next(host for host in hosts if host.connect_to == lb_hostname)
+        lb_host = \
+            next(host for host in hosts if host.ip == callback_facts[lb_hostname]['common']['ip'])
+
         installed_hosts.append(lb_host)
     except (KeyError, StopIteration):
         pass