diff --git a/robottelo/hosts.py b/robottelo/hosts.py index c0ff1a6106..95df8e63bc 100644 --- a/robottelo/hosts.py +++ b/robottelo/hosts.py @@ -1529,13 +1529,14 @@ def register_to_cdn(self, pool_ids=None, enable_proxy=False): # Attach a pool only if the Org isn't SCA yet sub_status = self.subscription_manager_status().stdout if SM_OVERALL_STATUS['disabled'] not in sub_status: - if pool_ids is None: + if pool_ids in [None, []]: pool_ids = [settings.subscription.rhn_poolid] - cmd_result = self.subscription_manager_attach_pool(pool_ids)[0] - if cmd_result.status != 0: - raise ContentHostError( - f'Error during pool attachment, command output: {cmd_result.stdout}' - ) + for pid in pool_ids: + int(pid, 16) # raises ValueError if not a HEX number + cmd_result = self.subscription_manager_attach_pool(pool_ids) + for res in cmd_result: + if res.status != 0: + raise ContentHostError(f'Pool attachment failed with output: {res.stdout}') def ping_host(self, host): """Check the provisioned host status by pinging the ip of host