Fix typing issues detected by pylance
Change-Id: Id5dbc01e34e83abccb7dbbaba8edc6f7ec658ddd
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
diff --git a/osm_lcm/lcm_helm_conn.py b/osm_lcm/lcm_helm_conn.py
index d2fa2df..d7cd5fa 100644
--- a/osm_lcm/lcm_helm_conn.py
+++ b/osm_lcm/lcm_helm_conn.py
@@ -26,7 +26,7 @@
from osm_lcm.data_utils.lcm_config import VcaConfig
from osm_lcm.frontend_pb2 import PrimitiveRequest
-from osm_lcm.frontend_pb2 import SshKeyRequest, SshKeyReply
+from osm_lcm.frontend_pb2 import SshKeyRequest
from osm_lcm.frontend_grpc import FrontendExecutorStub
from osm_lcm.lcm_utils import LcmBase, get_ee_id_parts
@@ -149,7 +149,7 @@
vca_type: str = None,
*kargs,
**kwargs,
- ) -> (str, dict):
+ ) -> tuple[str, dict]:
"""
Creates a new helm execution environment deploying the helm-chat indicated in the
artifact_path
@@ -266,7 +266,7 @@
vca_type: str = None,
*kargs,
**kwargs,
- ) -> (str, dict):
+ ) -> tuple[str, dict]:
"""
Creates a new helm execution environment deploying the helm-chat indicated in the
attifact_path
@@ -730,7 +730,7 @@
stub = FrontendExecutorStub(channel)
if primitive_name == "_get_ssh_key":
self.log.debug("get ssh key, ip_addr: {}".format(ip_addr))
- reply: SshKeyReply = await stub.GetSshKey(SshKeyRequest())
+ reply = await stub.GetSshKey(SshKeyRequest())
return reply.message
# For any other primitives
async with stub.RunPrimitive.open() as stream:
diff --git a/osm_lcm/n2vc/k8s_conn.py b/osm_lcm/n2vc/k8s_conn.py
index 33e868a..092a6fa 100644
--- a/osm_lcm/n2vc/k8s_conn.py
+++ b/osm_lcm/n2vc/k8s_conn.py
@@ -61,7 +61,7 @@
@abc.abstractmethod
async def init_env(
self, k8s_creds: str, namespace: str = "kube-system", reuse_cluster_uuid=None
- ) -> (str, bool):
+ ) -> tuple[str, bool]:
"""
It prepares a given K8s cluster environment to run Charts or juju Bundles on
both sides:
diff --git a/osm_lcm/n2vc/kubectl.py b/osm_lcm/n2vc/kubectl.py
index eee63dc..4402f11 100644
--- a/osm_lcm/n2vc/kubectl.py
+++ b/osm_lcm/n2vc/kubectl.py
@@ -17,7 +17,6 @@
import base64
import logging
-from typing import Dict
import typing
import uuid
import json
@@ -167,7 +166,7 @@
def create_cluster_role(
self,
name: str,
- labels: Dict[str, str],
+ labels: typing.Dict[str, str],
namespace: str = "kube-system",
):
"""
@@ -200,7 +199,7 @@
async def create_role(
self,
name: str,
- labels: Dict[str, str],
+ labels: typing.Dict[str, str],
api_groups: list,
resources: list,
verbs: list,
@@ -303,7 +302,7 @@
def create_service_account(
self,
name: str,
- labels: Dict[str, str],
+ labels: typing.Dict[str, str],
namespace: str = "kube-system",
):
"""
@@ -356,7 +355,7 @@
self.clients[CORE_CLIENT].delete_namespaced_service_account(name, namespace)
def create_cluster_role_binding(
- self, name: str, labels: Dict[str, str], namespace: str = "kube-system"
+ self, name: str, labels: typing.Dict[str, str], namespace: str = "kube-system"
):
"""
Create a cluster role binding
@@ -386,7 +385,7 @@
name: str,
role_name: str,
sa_name: str,
- labels: Dict[str, str],
+ labels: typing.Dict[str, str],
namespace: str,
):
"""
@@ -484,7 +483,7 @@
self,
name: str,
namespace: str,
- ) -> dict:
+ ) -> typing.Dict:
"""
Get secret data