Skip to content
Open
Show file tree
Hide file tree
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
14 changes: 5 additions & 9 deletions odooghost/cli/stack/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,7 @@ def start(
open: t.Annotated[bool, typer.Option("--open", help="Open in browser")] = False,
open_mode: t.Annotated[
constant.OpenMode, typer.Option("--open-mode", help="Open mode")
] = (
constant.OpenMode.subnet
if constant.IS_LINUX_PLATFORM
else constant.OpenMode.local
),
] = constant.OpenMode.local,
tail: t.Annotated[
int,
typer.Option("--tail", help="Number of lines to show from the end of the logs"),
Expand All @@ -168,11 +164,11 @@ def start(
try:
stack = Stack.from_name(name=stack_name)
stack.start()
odoo = stack.get_service(name="odoo").get_container()
odoo_service = stack.get_service(name="odoo")
odoo = odoo_service.get_container()
if open:
webbrowser.open(
f"http://{odoo.get_subnet_port(8069) if open_mode == constant.OpenMode.subnet else odoo.get_local_port(8069)}"
)
url = f"http://{odoo.get_subnet_port(odoo_service.container_port) if open_mode == constant.OpenMode.subnet else odoo.get_local_port(odoo_service.container_port)}"
webbrowser.open(url)
if not detach:
while True:
try:
Expand Down
2 changes: 1 addition & 1 deletion odooghost/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def get_local_port(self, port: int, protocol: t.Literal["tcp", "udp"] = "tcp"):
return None
port = port[0]
host_ip, host_port = port.values()
if constant.IS_DARWIN_PLARFORM and host_ip == "0.0.0.0": # nosec B104
if host_ip == "0.0.0.0": # nosec B104
host_ip = "localhost"
return f"{host_ip}:{host_port}"

Expand Down
Loading