diff --git a/robottelo/host_helpers/satellite_mixins.py b/robottelo/host_helpers/satellite_mixins.py index ef1edab74bf..7781bedf1d8 100644 --- a/robottelo/host_helpers/satellite_mixins.py +++ b/robottelo/host_helpers/satellite_mixins.py @@ -1,4 +1,5 @@ import contextlib +import io import random import re @@ -125,7 +126,7 @@ def upload_manifest(self, org_id, manifest=None, interface='API', timeout=None): # Set the timeout to 1500 seconds to align with the API timeout. timeout = 1500000 if interface == 'CLI': - if isinstance(manifest.content, bytes): + if isinstance(manifest.content, (bytes, io.BytesIO)): self.put(f'{manifest.path}', f'{manifest.name}') result = self.cli.Subscription.upload( {'file': manifest.name, 'organization-id': org_id}, timeout=timeout @@ -136,7 +137,7 @@ def upload_manifest(self, org_id, manifest=None, interface='API', timeout=None): {'file': manifest.filename, 'organization-id': org_id}, timeout=timeout ) else: - if not isinstance(manifest, bytes): + if not isinstance(manifest, (bytes, io.BytesIO)): manifest = manifest.content result = self.api.Subscription().upload( data={'organization_id': org_id}, files={'content': manifest}