Skip to content

Commit

Permalink
fix pio version and update script
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Sep 12, 2024
1 parent 11026cf commit 2e958a6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
21 changes: 10 additions & 11 deletions pioreactor/cli/pio.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from pioreactor.logging import create_logger
from pioreactor.mureq import get
from pioreactor.mureq import HTTPException
from pioreactor.pubsub import get_from_leader
from pioreactor.pubsub import get_from
from pioreactor.utils import JobManager
from pioreactor.utils import local_intermittent_storage
from pioreactor.utils import local_persistant_storage
Expand Down Expand Up @@ -172,23 +172,22 @@ def version(verbose: bool) -> None:
from pioreactor.version import rpi_version_info
from pioreactor.whoami import get_pioreactor_model_and_version

click.echo(f"Pioreactor software: {tuple_to_text(software_version_info)}")
click.echo(f"Pioreactor app: {tuple_to_text(software_version_info)}")
click.echo(f"Pioreactor HAT: {tuple_to_text(hardware_version_info)}")
click.echo(f"Pioreactor firmware: {tuple_to_text(get_firmware_version())}")
click.echo(f"Model name: {get_pioreactor_model_and_version()}")
click.echo(f"HAT serial number: {serial_number}")
click.echo(f"Operating system: {platform.platform()}")
click.echo(f"Raspberry Pi: {rpi_version_info}")
click.echo(f"Image version: {whoami.get_image_git_hash()}")
if whoami.am_I_leader():
try:
result = get_from_leader("api/versions/ui")
result.raise_for_status()
ui_version = result.body.decode()
except Exception:
ui_version = "<Failed to fetch>"

click.echo(f"Pioreactor UI: {ui_version}")
try:
result = get_from("localhost", "/unit_api/versions/ui")
result.raise_for_status()
ui_version = result.body.decode()
except Exception:
ui_version = "<Failed to fetch>"

click.echo(f"Pioreactor UI: {ui_version}")
else:
click.echo(pioreactor.__version__)

Expand Down
3 changes: 2 additions & 1 deletion update_scripts/upcoming/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
UI_FOLDER=/var/www/pioreactorui
SYSTEMD_DIR=/lib/systemd/system/
UI_TAG="TODO" # TODO
PIO_DIR="/home/pioreactor/.pioreactor"

HOSTNAME=$(hostname)

Expand Down Expand Up @@ -94,4 +95,4 @@ fi
# test services
huey_consumer -h
lighttpd -h
flask --help
flask --help

0 comments on commit 2e958a6

Please sign in to comment.