From 3417d73924a214c801f4563ad92e3242257c91c0 Mon Sep 17 00:00:00 2001 From: Lukas Pramuk Date: Fri, 15 Nov 2024 15:21:58 +0100 Subject: [PATCH] Add date stamp to allocation name --- manifester/manifester.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manifester/manifester.py b/manifester/manifester.py index 010e879..160cb51 100644 --- a/manifester/manifester.py +++ b/manifester/manifester.py @@ -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 @@ -74,7 +75,7 @@ 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( + self.allocation_name = allocation_name or f"{self.username_prefix}-{date.today().strftime("%Y%m%d")}-" + "".join( random.sample(string.ascii_letters, 8) ) self.manifest_name = Path(f"{self.allocation_name}_manifest.zip")