From 409e17f85532039f70c05ec397531c5fe8a7e8df Mon Sep 17 00:00:00 2001 From: annapoorna-s-alt Date: Mon, 2 Dec 2024 10:33:42 +0000 Subject: [PATCH] CRAYSAT-1923: Update `sat bootsys` to support CFS v2 or v3 --- docs/man/sat-bootsys.8.rst | 3 +++ requirements-dev.lock.txt | 2 +- requirements.lock.txt | 2 +- requirements.txt | 2 +- sat/cli/bootsys/parser.py | 6 ++++++ sat/cli/bootsys/service_activity.py | 2 +- 6 files changed, 13 insertions(+), 4 deletions(-) diff --git a/docs/man/sat-bootsys.8.rst b/docs/man/sat-bootsys.8.rst index f4692e17..b3e4401f 100644 --- a/docs/man/sat-bootsys.8.rst +++ b/docs/man/sat-bootsys.8.rst @@ -159,6 +159,9 @@ These options apply to both the ``shutdown`` and ``boot`` actions. **--bos-version BOS_VERSION** The version of the BOS API to use when launching BOS sessions. +**--cfs-version CFS_VERSION** + The version of the CFS API to use when launching CFS sessions. + **--cle-bos-template** *CLE_BOS_TEMPLATE* The name of the BOS session template for shutdown or boot of COS (formerly known as CLE) compute nodes. If not specified, no diff --git a/requirements-dev.lock.txt b/requirements-dev.lock.txt index fcfef49a..f9254107 100644 --- a/requirements-dev.lock.txt +++ b/requirements-dev.lock.txt @@ -14,7 +14,7 @@ coverage==6.3.2 cray-product-catalog==2.4.1 croniter==0.3.37 cryptography==43.0.1 -csm-api-client==2.2.3 +csm-api-client==2.3.0 dataclasses-json==0.5.6 docutils==0.17.1 google-auth==2.6.0 diff --git a/requirements.lock.txt b/requirements.lock.txt index 3fffbfa2..de46f14a 100644 --- a/requirements.lock.txt +++ b/requirements.lock.txt @@ -11,7 +11,7 @@ click==8.0.4 cray-product-catalog==2.4.1 croniter==0.3.37 cryptography==43.0.1 -csm-api-client==2.2.3 +csm-api-client==2.3.0 dataclasses-json==0.5.6 google-auth==2.6.0 htmlmin==0.1.12 diff --git a/requirements.txt b/requirements.txt index 093f22e2..fb664202 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,7 +22,7 @@ argcomplete boto3 botocore cray-product-catalog >= 2.4.1 -csm-api-client >= 2.2.3, <3.0 +csm-api-client >= 2.3.0, <3.0 croniter >= 0.3, < 1.0 inflect >= 0.2.5, < 3.0 Jinja2 >= 3.0, < 4.0 diff --git a/sat/cli/bootsys/parser.py b/sat/cli/bootsys/parser.py index fc388da3..1cdb7e54 100644 --- a/sat/cli/bootsys/parser.py +++ b/sat/cli/bootsys/parser.py @@ -285,6 +285,12 @@ def add_bootsys_subparser(subparsers): help='The version of the BOS API to use for BOS operations', ) + bootsys_parser.add_argument( + '--cfs-version', + choices=['v2', 'v3'], + help='The version of the CFS API to use for CFS operations', + ) + actions_subparsers = bootsys_parser.add_subparsers( metavar='action', dest='action', help='The action to perform.' ) diff --git a/sat/cli/bootsys/service_activity.py b/sat/cli/bootsys/service_activity.py index fa28fef0..a9bf3aa7 100644 --- a/sat/cli/bootsys/service_activity.py +++ b/sat/cli/bootsys/service_activity.py @@ -383,7 +383,7 @@ def get_active_sessions(self): Raises: ServiceCheckError: if unable to get the active CFS sessions. """ - cfs_client = CFSClientBase.get_cfs_client(SATSession(), 'v2') + cfs_client = CFSClientBase.get_cfs_client(SATSession(), get_config_value('cfs.api_version')) try: sessions = cfs_client.get('sessions').json() except (APIError, ValueError) as err: