Skip to content

Commit 46115cf

Browse files
committed
Add vebosity.
1 parent 035789b commit 46115cf

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

netconnectd/server.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ def dhcp_range(arg):
946946
parser.add_argument(
947947
"--ap-driver", help="The driver to use for the hostapd, defaults to nl80211"
948948
)
949-
parser.add_argument("--ap-ssid", help="SSID of the AP wifi")
949+
parser.add_argument("--ap-ssid", help="SSID of the AP wifi, defaults to the system hostname")
950950
parser.add_argument(
951951
"--ap-psk",
952952
help="Passphrase with which to secure the AP wifi, defaults to creation of an unsecured wifi",
@@ -1103,8 +1103,12 @@ def dhcp_range(arg):
11031103
if args.ap_ssid:
11041104
config["ap"]["ssid"] = args.ap_ssid
11051105
else:
1106-
# Default SSID should be the hostname
1107-
config["ap"]["ssid"] = socket.gethostname()
1106+
try:
1107+
import socket
1108+
# Default SSID should be the hostname
1109+
config["ap"]["ssid"] = socket.gethostname()
1110+
except Exception:
1111+
parse.error("Failed to read system hostname")
11081112
if args.ap_psk:
11091113
config["ap"]["psk"] = args.ap_psk
11101114
if args.ap_channel:

0 commit comments

Comments
 (0)