Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pybridge: Implement cockpit-bridge --version; some small cleanups #19234

Merged
merged 4 commits into from
Aug 31, 2023
Merged
Changes from 1 commit
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
8 changes: 4 additions & 4 deletions src/cockpit/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import shlex
import socket
import subprocess
from typing import Iterable, List, Optional, Tuple, Type
from typing import Iterable, List, Optional, Sequence, Tuple, Type

from cockpit._vendor.ferny import interaction_client
from cockpit._vendor.systemd_ctypes import bus, run_async
Expand Down Expand Up @@ -62,12 +62,12 @@ def export(self, path: str, obj: bus.BaseObject) -> None:
class Bridge(Router, PackagesListener):
internal_bus: InternalBus
packages: Optional[Packages]
bridge_rules: List[JsonObject]
martinpitt marked this conversation as resolved.
Show resolved Hide resolved
bridge_configs: Sequence[BridgeConfig]
args: argparse.Namespace

def __init__(self, args: argparse.Namespace):
self.internal_bus = InternalBus(EXPORTS)
self.bridge_rules = []
self.bridge_configs = []
Copy link
Member

Choose a reason for hiding this comment

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

I guess () would be nicer here, but no biggie.

self.args = args

self.superuser_rule = SuperuserRoutingRule(self, privileged=args.privileged)
Expand Down Expand Up @@ -149,7 +149,7 @@ def do_send_init(self) -> None:
def packages_loaded(self) -> None:
assert self.packages
bridge_configs = self.packages.get_bridge_configs()
if self.bridge_rules != bridge_configs:
if self.bridge_configs != bridge_configs:
self.superuser_rule.set_configs(bridge_configs)
self.peers_rule.set_configs(bridge_configs)
self.bridge_configs = bridge_configs
Expand Down