Skip to content

Commit

Permalink
Debug failover to cloned manifests (SatelliteQE#12515)
Browse files Browse the repository at this point in the history
This PR, in combination with
SatelliteQE/manifester#21, addresses some of the
errors that have been occurring in CI in cases where Manifester times
out when exporting a manifest due to an upstream RHSM issue. These
changes should enable Robottelo to successfully fail over to using
cloned manifests in those cases.
  • Loading branch information
synkd authored and vsedmik committed Sep 19, 2023
1 parent 26a5519 commit ca1922c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions robottelo/host_helpers/satellite_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ def upload_manifest(self, org_id, manifest=None, interface='API', timeout=None):
:returns: the manifest upload result
"""
if manifest is None:
if manifest.content is None:
manifest = clone()
if timeout is None:
# Set the timeout to 1500 seconds to align with the API timeout.
timeout = 1500000
if interface == 'CLI':
if isinstance(manifest.content, (bytes, io.BytesIO)):
if hasattr(manifest, 'path'):
self.put(f'{manifest.path}', f'{manifest.name}')
result = self.cli.Subscription.upload(
{'file': manifest.name, 'organization-id': org_id}, timeout=timeout
Expand Down
2 changes: 1 addition & 1 deletion robottelo/hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ def put(self, local_path, remote_path=None):
If local_path is a manifest object, write its contents to a temporary file
then continue with the upload.
"""
if 'utils.Manifest' in str(local_path):
if 'utils.manifest' in str(local_path):
with NamedTemporaryFile(dir=robottelo_tmp_dir) as content_file:
content_file.write(local_path.content.read())
content_file.flush()
Expand Down

0 comments on commit ca1922c

Please sign in to comment.