File tree Expand file tree Collapse file tree 9 files changed +20
-26
lines changed Expand file tree Collapse file tree 9 files changed +20
-26
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,11 @@ jobs:
35
35
36
36
steps :
37
37
- name : Checkout repository
38
- uses : actions/checkout@v2
38
+ uses : actions/checkout@v3
39
39
40
40
# Initializes the CodeQL tools for scanning.
41
41
- name : Initialize CodeQL
42
- uses : github/codeql-action/init@v1
42
+ uses : github/codeql-action/init@v2
43
43
with :
44
44
languages : ${{ matrix.language }}
45
45
# If you wish to specify custom queries, you can do so here or in a config file.
50
50
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
51
51
# If this step fails, then you should remove it and run the build manually (see below)
52
52
- name : Autobuild
53
- uses : github/codeql-action/autobuild@v1
53
+ uses : github/codeql-action/autobuild@v2
54
54
55
55
# ℹ️ Command-line programs to run using the OS shell.
56
56
# 📚 https://git.io/JvXDl
64
64
# make release
65
65
66
66
- name : Perform CodeQL Analysis
67
- uses : github/codeql-action/analyze@v1
67
+ uses : github/codeql-action/analyze@v2
Original file line number Diff line number Diff line change 41
41
42
42
- name : Extract metadata (tags, labels) for Docker
43
43
id : meta
44
- uses : docker/metadata-action@v3
44
+ uses : docker/metadata-action@v4
45
45
with :
46
46
images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
47
47
flavor : |
50
50
type=semver,pattern={{version}}
51
51
52
52
- name : Build and push Docker image
53
- uses : docker/build-push-action@v2
53
+ uses : docker/build-push-action@v3
54
54
with :
55
55
context : .
56
56
file : ./Dockerfile
Original file line number Diff line number Diff line change @@ -14,17 +14,17 @@ jobs:
14
14
build :
15
15
runs-on : ubuntu-latest
16
16
steps :
17
- - uses : actions/checkout@v2
17
+ - uses : actions/checkout@v3
18
18
- name : Set up Python 3.8
19
- uses : actions/setup-python@v2
19
+ uses : actions/setup-python@v4
20
20
with :
21
21
python-version : 3.8
22
22
- name : Install dependencies
23
23
run : |
24
24
sudo apt-get update
25
25
sudo apt-get install libdbus-glib-1-dev libgirepository1.0-dev
26
26
python -m pip install --upgrade pip
27
- pip install flake8 pytest
27
+ pip install flake8 pytest wheel
28
28
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
29
29
- name : Lint with flake8
30
30
run : |
Original file line number Diff line number Diff line change @@ -8,12 +8,14 @@ RUN apk add --no-cache \
8
8
build-base \
9
9
dbus-dev \
10
10
dbus-libs \
11
+ git \
11
12
glib-dev
12
13
13
14
# Copy Python requirements file
14
15
COPY src/requirements.txt /tmp/
15
16
16
17
# Install packages into a directory
18
+ RUN pip install wheel --no-cache-dir
17
19
RUN pip install --user -r /tmp/requirements.txt --no-cache-dir
18
20
19
21
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ services:
28
28
context : .
29
29
dockerfile : Dockerfile
30
30
network_mode : " host"
31
- restart : always
31
+ restart : on-failure
32
32
volumes :
33
33
- " py_wifi_connect_db:/app/db" # Optional if not setting the hotspot ssid and password via the API
34
34
labels :
Original file line number Diff line number Diff line change @@ -46,10 +46,6 @@ class WifiNetworkManagerError(Exception):
46
46
pass
47
47
48
48
49
- class WifiNoSuitableDevice (Exception ):
50
- pass
51
-
52
-
53
49
# Custom error messages for Flask-RESTful to return
54
50
errors = {
55
51
"WifiConnectionFailed" : {
@@ -72,8 +68,4 @@ class WifiNoSuitableDevice(Exception):
72
68
"message" : "Failed communicating with Network Manager." ,
73
69
"status" : 500 ,
74
70
},
75
- "WifiNoSuitableDevice" : {
76
- "message" : "No suitable Wi-Fi device available." ,
77
- "status" : 404 ,
78
- },
79
71
}
Original file line number Diff line number Diff line change 3
3
import os
4
4
import socket
5
5
import subprocess
6
+ import sys
6
7
import time
7
8
from common .errors import logger
8
9
from common .errors import WifiConnectionFailed
9
10
from common .errors import WifiDeviceNotFound
10
11
from common .errors import WifiHotspotStartFailed
11
12
from common .errors import WifiNetworkManagerError
12
- from common .errors import WifiNoSuitableDevice
13
13
from common .nm_dicts import get_nm_dict
14
14
from common .system import led
15
15
from time import sleep
@@ -251,8 +251,8 @@ def get_device():
251
251
if Pnm .NM_DEVICE_TYPE_WIFI in devices :
252
252
return devices [Pnm .NM_DEVICE_TYPE_WIFI ]
253
253
else :
254
- logger .error ("No suitable or available device found." )
255
- raise WifiNoSuitableDevice
254
+ logger .error ("No suitable or available WiFi device found. Exiting ." )
255
+ sys . exit ( 0 )
256
256
257
257
258
258
def list_access_points ():
Original file line number Diff line number Diff line change 1
- python-dotenv
1
+ git+https://github.com/balena-io-experimental/ python-networkmanager
2
2
Flask-Cors
3
3
Flask-RESTful
4
- python-networkmanager==2.1
4
+ python-dotenv
5
5
waitress
Original file line number Diff line number Diff line change 1
1
#
2
- # This file is autogenerated by pip-compile with python 3.9
3
- # To update, run :
2
+ # This file is autogenerated by pip-compile with Python 3.10
3
+ # by the following command :
4
4
#
5
5
# pip-compile
6
6
#
@@ -26,7 +26,7 @@ markupsafe==2.1.0
26
26
# via jinja2
27
27
python-dotenv == 0.19.2
28
28
# via -r requirements.in
29
- python-networkmanager == 2.1
29
+ python-networkmanager @ git+https://github.com/balena-io-experimental/python-networkmanager
30
30
# via -r requirements.in
31
31
pytz == 2021.3
32
32
# via flask-restful
You can’t perform that action at this time.
0 commit comments