Commit 9b8f5a60 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Pre-merge code cleanup

parent b667fcdd
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -37,6 +37,16 @@ spec:
          env:
            - name: OSM_ADDRESS
              value: "127.0.0.1"
            - name: OSM_PORT
              value: "80"
            - name: OSM_USERNAME
              value: "admin"
            - name: OSM_PASSWORD
              value: "admin"
            - name: OSM_PROJECT
              value: "admin"
            - name: OSM_VERIFY_TLS
              value: "FALSE"
            - name: LOG_LEVEL
              value: "INFO"
          readinessProbe:
+9 −7
Original line number Diff line number Diff line
@@ -15,21 +15,23 @@
import grpc, logging
from common.Constants import ServiceNameEnum
from common.Settings import get_service_host, get_service_port_grpc
from common.proto.context_pb2 import Empty
from common.proto.osm_client_pb2_grpc import OsmServiceStub
from common.proto.osm_client_pb2 import CreateRequest, CreateResponse, NsiListResponse, GetRequest, GetResponse, DeleteRequest, DeleteResponse
from common.proto.context_pb2 import (Empty)
from common.proto.osm_client_pb2 import (
    CreateRequest, CreateResponse, NsiListResponse, GetRequest, GetResponse,
    DeleteRequest, DeleteResponse
)
from common.tools.client.RetryDecorator import retry, delay_exponential
from common.tools.grpc.Tools import grpc_message_to_json_string

#from osm_client.client.OsmClient import OsmClient
#from osmclient import client
#from osmclient.common.exceptions import ClientException


LOGGER = logging.getLogger(__name__)
MAX_RETRIES = 15
DELAY_FUNCTION = delay_exponential(initial=0.01, increment=2.0, maximum=5.0)
RETRY_DECORATOR = retry(max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION, prepare_method_name='connect')
RETRY_DECORATOR = retry(
    max_retries=MAX_RETRIES, delay_function=DELAY_FUNCTION,
    prepare_method_name='connect'
)

class OsmClient:
    def __init__(self, host=None, port=None):