File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1775,7 +1775,21 @@ def url_katello_ca_rpm(self):
17751775
17761776 @property
17771777 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
17791793
17801794 def is_foremanctl_available (self ):
17811795 """Check if foremanctl is installed on the system.
You can’t perform that action at this time.
0 commit comments