code refactor for unused import

This commit is contained in:
peng.xu 2019-10-14 13:54:37 +08:00
parent 71c67f59a3
commit 4455f539fa
5 changed files with 3 additions and 9 deletions

View File

@ -1,8 +1,6 @@
import logging
import threading
import socket
from functools import wraps
from contextlib import contextmanager
from milvus import Milvus
from mishards import (settings, exceptions)

View File

@ -1,6 +1,6 @@
import logging
from sqlalchemy import (Integer, Boolean, Text,
String, BigInteger, func, and_, or_,
String, BigInteger, and_, or_,
Column)
from sqlalchemy.orm import relationship, backref

View File

@ -7,8 +7,6 @@ from urllib.parse import urlparse
from functools import wraps
from concurrent import futures
from grpc._cython import cygrpc
from grpc._channel import _Rendezvous, _UnaryUnaryMultiCallable
from jaeger_client import Config
from milvus.grpc_gen.milvus_pb2_grpc import add_MilvusServiceServicer_to_server
from mishards.grpc_utils import is_grpc_method
from mishards.service_handler import ServiceHandler

View File

@ -1,7 +1,6 @@
import logging
import time
import datetime
from contextlib import contextmanager
from collections import defaultdict
from sqlalchemy import and_

View File

@ -9,7 +9,6 @@ import time
import copy
import threading
import queue
from functools import wraps
from kubernetes import client, config, watch
from utils import singleton
@ -17,7 +16,7 @@ from sd import ProviderManager
logger = logging.getLogger(__name__)
incluster_namespace_path = '/var/run/secrets/kubernetes.io/serviceaccount/namespace'
INCLUSTER_NAMESPACE_PATH = '/var/run/secrets/kubernetes.io/serviceaccount/namespace'
class K8SMixin:
@ -27,7 +26,7 @@ class K8SMixin:
self.kwargs = kwargs
self.v1 = kwargs.get('v1', None)
if not self.namespace:
self.namespace = open(incluster_namespace_path).read()
self.namespace = open(INCLUSTER_NAMESPACE_PATH).read()
if not self.v1:
config.load_incluster_config() if self.in_cluster else config.load_kube_config()