lager-cli 0.32.0__tar.gz → 0.32.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lager_cli-0.32.0/lager_cli.egg-info → lager_cli-0.32.1}/PKG-INFO +1 -1
- {lager_cli-0.32.0 → lager_cli-0.32.1}/__init__.py +1 -1
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/box/nets.py +3 -7
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/communication/usb.py +6 -7
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/power/battery.py +3 -6
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/power/supply.py +3 -6
- {lager_cli-0.32.0 → lager_cli-0.32.1}/core/net_helpers.py +32 -12
- {lager_cli-0.32.0 → lager_cli-0.32.1/lager_cli.egg-info}/PKG-INFO +1 -1
- {lager_cli-0.32.0 → lager_cli-0.32.1}/LICENSE +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/MANIFEST.in +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/README.md +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/__main__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/address_utils.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/battery/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/battery/battery_tui.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/battery/websocket_client.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/box_storage.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/box/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/box/_host_ops.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/box/_mount_prep.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/box/_pip_validation.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/box/_shim_verbs.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/box/_ssh.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/box/authorize.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/box/box_group.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/box/boxes.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/box/config.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/box/diagnose.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/box/dut.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/box/hello.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/box/instruments.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/box/labjack_pins.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/box/lock.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/box/net_tui.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/box/ssh.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/communication/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/communication/ble.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/communication/blufi.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/communication/i2c.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/communication/router.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/communication/spi.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/communication/uart.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/communication/websocket_client.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/communication/wifi.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/development/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/development/arm.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/development/debug/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/development/debug/commands.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/development/debug/gdb.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/development/debug/net_cache.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/development/debug/service_client.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/development/debug/service_helper.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/development/debug/tunnel.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/development/devenv.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/development/python.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/measurement/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/measurement/adc.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/measurement/dac.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/measurement/energy.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/measurement/gpi.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/measurement/gpo.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/measurement/logic.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/measurement/scope.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/measurement/thermocouple.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/measurement/watt.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/power/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/power/battery_model_csv.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/power/eload.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/power/solar.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/utility/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/utility/binaries.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/utility/defaults.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/utility/exec_.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/utility/install.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/utility/install_wheel.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/utility/login.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/utility/logs.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/utility/uninstall.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/utility/update.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/commands/utility/webcam.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/config.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/context/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/context/ci_detection.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/context/constants.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/context/core.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/context/error_handlers.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/context/session.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/core/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/core/group_usage.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/core/matchers.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/core/net_group.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/core/net_storage.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/core/param_types.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/core/ssh_utils.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/core/utils.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/core/version_skew.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/core/ws_diagnose.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/deployment/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/deployment/scripts/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/deployment/scripts/configure_docker_dns.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/deployment/scripts/configure_docker_dns.sh +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/deployment/scripts/convert_to_sparse_checkout.sh +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/deployment/scripts/setup_and_deploy_box.sh +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/deployment/scripts/setup_ssh_key.sh +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/deployment/security/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/deployment/security/secure_box_firewall.sh +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/common/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/common/construct_utils.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/common/exceptions.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/common/py3compat.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/common/utils.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/construct/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/construct/adapters.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/construct/core.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/construct/debug.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/construct/macros.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/dwarf/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/dwarf/abbrevtable.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/dwarf/aranges.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/dwarf/callframe.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/dwarf/compileunit.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/dwarf/constants.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/dwarf/descriptions.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/dwarf/die.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/dwarf/dwarf_expr.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/dwarf/dwarfinfo.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/dwarf/enums.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/dwarf/lineprogram.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/dwarf/locationlists.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/dwarf/namelut.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/dwarf/ranges.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/dwarf/structs.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/ehabi/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/ehabi/constants.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/ehabi/decoder.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/ehabi/ehabiinfo.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/ehabi/structs.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/elf/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/elf/constants.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/elf/descriptions.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/elf/dynamic.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/elf/elffile.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/elf/enums.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/elf/gnuversions.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/elf/hash.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/elf/notes.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/elf/relocation.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/elf/sections.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/elf/segments.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/elftools/elf/structs.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/errors.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/exceptions.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/gateway_auth.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/impl/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/impl/box_config.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/impl/measurement/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/impl/measurement/scope.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/impl/measurement/scope_stream.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/impl/power/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/impl/power/enable_disable.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/lager_cli.egg-info/SOURCES.txt +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/lager_cli.egg-info/dependency_links.txt +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/lager_cli.egg-info/entry_points.txt +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/lager_cli.egg-info/requires.txt +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/lager_cli.egg-info/top_level.txt +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/main.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/pyproject.toml +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/safe_unpickle.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/setup.cfg +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/setup.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/simple_hdlc.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/sort_utils.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/status.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/supply/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/supply/supply_tui.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/supply/websocket_client.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/terminal/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/terminal/core/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/terminal/core/executor.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/terminal/main.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/terminal/ui/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/terminal/ui/completer.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/terminal/ui/display.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/terminal/ui/logo.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/terminal/ui/repl.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/terminal/ui/themes.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/tests/test_box_lager_imports.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/tests/test_box_storage.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/tests/test_gateway_auth.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/tests/test_io_imports.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/update_check.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/vendor/PyCRC/CRC16.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/vendor/PyCRC/CRC16DNP.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/vendor/PyCRC/CRC16Kermit.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/vendor/PyCRC/CRC16SICK.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/vendor/PyCRC/CRC32.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/vendor/PyCRC/CRCCCITT.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/vendor/PyCRC/__init__.py +0 -0
- {lager_cli-0.32.0 → lager_cli-0.32.1}/vendor/__init__.py +0 -0
|
@@ -20,7 +20,7 @@ import shutil
|
|
|
20
20
|
|
|
21
21
|
from ...context import get_default_box
|
|
22
22
|
from ...core.net_group import NetGroupHelpMixin
|
|
23
|
-
from ...core.net_helpers import NET_HTTP_PORT
|
|
23
|
+
from ...core.net_helpers import NET_HTTP_PORT, echo_box_request_failure
|
|
24
24
|
from ...errors import LagerError
|
|
25
25
|
from ...sort_utils import natural_sort_key as _natural_sort_key
|
|
26
26
|
from .net_tui import launch_tui
|
|
@@ -57,12 +57,8 @@ def _box_request(ctx: click.Context, box_ip: str, method: str, path: str,
|
|
|
57
57
|
headers=auth_headers_for_box(box_ip),
|
|
58
58
|
timeout=_NETS_HTTP_TIMEOUT)
|
|
59
59
|
_check_gateway(resp, box_ip)
|
|
60
|
-
except (requests.ConnectionError, requests.Timeout):
|
|
61
|
-
|
|
62
|
-
f"Error: cannot reach box at {box_ip}:{NET_HTTP_PORT}. "
|
|
63
|
-
f"Check network/Tailscale and that the box is online and updated.",
|
|
64
|
-
fg="red", err=True,
|
|
65
|
-
)
|
|
60
|
+
except (requests.ConnectionError, requests.Timeout) as e:
|
|
61
|
+
echo_box_request_failure(box_ip, e, timeout=_NETS_HTTP_TIMEOUT)
|
|
66
62
|
ctx.exit(1)
|
|
67
63
|
except requests.RequestException as e:
|
|
68
64
|
click.secho(f"Error: request to box failed: {e}", fg="red", err=True)
|
|
@@ -25,6 +25,7 @@ from ...core.net_helpers import (
|
|
|
25
25
|
list_nets_by_role,
|
|
26
26
|
display_nets_table,
|
|
27
27
|
validate_net_exists,
|
|
28
|
+
echo_box_request_failure,
|
|
28
29
|
NET_HTTP_PORT,
|
|
29
30
|
)
|
|
30
31
|
from ...context import get_default_net
|
|
@@ -67,20 +68,18 @@ def _invoke_remote(
|
|
|
67
68
|
from ...box_storage import _check_gateway
|
|
68
69
|
|
|
69
70
|
url = f"http://{target_box}:{NET_HTTP_PORT}/usb/command"
|
|
71
|
+
# First contact with an Acroname hub runs BrainStem USB discovery on the
|
|
72
|
+
# box, which can take well over 10s cold; budget for it.
|
|
70
73
|
try:
|
|
71
74
|
resp = requests.post(
|
|
72
75
|
url,
|
|
73
76
|
json={"netname": net_name, "action": command},
|
|
74
|
-
timeout=
|
|
77
|
+
timeout=30,
|
|
75
78
|
headers=auth_headers_for_box(target_box),
|
|
76
79
|
)
|
|
77
80
|
_check_gateway(resp, target_box)
|
|
78
|
-
except (requests.ConnectionError, requests.Timeout):
|
|
79
|
-
|
|
80
|
-
f"Error: cannot reach box at {target_box}:{NET_HTTP_PORT}. "
|
|
81
|
-
f"Check network/Tailscale and that the box is online and updated.",
|
|
82
|
-
fg='red', err=True,
|
|
83
|
-
)
|
|
81
|
+
except (requests.ConnectionError, requests.Timeout) as e:
|
|
82
|
+
echo_box_request_failure(target_box, e, timeout=30)
|
|
84
83
|
ctx.exit(1)
|
|
85
84
|
except requests.RequestException as e:
|
|
86
85
|
click.secho(f"Error: USB request to box failed: {e}", fg='red', err=True)
|
|
@@ -25,6 +25,7 @@ from ...core.net_helpers import (
|
|
|
25
25
|
resolve_box,
|
|
26
26
|
validate_net,
|
|
27
27
|
display_nets,
|
|
28
|
+
echo_box_request_failure,
|
|
28
29
|
NET_HTTP_PORT,
|
|
29
30
|
NET_ROLES,
|
|
30
31
|
)
|
|
@@ -60,12 +61,8 @@ def _run_backend(ctx, box, action: str, **params):
|
|
|
60
61
|
response = requests.post(url, json=payload, timeout=10,
|
|
61
62
|
headers=auth_headers_for_box(box))
|
|
62
63
|
_check_gateway(response, box)
|
|
63
|
-
except (requests.ConnectionError, requests.Timeout):
|
|
64
|
-
|
|
65
|
-
f"Error: cannot reach box at {box}:{NET_HTTP_PORT}. "
|
|
66
|
-
f"Check network/Tailscale and that the box is online and updated.",
|
|
67
|
-
fg='red', err=True,
|
|
68
|
-
)
|
|
64
|
+
except (requests.ConnectionError, requests.Timeout) as e:
|
|
65
|
+
echo_box_request_failure(box, e, timeout=10)
|
|
69
66
|
raise SystemExit(1)
|
|
70
67
|
except requests.RequestException as e:
|
|
71
68
|
click.secho(f"Error: battery request to box failed: {e}", fg='red', err=True)
|
|
@@ -29,6 +29,7 @@ from ...core.net_helpers import (
|
|
|
29
29
|
validate_net,
|
|
30
30
|
validate_net_exists,
|
|
31
31
|
display_nets,
|
|
32
|
+
echo_box_request_failure,
|
|
32
33
|
validate_positive_parameters,
|
|
33
34
|
validate_protection_limits,
|
|
34
35
|
parse_value_with_negatives,
|
|
@@ -106,12 +107,8 @@ def _run_backend(ctx, box, action: str, **params):
|
|
|
106
107
|
response = requests.post(url, json=payload, timeout=10,
|
|
107
108
|
headers=auth_headers_for_box(box))
|
|
108
109
|
_check_gateway(response, box)
|
|
109
|
-
except (requests.ConnectionError, requests.Timeout):
|
|
110
|
-
|
|
111
|
-
f"Error: cannot reach box at {box}:{NET_HTTP_PORT}. "
|
|
112
|
-
f"Check network/Tailscale and that the box is online and updated.",
|
|
113
|
-
fg='red', err=True,
|
|
114
|
-
)
|
|
110
|
+
except (requests.ConnectionError, requests.Timeout) as e:
|
|
111
|
+
echo_box_request_failure(box, e, timeout=10)
|
|
115
112
|
raise SystemExit(1)
|
|
116
113
|
except requests.RequestException as e:
|
|
117
114
|
click.secho(f"Error: supply request to box failed: {e}", fg='red', err=True)
|
|
@@ -166,6 +166,34 @@ NET_HTTP_PORT = 9000
|
|
|
166
166
|
_NET_HTTP_TIMEOUT = 10
|
|
167
167
|
|
|
168
168
|
|
|
169
|
+
def echo_box_request_failure(box_ip: str, exc, timeout=None) -> None:
|
|
170
|
+
"""Print the right diagnosis for a failed box HTTP call.
|
|
171
|
+
|
|
172
|
+
A read timeout means the box accepted the request but the operation
|
|
173
|
+
outran its budget (first contact with an instrument can take a while)
|
|
174
|
+
— telling the user to check their network sends them down the wrong
|
|
175
|
+
path, and the operation may still complete on the box. Anything else
|
|
176
|
+
(connection refused/reset, connect timeout) is a genuine
|
|
177
|
+
can't-reach-the-box condition.
|
|
178
|
+
"""
|
|
179
|
+
import requests
|
|
180
|
+
|
|
181
|
+
if isinstance(exc, requests.ReadTimeout):
|
|
182
|
+
after = f" within {timeout:g}s" if timeout else ""
|
|
183
|
+
click.secho(
|
|
184
|
+
f"Error: the box at {box_ip}:{NET_HTTP_PORT} accepted the request "
|
|
185
|
+
f"but did not answer{after}. The operation may just be slow and "
|
|
186
|
+
f"may still complete on the box; try again in a moment.",
|
|
187
|
+
fg="red", err=True,
|
|
188
|
+
)
|
|
189
|
+
else:
|
|
190
|
+
click.secho(
|
|
191
|
+
f"Error: cannot reach box at {box_ip}:{NET_HTTP_PORT}. "
|
|
192
|
+
f"Check network/Tailscale and that the box is online and updated.",
|
|
193
|
+
fg="red", err=True,
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
|
|
169
197
|
# Boxes we've already warned about being unreachable during a net listing;
|
|
170
198
|
# once per CLI process so repeated fetch_nets calls (e.g. the TUI) don't spam.
|
|
171
199
|
_fetch_nets_unreachable_warned: set[str] = set()
|
|
@@ -289,12 +317,8 @@ def post_net_command(
|
|
|
289
317
|
resp = requests.post(url, json=payload, timeout=http_timeout,
|
|
290
318
|
headers=auth_headers_for_box(box_addr))
|
|
291
319
|
_check_gateway(resp, box_addr)
|
|
292
|
-
except (requests.ConnectionError, requests.Timeout):
|
|
293
|
-
|
|
294
|
-
f"Error: cannot reach box at {box_addr}:{NET_HTTP_PORT}. "
|
|
295
|
-
f"Check network/Tailscale and that the box is online and updated.",
|
|
296
|
-
fg="red", err=True,
|
|
297
|
-
)
|
|
320
|
+
except (requests.ConnectionError, requests.Timeout) as e:
|
|
321
|
+
echo_box_request_failure(box_addr, e, timeout=http_timeout)
|
|
298
322
|
raise SystemExit(1)
|
|
299
323
|
except requests.RequestException as e:
|
|
300
324
|
click.secho(f"Error: request to box failed: {e}", fg="red", err=True)
|
|
@@ -367,12 +391,8 @@ def post_box_command(
|
|
|
367
391
|
resp = requests.post(url, json=payload, timeout=http_timeout,
|
|
368
392
|
headers=auth_headers_for_box(box_ip))
|
|
369
393
|
_check_gateway(resp, box_ip)
|
|
370
|
-
except (requests.ConnectionError, requests.Timeout):
|
|
371
|
-
|
|
372
|
-
f"Error: cannot reach box at {box_ip}:{NET_HTTP_PORT}. "
|
|
373
|
-
f"Check network/Tailscale and that the box is online and updated.",
|
|
374
|
-
fg="red", err=True,
|
|
375
|
-
)
|
|
394
|
+
except (requests.ConnectionError, requests.Timeout) as e:
|
|
395
|
+
echo_box_request_failure(box_ip, e, timeout=http_timeout)
|
|
376
396
|
raise SystemExit(1)
|
|
377
397
|
except requests.RequestException as e:
|
|
378
398
|
click.secho(f"Error: request to box failed: {e}", fg="red", err=True)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|