From b2f69d5e886161e98b264dfa0fe64bfb55c4f88a Mon Sep 17 00:00:00 2001 From: synkd <48261305+synkd@users.noreply.github.com> Date: Tue, 12 Sep 2023 14:53:02 -0400 Subject: [PATCH] Debug failover to cloned manifests (#12515) This PR, in combination with https://github.com/SatelliteQE/manifester/pull/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. --- robottelo/host_helpers/satellite_mixins.py | 4 ++-- robottelo/hosts.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/robottelo/host_helpers/satellite_mixins.py b/robottelo/host_helpers/satellite_mixins.py index 4f469ef0d90..f6dbe08b7e4 100644 --- a/robottelo/host_helpers/satellite_mixins.py +++ b/robottelo/host_helpers/satellite_mixins.py @@ -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 diff --git a/robottelo/hosts.py b/robottelo/hosts.py index 37688b0c9d1..727e4f98c87 100644 --- a/robottelo/hosts.py +++ b/robottelo/hosts.py @@ -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()