|
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,21 @@ 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 settings.server.install_method == InstallMethod.FOREMANCTL: |
| 1779 | + if 'remote-execution' in self.list_foremanctl_features(enabled=True): |
| 1780 | + result = self.execute( |
| 1781 | + f"podman exec foreman-proxy bash -c 'cat {self.rex_key_path}'" |
| 1782 | + ) |
| 1783 | + else: |
| 1784 | + raise SatelliteHostError('remote-execution feature is not enabled') |
| 1785 | + else: |
| 1786 | + result = self.execute(f'cat {self.rex_key_path}') |
| 1787 | + key = result.stdout.strip() |
| 1788 | + if not key: |
| 1789 | + raise ValueError( |
| 1790 | + f'Rex public key is empty. Command returned status {result.status}: {result.stderr}' |
| 1791 | + ) |
| 1792 | + return key |
1779 | 1793 |
|
1780 | 1794 | def is_foremanctl_available(self): |
1781 | 1795 | """Check if foremanctl is installed on the system. |
@@ -1805,8 +1819,6 @@ def detect_install_method(self): |
1805 | 1819 | :return: InstallMethod enum value |
1806 | 1820 | :rtype: InstallMethod |
1807 | 1821 | """ |
1808 | | - from robottelo.enums import InstallMethod |
1809 | | - |
1810 | 1822 | # Runtime override |
1811 | 1823 | if hasattr(self, '_install_method_override'): |
1812 | 1824 | return self._install_method_override |
@@ -1855,7 +1867,6 @@ def get_service_names(self): |
1855 | 1867 | :rtype: list |
1856 | 1868 | """ |
1857 | 1869 | from robottelo.constants import InstallationServices |
1858 | | - from robottelo.enums import InstallMethod |
1859 | 1870 |
|
1860 | 1871 | if self.install_method == InstallMethod.FOREMANCTL: |
1861 | 1872 | return InstallationServices.FOREMANCTL_SERVICES |
@@ -2271,7 +2282,6 @@ def install_satellite( |
2271 | 2282 | :param foremanctl_parameters: Parameters list for foremanctl deploy |
2272 | 2283 | :return: Installation result |
2273 | 2284 | """ |
2274 | | - from robottelo.enums import InstallMethod |
2275 | 2285 | from robottelo.utils.installer import InstallerCommand |
2276 | 2286 |
|
2277 | 2287 | # Determine method |
|
0 commit comments