Skip to content

Commit

Permalink
Add support for a global setting
Browse files Browse the repository at this point in the history
  • Loading branch information
synkd committed Jul 29, 2022
1 parent e9cdf5a commit e75e84a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions manifester/manifester.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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(
Expand Down Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions manifester_settings.yaml.example
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit e75e84a

Please sign in to comment.