Skip to content

Commit

Permalink
Merge pull request #24 from synkd/add_user_prefix_to_allocation_names
Browse files Browse the repository at this point in the history
Add username_prefix to settings and allocation name
  • Loading branch information
synkd authored Jan 16, 2024
2 parents 85c2a4c + a188759 commit 767182f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion manifester/manifester.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ def __init__(self, manifest_category, allocation_name=None, **kwargs):

self.requester = requests
self.is_mock = False
self.allocation_name = allocation_name or "".join(random.sample(string.ascii_letters, 10))
self.allocation_name = allocation_name or f"{settings.username_prefix}-" + "".join(
random.sample(string.ascii_letters, 8)
)
self.manifest_name = Path(f"{self.allocation_name}_manifest.zip")
self.offline_token = kwargs.get("offline_token", self.manifest_data.offline_token)
self.subscription_data = self.manifest_data.subscription_data
Expand Down
1 change: 1 addition & 0 deletions manifester/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
validators = [
# Validator("offline_token", must_exist=True),
Validator("simple_content_access", default="enabled"),
Validator("username_prefix", len_min=3),
]
settings = Dynaconf(
settings_file=str(settings_path.absolute()),
Expand Down
1 change: 1 addition & 0 deletions manifester_settings.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
log_level: "info"
offline_token: ""
proxies: {"https": ""}
username_prefix: "example_username" # replace value with a unique username
manifest_category:
golden_ticket:
# An offline token can be generated at https://access.redhat.com/management/api
Expand Down

0 comments on commit 767182f

Please sign in to comment.