Refactor: Add annotations to lftools.helpers 38/72238/1
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Tue, 10 Oct 2023 13:23:15 +0000 (06:23 -0700)
committerAndrew Grimberg <agrimberg@linuxfoundation.org>
Tue, 10 Oct 2023 13:23:15 +0000 (06:23 -0700)
Issue: RELENG-4933
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
Change-Id: I28a94f82c6fdb04380cb2bc731ebc13811157ceb

lftools/helpers.py

index be7ff86..fa36dc7 100644 (file)
@@ -9,12 +9,13 @@
 ##############################################################################
 
 """Nexus3 REST API interface."""
+from __future__ import annotations
 
 import random
 import string
 
 
-def generate_password(length=12):
-    punctuation = "!#$%&()*+,-.:;<=>?@[]^_{|}~"
-    password_characters = string.ascii_letters + string.digits + punctuation
+def generate_password(length: int = 12) -> str:
+    punctuation: str = "!#$%&()*+,-.:;<=>?@[]^_{|}~"
+    password_characters: str = string.ascii_letters + string.digits + punctuation
     return "".join(random.choice(password_characters) for _ in range(length))