|
54 | 54 | RHSSO_USER_UPDATE, |
55 | 55 | SATELLITE_VERSION, |
56 | 56 | ) |
57 | | -from robottelo.enums import NetworkType |
| 57 | +from robottelo.enums import InstallMethod, NetworkType |
58 | 58 | from robottelo.exceptions import ( |
59 | 59 | CapsuleHostError, |
60 | 60 | CLIFactoryError, |
@@ -1775,7 +1775,19 @@ def url_katello_ca_rpm(self): |
1775 | 1775 |
|
1776 | 1776 | @property |
1777 | 1777 | def rex_pub_key(self): |
1778 | | - return self.execute(f'cat {self.rex_key_path}').stdout.strip() |
| 1778 | + if self.install_method == InstallMethod.FOREMANCTL: |
| 1779 | + result = self.execute( |
| 1780 | + 'podman exec foreman-proxy cat /var/lib/foreman-proxy/ssh/id_rsa_foreman_proxy.pub' |
| 1781 | + ) |
| 1782 | + else: |
| 1783 | + result = self.execute(f'cat {self.rex_key_path}') |
| 1784 | + key = result.stdout.strip() |
| 1785 | + if not key: |
| 1786 | + raise ValueError( |
| 1787 | + f'Rex public key is empty. Command returned status {result.status}. ' |
| 1788 | + f'stderr: {result.stderr}' |
| 1789 | + ) |
| 1790 | + return key |
1779 | 1791 |
|
1780 | 1792 | def is_foremanctl_available(self): |
1781 | 1793 | """Check if foremanctl is installed on the system. |
@@ -1805,8 +1817,6 @@ def detect_install_method(self): |
1805 | 1817 | :return: InstallMethod enum value |
1806 | 1818 | :rtype: InstallMethod |
1807 | 1819 | """ |
1808 | | - from robottelo.enums import InstallMethod |
1809 | | - |
1810 | 1820 | # Runtime override |
1811 | 1821 | if hasattr(self, '_install_method_override'): |
1812 | 1822 | return self._install_method_override |
@@ -1855,7 +1865,6 @@ def get_service_names(self): |
1855 | 1865 | :rtype: list |
1856 | 1866 | """ |
1857 | 1867 | from robottelo.constants import InstallationServices |
1858 | | - from robottelo.enums import InstallMethod |
1859 | 1868 |
|
1860 | 1869 | if self.install_method == InstallMethod.FOREMANCTL: |
1861 | 1870 | return InstallationServices.FOREMANCTL_SERVICES |
@@ -2268,7 +2277,6 @@ def install_satellite( |
2268 | 2277 | :param foremanctl_parameters: Parameters list for foremanctl deploy |
2269 | 2278 | :return: Installation result |
2270 | 2279 | """ |
2271 | | - from robottelo.enums import InstallMethod |
2272 | 2280 | from robottelo.utils.installer import InstallerCommand |
2273 | 2281 |
|
2274 | 2282 | # Determine method |
|
0 commit comments