Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
class MAVLinkServer(AbstractRouter):
def __init__(self) -> None:
super().__init__()
self.log_path: Optional[str] = None

def _get_version(self) -> Optional[str]:
binary = self.binary()
Expand Down Expand Up @@ -40,7 +41,10 @@ def convert_endpoint(endpoint: Endpoint) -> str:
filtered_endpoints = Endpoint.filter_enabled(self.endpoints())
endpoints = " ".join([convert_endpoint(endpoint) for endpoint in [master_endpoint, *filtered_endpoints]])

return f"{self.binary()} {endpoints}"
if not self.log_path:
self.log_path = "/var/logs/blueos/services/mavlink-server/"
Comment on lines +44 to +45
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Using a mutable default path assignment in get_command() may cause issues if log_path is intentionally set to an empty string.

Checking 'if not self.log_path' will override valid empty string values. Use 'if self.log_path is None' to distinguish between unset and intentionally empty log_path.


return f"{self.binary()} {endpoints} --log-path={self.log_path}"

@staticmethod
def name() -> str:
Expand Down
Loading