Skip to content

Commit 291c49f

Browse files
committed
fix boolean in ast cause subnetting import to fail (#161).
1 parent 2a2f490 commit 291c49f

5 files changed

Lines changed: 20 additions & 22 deletions

File tree

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
linuxmuster-base7 (7.2.14-0) lmn72; urgency=low
2+
3+
* fix boolean in ast cause subnetting import to fail (#161).
4+
5+
-- Thomas Schmitt <thomas@linuxmuster.net> Tue, 22 Apr 2025 14:05:59 +0200
6+
17
linuxmuster-base7 (7.2.13-0) lmn72; urgency=low
28

39
* fix skip firewall setup (226377b).

lib/setup.d/z_final.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# final tasks
44
# thomas@linuxmuster.net
5-
# 20240219
5+
# 20250422
66
#
77

88
import configparser
@@ -12,8 +12,8 @@
1212
import re
1313
import sys
1414

15-
from functions import getSetupValue, mySetupLogfile, printScript, readTextfile
16-
from functions import subProc, waitForFw, writeTextfile
15+
from functions import getSetupValue, mySetupLogfile, printScript, readTextfile, \
16+
subProc, waitForFw, writeTextfile
1717

1818
logfile = mySetupLogfile(__file__)
1919

@@ -72,7 +72,7 @@
7272

7373
# wait for fw
7474
skipfw = getSetupValue('skipfw')
75-
if skipfw == 'False':
75+
if not skipfw:
7676
try:
7777
waitForFw(wait=30)
7878
except Exception as error:

sbin/linuxmuster-import-subnets

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
#
33
# linuxmuster-import-subnets
44
# thomas@linuxmuster.net
5-
# 20230801
5+
# 20250422
66
#
77

8-
import ast
98
import constants
109
import datetime
1110
import os
@@ -15,10 +14,8 @@ import time
1514
import yaml
1615

1716
from bs4 import BeautifulSoup
18-
from functions import firewallApi, getFwConfig, getSetupValue, getSftp
19-
from functions import getSubnetArray, ipMatchSubnet, isValidHostIpv4
20-
from functions import printScript, putFwConfig, putSftp, readTextfile
21-
from functions import sshExec, writeTextfile
17+
from functions import firewallApi, getFwConfig, getSetupValue, getSubnetArray, \
18+
isValidHostIpv4, printScript, putFwConfig, readTextfile, writeTextfile
2219
from IPy import IP
2320

2421
# read necessary values from setup.ini and other sources
@@ -27,7 +24,7 @@ domainname = getSetupValue('domainname')
2724
gateway = getSetupValue('gateway')
2825
firewallip = getSetupValue('firewallip')
2926
# get boolean value
30-
skipfw = ast.literal_eval(getSetupValue('skipfw'))
27+
skipfw = getSetupValue('skipfw')
3128
bitmask_setup = getSetupValue('bitmask')
3229
network_setup = getSetupValue('network')
3330
ipnet_setup = network_setup + '/' + bitmask_setup

sbin/linuxmuster-opnsense-reset

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# reset opnsense configuration to setup state
44
# thomas@linuxmuster.net
5-
# 20220601
5+
# 20250422
66
#
77

88
import constants
@@ -12,13 +12,12 @@ import sys
1212
import time
1313

1414
from functions import createServerCert, datetime, enterPassword, firewallApi, \
15-
getSetupValue, printScript, randomPassword, sshExec, subProc, writeTextfile, \
16-
waitForFw
15+
getSetupValue, printScript, sshExec, subProc, writeTextfile, waitForFw
1716

1817

1918
# check first if firewall is skipped by setup
2019
skipfw = getSetupValue('skipfw')
21-
if skipfw == 'True':
20+
if skipfw:
2221
printScript('Firewall is skipped by setup!')
2322
sys.exit(0)
2423

share/firewall/opnsense/create-keytab.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# create web proxy sso keytab
44
# thomas@linuxmuster.net
5-
# 20240219
5+
# 20250422
66
#
77

88
import constants
@@ -11,16 +11,12 @@
1111
import subprocess
1212
import sys
1313

14-
from functions import datetime
15-
from functions import firewallApi
16-
from functions import getSetupValue
17-
from functions import printScript
18-
from functions import readTextfile
14+
from functions import datetime, firewallApi, getSetupValue, printScript, readTextfile
1915

2016

2117
# check first if firewall is skipped by setup
2218
skipfw = getSetupValue('skipfw')
23-
if skipfw == 'True':
19+
if skipfw:
2420
printScript('Firewall is skipped by setup!')
2521
sys.exit(0)
2622

0 commit comments

Comments
 (0)