Chore: Update openstacksdk from <1.5.0 to >=2.1.0 46/72646/1 v0.37.9
authorMatthew Watkins <mwatkins@linuxfoundation.org>
Mon, 12 Feb 2024 10:59:24 +0000 (10:59 +0000)
committerMatthew Watkins <mwatkins@linuxfoundation.org>
Mon, 12 Feb 2024 10:59:24 +0000 (10:59 +0000)
Also, updated linting tool versions with pre-commit autoupdate.
Addressed minor type checking issue flagged by flake8.
Minor file formatting changes implemented via linting.

Issue: IT-26453
Change-Id: If9f941326c3f105d71fd0014d900653633d886ea
Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
.pre-commit-config.yaml
lftools/cli/ldap_cli.py
lftools/jenkins/token.py
pyproject.toml

index 673a9e3..75fda31 100644 (file)
@@ -5,7 +5,7 @@ repos:
   ###########
 
   - repo: https://github.com/pre-commit/pre-commit-hooks
-    rev: v4.4.0
+    rev: v4.5.0
     hooks:
       - id: trailing-whitespace
 
@@ -19,23 +19,23 @@ repos:
   ##########
 
   - repo: https://github.com/ambv/black
-    rev: 23.3.0
+    rev: 24.1.1
     hooks:
     - id: black
 
   - repo: https://github.com/PyCQA/isort
-    rev: 5.12.0
+    rev: 5.13.2
     hooks:
       - id: isort
 
   - repo: https://github.com/PyCQA/flake8
-    rev: 6.0.0
+    rev: 7.0.0
     hooks:
       - id: flake8
         args: ["--max-line-length=120"]
 
   - repo: https://github.com/pre-commit/mirrors-mypy
-    rev: v1.2.0
+    rev: v1.8.0
     hooks:
       - id: mypy
         additional_dependencies:
index 241cbdf..ef356ea 100644 (file)
@@ -102,7 +102,7 @@ def csv(ctx, ldap_server, ldap_group_base, ldap_user_base, groups):
             ldap_object.protocol_version = ldap.VERSION3
             ldap_object.simple_bind_s()
         except ldap.LDAPError as e:
-            if type(e.message) == dict and "desc" in e.message:
+            if type(e.message) is dict and "desc" in e.message:
                 print(e.message["desc"])
             else:
                 print(e)
index 361dce3..8dee209 100644 (file)
@@ -33,7 +33,8 @@ def get_token(name: str, url: str, username: str, password: str, change: bool =
 
     server: jenkins.Jenkins = jenkins.Jenkins(url, username=username, password=password)  # type: ignore
 
-    get_token: str = """
+    get_token: str = (
+        """
 import hudson.model.*
 import jenkins.model.*
 import jenkins.security.*
@@ -43,7 +44,8 @@ ApiTokenProperty t = u.getProperty(ApiTokenProperty.class)
 def token = t.tokenStore.generateNewToken("{}")
 println token.plainValue
 """.format(
-        username, name
+            username, name
+        )
     )
 
     token: str = str(server.run_script(get_token))
index dd05ad6..8874f79 100644 (file)
@@ -57,7 +57,7 @@ dependencies = [
     "multi-key-dict",
     "nodeenv",
     "oauth2client",
-    "openstacksdk<1.5.0",
+    "openstacksdk>=2.1.0",
     "pbr",
     "pyasn1",
     "pyasn1-modules",