Skip to content

Commit 0a732c2

Browse files
author
gferraro
committed
Merge remote-tracking branch 'origin/dev' into merge-dev-a
2 parents 3860583 + 6d6c4e6 commit 0a732c2

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

_states/cacophony.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ def pkg_installed_from_github(
9292
pkg_name = name
9393

9494
installed_version_cmd = f"dpkg-query --showformat='${{Version}}' --show {pkg_name}"
95-
installed_version_ret = __salt__["cmd.run_all"](installed_version_cmd, python_shell=False)
95+
installed_version_ret = __salt__["cmd.run_all"](
96+
installed_version_cmd, python_shell=False
97+
)
9698

9799
installed_version = ""
98100
if installed_version_ret["retcode"] == 0:
@@ -124,7 +126,7 @@ def pkg_installed_from_github(
124126
download_start_time = time.time()
125127
source_url = f"https://github.com/TheCacophonyProject/{name}/releases/download/v{version}/{pkg_name}_{version}_{architecture}.deb"
126128
download_ret = __salt__["cp.get_url"](source_url, deb_path, makedirs=True)
127-
download_duration = time.time() - download_start_time
129+
download_duration = time.time() - download_start_time
128130
if not download_ret:
129131
ret["comment"] = f"Failed to download package from {source_url}"
130132
return ret
@@ -136,10 +138,14 @@ def pkg_installed_from_github(
136138

137139
if install_ret["retcode"] != 0:
138140
ret["result"] = False
139-
ret["comment"] = "dpkg failed to install {}. Stderr: {}".format(deb_path, install_ret["stderr"])
141+
ret["comment"] = "dpkg failed to install {}. Stderr: {}".format(
142+
deb_path, install_ret["stderr"]
143+
)
140144
else:
141145
ret["result"] = True
142-
ret["comment"] = f"Package {pkg_name} version {version} installed successfully in {(time.time() - start_time):.2f}. (download: {download_duration:.2f}s, install: {install_duration:.2f}s)."
146+
ret["comment"] = (
147+
f"Package {pkg_name} version {version} installed successfully in {(time.time() - start_time):.2f}. (download: {download_duration:.2f}s, install: {install_duration:.2f}s)."
148+
)
143149
ret["changes"] = {
144150
"old": installed_version,
145151
"new": version,
@@ -150,9 +156,10 @@ def pkg_installed_from_github(
150156
if os.path.exists(package_tmp_dir):
151157
os.remove(deb_path)
152158
os.rmdir(package_tmp_dir)
153-
159+
154160
return ret
155161

162+
156163
def init_alsa(name):
157164
"""Ensure that the built-in audio hardware is correctly initialised."""
158165
if _is_audio_setup():

tc2/thermal-recorder-py/init.sls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ classifier-env:
4848
classifier-pipeline-pip:
4949
cacophony.pkg_installed_from_pypi:
5050
- name: classifier-pipeline
51-
- version: "0.0.33"
51+
- version: "0.0.34"
5252
- venv: /home/pi/.venv/classifier/bin/
5353

5454
thermal-recorder-py-service:
@@ -70,5 +70,5 @@ thermal-recorder-service:
7070
'download-model pi-v0.7 effv2b3-202509.tar tflite ff2ed9aed0cea66c79c4813447eedc1eb6ed92d832a575de3b5d6c7a062a93ae':
7171
cmd.run
7272

73-
'download-model rf-fp-v0.4 forestmodel.tar rf-fp-model fceacd8729f661ef438e9dea12221ccddb531a4d7e6c375c1b4c6224b841b33b':
73+
'download-model rf-fp-v0.5 forestmodel.tar rf-fp-model 0bdef1c9b7cc6c9ff96c07683127ab3d494277307d69293ffca0867b918ca399':
7474
cmd.run

0 commit comments

Comments
 (0)