Skip to content

Commit

Permalink
created new proxy for non-admin user
Browse files Browse the repository at this point in the history
  • Loading branch information
amolpati30 committed Jan 10, 2025
1 parent 5a4cfbe commit a969c2d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/foreman/api/test_discoveredhost.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def test_positive_provision_pxe_host(
mac = provisioning_host._broker_args['provisioning_nic_mac_addr']
wait_for(
lambda: sat.api.DiscoveredHost().search(query={'mac': mac}) != [],
timeout=1500,
timeout=2000,
delay=40,
)
discovered_host = sat.api.DiscoveredHost().search(query={'mac': mac})[0]
Expand Down
8 changes: 7 additions & 1 deletion tests/foreman/cli/test_ansible.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,9 +710,15 @@ def _finalize():
)
assert result.status == 0, f'Failed to register host: {result.stderr}'
proxy_id = target_sat.nailgun_smart_proxy.id
new_port = target_sat.available_capsule_port
with target_sat.default_url_on_new_port(9090, new_port) as url:
proxy_id_new = target_sat.api.SmartProxy(url=url).search(
query={'search': f'name={target_sat.hostname}'}
)[0]
target_host = rhel_contenthost.nailgun_host
new_proxy = proxy_id if auth_type == 'admin' else proxy_id_new
target_sat.cli.Ansible.with_user(username, password).roles_sync(
{'role-names': SELECTED_ROLE, 'proxy-id': proxy_id}
{'role-names': SELECTED_ROLE, 'proxy-id': new_proxy}
)
result = target_sat.cli.Host.with_user(username, password).ansible_roles_assign(
{'id': target_host.id, 'ansible-roles': f'{SELECTED_ROLE}'}
Expand Down

0 comments on commit a969c2d

Please sign in to comment.