Skip to content

Commit

Permalink
Minor refactorings
Browse files Browse the repository at this point in the history
Signed-off-by: Bartosz Zurkowski <zurkowski.bartosz@gmail.com>
  • Loading branch information
bzurkowski committed Mar 28, 2020
1 parent 3868c10 commit a974197
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
3 changes: 0 additions & 3 deletions orca/api/resources/v1/ingestor.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import json

from flask import request
from flask_restplus import Namespace, Resource

from orca import exceptions
from orca.common import logger
from orca.topology import linker
from orca.topology.alerts import elastalert
Expand Down
3 changes: 2 additions & 1 deletion orca/common/clients/kiali/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def graph_namespaces(self, namespaces, graph_type='service'):
"/namespaces/graph", namespaces=namespace_list, graphType=graph_type)

@classmethod
def get(cls, url="http://localhost:20001", api_prefix="/kiali/api", username=None, password=None):
def get(cls, url="http://localhost:20001", api_prefix="/kiali/api", username=None,
password=None):
basic_auth = None
if username and password:
basic_auth = auth.HTTPBasicAuth(username, password)
Expand Down
1 change: 0 additions & 1 deletion orca/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def parse(self, config_path):
config_dict = file_utils.load_yaml(config_path)
validator = cerberus.Validator(self._schema)
is_valid = validator.validate(config_dict)

if not is_valid:
raise exceptions.ConfigParseError(errors=validator.errors)
return dict_lib.Dict(validator.document)
Expand Down
2 changes: 1 addition & 1 deletion orca/topology/infra/istio/matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ def match_host_to_service(namespace, host, service):
host_parts = host.split('.')
service_name = host_parts[0]
service_namespace = host_parts[1] if len(host_parts) > 1 else namespace
matched_name = service_name == service.properties.name
matched_name = service_name == service.properties.name
matched_namespace = service_namespace == service.properties.namespace
return matched_name and matched_namespace
6 changes: 3 additions & 3 deletions orca/topology/probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ def _initialize_linkers(self):
return linkers

def _setup_event_dispatcher(self, linkers):
dispatcher = linker.EventDispatcher()
event_dispatcher = linker.EventDispatcher()
for linker_instance in linkers:
dispatcher.add_linker(linker_instance)
self._graph.add_listener(dispatcher)
event_dispatcher.add_linker(linker_instance)
self._graph.add_listener(event_dispatcher)


class Probe(abc.ABC):
Expand Down

0 comments on commit a974197

Please sign in to comment.