diff --git a/manifester/manifester.py b/manifester/manifester.py index 3619ab1..47277c4 100644 --- a/manifester/manifester.py +++ b/manifester/manifester.py @@ -48,7 +48,7 @@ def access_token(self): def create_subscription_allocation(self): allocation_data = { "headers": {"Authorization": f"Bearer {self.access_token}"}, - "proxies": self.manifest_data.proxies, + "proxies": self.manifest_data.get("proxies", settings.proxies), "params": { "name": f"{self.allocation_name}", "version": f"{self.sat_version}", @@ -73,7 +73,7 @@ def subscription_pools(self): _offset = 0 data = { "headers": {"Authorization": f"Bearer {self.access_token}"}, - "proxies": self.manifest_data.proxies, + "proxies": self.manifest_data.get("proxies", settings.proxies), "params": {"offset": _offset}, } self._subscription_pools = simple_retry( @@ -95,7 +95,7 @@ def subscription_pools(self): ) data = { "headers": {"Authorization": f"Bearer {self.access_token}"}, - "proxies": self.manifest_data.proxies, + "proxies": self.manifest_data.get("proxies", settings.proxies), "params": {"offset": _offset}, } offset_pools = simple_retry( @@ -116,7 +116,7 @@ def subscription_pools(self): def add_entitlements_to_allocation(self, pool_id, entitlement_quantity): data = { "headers": {"Authorization": f"Bearer {self.access_token}"}, - "proxies": self.manifest_data.proxies, + "proxies": self.manifest_data.get("proxies", settings.proxies), "params": {"pool": f"{pool_id}", "quantity": f"{entitlement_quantity}"}, } add_entitlements = simple_retry( @@ -134,7 +134,7 @@ def verify_allocation_entitlements(self, entitlement_quantity, subscription_name ) data = { "headers": {"Authorization": f"Bearer {self.access_token}"}, - "proxies": self.manifest_data.proxies, + "proxies": self.manifest_data.get("proxies", settings.proxies), "params": {"include": "entitlements"}, } self.entitlement_data = simple_retry( @@ -241,7 +241,7 @@ def process_subscription_pools(self, subscription_pools, subscription_data): def trigger_manifest_export(self): data = { "headers": {"Authorization": f"Bearer {self.access_token}"}, - "proxies": self.manifest_data.proxies, + "proxies": self.manifest_data.get("proxies", settings.proxies), } # Should this use the XDG Base Directory Specification? local_file = Path(f"manifests/{self.allocation_name}_manifest.zip") diff --git a/manifester_settings.yaml.example b/manifester_settings.yaml.example index d3f5f30..033413d 100644 --- a/manifester_settings.yaml.example +++ b/manifester_settings.yaml.example @@ -1,6 +1,7 @@ #rhsm-manifester settings log_level: "info" offline_token: "" +proxies: {"https": ""} manifest_category: golden_ticket: # An offline token can be generated at https://access.redhat.com/management/api