Skip to content

Commit

Permalink
Merge branch 'develop' into plasorak/controller-configuration-segment…
Browse files Browse the repository at this point in the history
…-lookup
  • Loading branch information
plasorak committed Nov 14, 2024
2 parents 8538af2 + e11bde0 commit 03357fc
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 4 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Lint with ruff

on:
pull_request:

jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v1
5 changes: 5 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
exclude = ["tests/*"]

[lint]
ignore = ["ALL"]
select = ["F821"]
6 changes: 4 additions & 2 deletions src/drunc/broadcast/server/grpc_servicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
from druncschema.broadcast_pb2_grpc import BroadcastSenderServicer
from druncschema.broadcast_pb2 import BroadcastRequest
from druncschema.request_response_pb2 import Request, Response
from druncschema.generic_pb2 import PlainText
from druncschema.generic_pb2 import PlainText, StringStringMap
from druncschema.broadcast_pb2 import BroadcastMessage, BroadcastType
from druncschema.authoriser_pb2 import ActionType
from drunc.utils.grpc_utils import unpack_any
from google.protobuf.any_pb2 import Any

class ListenerRepresentation:

Expand Down Expand Up @@ -242,7 +244,7 @@ def serve(port:int) -> None:
try:
server_thread = Thread(target=serve, kwargs={'port':port}, name=f'serve_thread_{port}')
server_thread.start()
receiver_threads.append(serve_thread)
receiver_threads.append(server_thread)
except:
pass

Expand Down
1 change: 1 addition & 0 deletions src/drunc/controller/children_interface/rest_api_child.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from drunc.controller.children_interface.child_node import ChildNode
from drunc.exceptions import DruncSetupException
from drunc.utils.utils import ControlType
from druncschema.request_response_pb2 import Response
from druncschema.token_pb2 import Token
Expand Down
1 change: 1 addition & 0 deletions src/drunc/fsm/actions/thread_pinning.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from drunc.fsm.core import FSMAction
from drunc.utils.configuration import find_configuration
from drunc.fsm.exceptions import ThreadPinningFailed
from drunc.exceptions import DruncSetupException


class ThreadPinning(FSMAction):
Expand Down
1 change: 1 addition & 0 deletions src/drunc/process_manager/configuration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from drunc.utils.configuration import ConfHandler
from rich import print as rprint

from enum import Enum

Expand Down
2 changes: 1 addition & 1 deletion src/drunc/utils/flask_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def run(self) -> NoReturn:

def main():
from drunc.utils.utils import get_new_port
from flask import Flask, make_response, jsonify
from flask import Flask, make_response, jsonify, request
from flask_restful import Api, Resource

class DummyEndpoint(Resource):
Expand Down
3 changes: 2 additions & 1 deletion src/drunc/utils/grpc_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from drunc.exceptions import DruncCommandException,DruncException
from druncschema.request_response_pb2 import Response
from druncschema.request_response_pb2 import Response, ResponseFlag
from druncschema.generic_pb2 import PlainText

class UnpackingError(DruncCommandException):
def __init__(self, data, format):
Expand Down

0 comments on commit 03357fc

Please sign in to comment.