Skip to content

Commit

Permalink
added listify_option
Browse files Browse the repository at this point in the history
  • Loading branch information
Henri Wahl committed Aug 11, 2021
1 parent 795157b commit 556490f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion dhcpy6d/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def listify_option(option):
"""
return any comma or space separated option as list
"""
if option:
if option and not type(option) == list:
lex = shlex.shlex(option)
lex.whitespace = WHITESPACE
lex.wordchars += ':.-/'
Expand Down
2 changes: 1 addition & 1 deletion dhcpy6d/storage/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ClientConfig:
def __init__(self, hostname='', client_class='default', duid='', address=None, prefix=None, mac=None, host_id=''):
self.HOSTNAME = hostname
# MACs
self.MAC = mac
self.MAC = listify_option(mac)
# fixed addresses
if address:
self.ADDRESS = list()
Expand Down
16 changes: 3 additions & 13 deletions doc/dhcpy6d-example.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@
# Server interface - multiple interfaces have to be separated by spaces.
interface = eth0

# Multicast address to listen at
# sensible default for local subnet is ff02::1:2.
#mcast = ff02::1:2

# Port to listen at - like multicast address also defined by RFC.
#port = 547

# Not used yet.
#address = ::1

# Server DUID - if not set there will be one generated every
# time dhcpy6d starts. This might cause trouble for Windows
# clients because they go crazy about the changed server DUID.
Expand Down Expand Up @@ -84,8 +74,8 @@ log_mac_llip = no
# if "none" no client configuration is used.
store_config = file
# Dito for store volatile data like leases and MAC-LLIPs-mapping -
# one of "mysql" or "sqlite".
store_volatile = mysql
# one of "mysql", "postgresql" or "sqlite".
store_volatile = sqlite

# Path to file used for configuration of clients.
store_file_config = clients.conf
Expand All @@ -112,7 +102,7 @@ store_sqlite_volatile = volatile.sqlite

# Flag to let dhcpy6d really answer to client requests -
# might be of use for debugging and testing.
really_do_it = yes
really_do_it = no

# Declare which attributes of a requesting client should be checked
# to prove its identity. Default is "mac", but "duid" and "hostname"
Expand Down

0 comments on commit 556490f

Please sign in to comment.