From 1d6626dbe61f6c41e6905b6e379b83a4b4bdb031 Mon Sep 17 00:00:00 2001 From: Komal Thareja Date: Wed, 6 Nov 2024 12:55:06 -0500 Subject: [PATCH] update changelog, sort, black --- CHANGELOG.md | 3 +++ fabrictestbed_extensions/fablib/slice.py | 16 ++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31c4ba50..b54b6f4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## 1.8.0 - TBD +### Added +- Advance Scheduling Improvements (Issue [#388](https://github.com/fabric-testbed/fabrictestbed-extensions/issues/388)) ## [1.7.4] - 11/05/2024 diff --git a/fabrictestbed_extensions/fablib/slice.py b/fabrictestbed_extensions/fablib/slice.py index 1d7286a8..98991b00 100644 --- a/fabrictestbed_extensions/fablib/slice.py +++ b/fabrictestbed_extensions/fablib/slice.py @@ -2411,12 +2411,20 @@ def submit( # Generate Slice Graph slice_graph = self.get_fim_topology().serialize() - start_time_str = lease_start_time.strftime("%Y-%m-%d %H:%M:%S %z") if lease_start_time else None - end_time_str = lease_end_time.strftime("%Y-%m-%d %H:%M:%S %z") if lease_end_time else None + start_time_str = ( + lease_start_time.strftime("%Y-%m-%d %H:%M:%S %z") + if lease_start_time + else None + ) + end_time_str = ( + lease_end_time.strftime("%Y-%m-%d %H:%M:%S %z") if lease_end_time else None + ) # Create slice now or Renew slice if lease_in_hours and not lease_start_time and not lease_end_time: - end_time_str = (datetime.now(timezone.utc) + timedelta(hours=lease_in_hours)).strftime("%Y-%m-%d %H:%M:%S %z") + end_time_str = ( + datetime.now(timezone.utc) + timedelta(hours=lease_in_hours) + ).strftime("%Y-%m-%d %H:%M:%S %z") # Request slice from Orchestrator if self._is_modify(): @@ -2459,7 +2467,7 @@ def submit( ssh_key=ssh_keys, lease_end_time=end_time_str, lease_start_time=start_time_str, - lifetime=lease_in_hours + lifetime=lease_in_hours, ) if return_status == Status.OK: logging.info(