From 31de18adac1e570b054784fabb5b5fb4a02b0b2c Mon Sep 17 00:00:00 2001 From: Komal Thareja Date: Fri, 26 Jan 2024 12:17:14 -0500 Subject: [PATCH 1/2] allow disable auto refresh --- CHANGELOG.md | 3 ++- fabrictestbed_extensions/fablib/fablib.py | 4 ++++ pyproject.toml | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b695d94..844a7401 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,10 +6,11 @@ changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## [1.6.3] - 2024-01-26 ### Fixed +- Ability to disable auto refresh tokens (Issue [#277](https://github.com/fabric-testbed/fabrictestbed-extensions/issues/277)) - Use L2STS when connecting two facility ports via L2 (Issue [#275](https://github.com/fabric-testbed/fabrictestbed-extensions/issues/275)) ## [1.6.2] - 2024-01-23 diff --git a/fabrictestbed_extensions/fablib/fablib.py b/fabrictestbed_extensions/fablib/fablib.py index 04ca6ef3..89575224 100644 --- a/fabrictestbed_extensions/fablib/fablib.py +++ b/fabrictestbed_extensions/fablib/fablib.py @@ -566,6 +566,7 @@ def __init__( output: str = None, execute_thread_pool_size: int = 64, offline: bool = False, + auto_token_refresh: bool = True, **kwargs, ): """ @@ -615,6 +616,7 @@ def __init__( :param offline: Avoid using FABRIC services when initializing. This is ``False`` by default, and set to ``True`` only in some unit tests. + :param auto_token_refresh: Auto refresh tokens """ super().__init__( fabric_rc=fabric_rc, @@ -644,6 +646,7 @@ def __init__( self.resources = None self.links = None self.facility_ports = None + self.auto_token_refresh = auto_token_refresh if not offline: self.ssh_thread_pool_executor = ThreadPoolExecutor(execute_thread_pool_size) @@ -959,6 +962,7 @@ def __build_slice_manager(self) -> SliceManager: token_location=self.get_token_location(), initialize=True, scope="all", + auto_refresh=self.auto_token_refresh ) self.slice_manager.initialize() logging.debug("Slice manager initialized!") diff --git a/pyproject.toml b/pyproject.toml index b563cee9..f87a89e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ dependencies = [ "ipyleaflet", "ipycytoscape", "tabulate", - "fabrictestbed==1.6.7", + "fabrictestbed==1.6.8", "paramiko", "jinja2>=3.0.0", "pandas", From 0131ed1e29a1f47de870453b1172c67bb8e7d87a Mon Sep 17 00:00:00 2001 From: Komal Thareja Date: Fri, 26 Jan 2024 12:20:22 -0500 Subject: [PATCH 2/2] run black --- fabrictestbed_extensions/fablib/fablib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fabrictestbed_extensions/fablib/fablib.py b/fabrictestbed_extensions/fablib/fablib.py index 89575224..08325342 100644 --- a/fabrictestbed_extensions/fablib/fablib.py +++ b/fabrictestbed_extensions/fablib/fablib.py @@ -962,7 +962,7 @@ def __build_slice_manager(self) -> SliceManager: token_location=self.get_token_location(), initialize=True, scope="all", - auto_refresh=self.auto_token_refresh + auto_refresh=self.auto_token_refresh, ) self.slice_manager.initialize() logging.debug("Slice manager initialized!")