Skip to content

Commit

Permalink
Add date stamp to allocation name
Browse files Browse the repository at this point in the history
  • Loading branch information
lpramuk committed Nov 15, 2024
1 parent 5821185 commit 2f46984
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions manifester/manifester.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This module defines the `Manifester` class, which provides methods for authenticating to and
interacting with the RHSM Subscription API for the purpose of generating a subscription manifest.
"""
from datetime import date
from functools import cached_property
from pathlib import Path
import random
Expand Down Expand Up @@ -74,8 +75,8 @@ def __init__(
self.username_prefix = (
self.manifest_data.get("username_prefix") or settings.username_prefix
)
self.allocation_name = allocation_name or f"{self.username_prefix}-" + "".join(
random.sample(string.ascii_letters, 8)
self.allocation_name = allocation_name or f"{self.username_prefix}-{date.today().strftime("%Y%m%d")}-" + "".join(
random.sample(string.ascii_letters, 6)
)
self.manifest_name = Path(f"{self.allocation_name}_manifest.zip")
self.offline_token = self.manifest_data.get(
Expand Down

0 comments on commit 2f46984

Please sign in to comment.