Skip to content

Commit

Permalink
#479 work 🔨
Browse files Browse the repository at this point in the history
  • Loading branch information
jokob-sk committed Oct 13, 2023
1 parent 257e46d commit f3b6474
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ services:
- ${APP_DATA_LOCATION}/pialert/dhcp_samples/dhcp1.leases:/mnt/dhcp1.leases
- ${APP_DATA_LOCATION}/pialert/dhcp_samples/dhcp2.leases:/mnt/dhcp2.leases
- ${APP_DATA_LOCATION}/pialert/dhcp_samples/pihole_dhcp_full.leases:/etc/pihole/dhcp.leases
- ${APP_DATA_LOCATION}/pihole/etc-pihole/pihole-FTL.db:/etc/pihole/pihole-FTL.db
- ${APP_DATA_LOCATION}/pihole/etc-pihole/pihole-FTL.db:/etc/pihole/pihole-FTL.dba
- ${DEV_LOCATION}/pialert:/home/pi/pialert/pialert
- ${DEV_LOCATION}/back/report_template.html:/home/pi/pialert/back/report_template.html
- ${DEV_LOCATION}/back/report_template_new_version.html:/home/pi/pialert/back/report_template_new_version.html
Expand Down
14 changes: 7 additions & 7 deletions pialert/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@ def execute_plugin(db, plugin, pluginsState = plugins_state() ):
if set == None:
set_RUN_TIMEOUT = 10
else:
set_RUN_TIMEOUT = set["value"]


set_RUN_TIMEOUT = set["value"]

# Prepare custom params
params = []
Expand Down Expand Up @@ -324,13 +322,15 @@ def execute_plugin(db, plugin, pluginsState = plugins_state() ):

fullSqlitePath = set["value"]


# try attaching the sqlite DB
try:
sql.execute ("ATTACH DATABASE '"+ fullSqlitePath +"' AS EXTERNAL_"+plugin["unique_prefix"])
except sqlite3.Error as e:
mylog('none',[ '[Plugin] - ATTACH DATABASE failed with SQL ERROR: ', e])

arr = db.get_sql_array (q)
arr = db.get_sql_array (q)
except sqlite3.Error as e:
mylog('none',[f'[Plugins] Error: DB_PATH setting ({fullSqlitePath}) for plugin {plugin["unique_prefix"]}. Did you mount it correctly?'])
mylog('none',[f'[Plugins] Error: ATTACH DATABASE failed with SQL ERROR: ', e])
return pluginsState

for row in arr:
# There has to be always 9 columns
Expand Down

0 comments on commit f3b6474

Please sign in to comment.