Skip to content

Commit

Permalink
update host: use looser matching
Browse files Browse the repository at this point in the history
  • Loading branch information
karmab committed Dec 27, 2023
1 parent f145528 commit f510eea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions ailib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ def update_host(self, hostname, overrides):
infra_env_id = self.get_infra_env_id(infra_env)
hosts = self.client.v2_list_hosts(infra_env_id=infra_env_id)
matchingids = [host['id'] for host in hosts
if host['requested_hostname'] == hostname or host['id'] == hostname or
if host['requested_hostname'].startswith(hostname) or host['id'].startswith(hostname) or
match_mac(host, hostname)]
if matchingids:
infra_envs[infra_env_id] = matchingids
Expand Down Expand Up @@ -1515,8 +1515,8 @@ def create_deployment(self, cluster, overrides, force=False, debug=False):
self.create_infra_env(infraenv, overrides)
del overrides['cluster']
if not self.saas:
info("Waiting 120s for iso to be available")
sleep(120)
info("Waiting 240s for iso to be available")
sleep(240)
if 'iso_url' in overrides:
download_iso_path = overrides.get('download_iso_path')
if download_iso_path is None:
Expand Down
10 changes: 5 additions & 5 deletions ailib/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ def create_onprem(overrides={}, debug=False):
pod_url = "https://raw.githubusercontent.com/openshift/assisted-service/master/deploy/podman/pod.yml"
response = urllib.request.urlopen(pod_url).read().decode('utf-8')
response = response.replace('latest', onprem_version).replace(f'centos7:{onprem_version}', 'centos7:latest')
if ipv6:
response = response.replace('127.0.0.1', f"[{ip}")
p.write(response)
if os.path.exists('configmap.yml'):
info("Using existing configmap.yml")
Expand All @@ -173,8 +171,10 @@ def create_onprem(overrides={}, debug=False):
cm_name = 'okd-configmap' if overrides.get('okd', False) else 'configmap'
cm_url = "https://raw.githubusercontent.com/openshift/assisted-service/master/deploy/podman/"
cm_url += f"{cm_name}.yml"
response = urllib.request.urlopen(cm_url)
c.write(response.read().decode('utf-8'))
response = urllib.request.urlopen(cm_url).read().decode('utf-8')
if ipv6:
response = response.replace('127.0.0.1:8090', f'"[{ip}":8090')
c.write(response)
if ipv6 and '[' not in ip:
ip = f"[{ip}]"
IMAGE_SERVICE_BASE_URL = f'http://{ip}:8888'
Expand All @@ -198,7 +198,7 @@ def create_onprem(overrides={}, debug=False):
call(cmd, shell=True)
storage = '--storage-driver vfs' if 'KUBERNETES_SERVICE_PORT' in os.environ else ''
network = '--network assistedv6' if ipv6 else ''
cmd = f"podman {storage} {network} play kube --replace --configmap {tmpdir}/configmap.yml {tmpdir}/pod.yml"
cmd = f"podman {storage} play kube {network} --replace --configmap {tmpdir}/configmap.yml {tmpdir}/pod.yml"
info(f"Running: {cmd}")
call(cmd, shell=True)

Expand Down

0 comments on commit f510eea

Please sign in to comment.