Skip to content

Commit 43289d1

Browse files
authored
Use new machine-name path (#581)
1 parent 6ef59fe commit 43289d1

File tree

6 files changed

+5
-14
lines changed

6 files changed

+5
-14
lines changed

device-backend/control/adafruithat/planktoscope/identity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# TODO: keep this as the default path, but allow changing it with an environment variable
2-
MACHINE_NAME_PATH = '/var/lib/planktoscope/machine-name'
2+
MACHINE_NAME_PATH = '/run/machine-name'
33

44
def load_machine_name(path=MACHINE_NAME_PATH):
55
"""Returns the machine name specified by the file at MACHINE_NAMEPATH.

device-backend/control/planktoscopehat/planktoscope/identity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# TODO: keep this as the default path, but allow changing it with an environment variable
2-
MACHINE_NAME_PATH = '/var/lib/planktoscope/machine-name'
2+
MACHINE_NAME_PATH = '/run/machine-name'
33

44
def load_machine_name(path=MACHINE_NAME_PATH):
55
"""Returns the machine name specified by the file at MACHINE_NAMEPATH.

device-backend/processing/segmenter/planktoscope/identity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# TODO: keep this as the default path, but allow changing it with an environment variable
2-
MACHINE_NAME_PATH = '/var/lib/planktoscope/machine-name'
2+
MACHINE_NAME_PATH = '/run/machine-name'
33

44
def load_machine_name(path=MACHINE_NAME_PATH):
55
"""Returns the machine name specified by the file at MACHINE_NAMEPATH.

software/distro/setup/planktoscope-app-env/node-red-frontend/install.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,6 @@ case "$hardware_type" in
2020
;;
2121
esac
2222

23-
# Prepare tool to generate machine names based on serial numbers
24-
# Note: the tool itself is deployed/managed by Forklift.
25-
# TODO: remove this by updating the Node-RED frontend and Python backend:
26-
# Add a symlink at /var/lib/planktoscope/machine-name for backwards-compatibility with the Node-RED
27-
# frontend and Python backend, which are not yet updated to check /run/machine-name instead:
28-
sudo mkdir -p /var/lib/planktoscope
29-
sudo rm -f /var/lib/planktoscope/machine-name
30-
sudo ln -s /run/machine-name /var/lib/planktoscope/machine-name
31-
3223
# Install dependencies
3324
# smbus is needed by some python3 nodes in the Node-RED dashboard for the Adafruit HAT.
3425
# Since the Node-RED systemd service runs as the pi user by default (and we don't override that

software/node-red-dashboard/adafruithat/flows.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7884,7 +7884,7 @@
78847884
"type": "file in",
78857885
"z": "1371dec5.76e671",
78867886
"name": "Get machine name",
7887-
"filename": "/var/lib/planktoscope/machine-name",
7887+
"filename": "/run/machine-name",
78887888
"filenameType": "str",
78897889
"format": "utf8",
78907890
"chunk": false,

software/node-red-dashboard/planktoscopehat/flows.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7743,7 +7743,7 @@
77437743
"type": "file in",
77447744
"z": "1371dec5.76e671",
77457745
"name": "Get machine name",
7746-
"filename": "/var/lib/planktoscope/machine-name",
7746+
"filename": "/run/machine-name",
77477747
"filenameType": "str",
77487748
"format": "utf8",
77497749
"chunk": false,

0 commit comments

Comments
 (0)