leamas / ddupdate

Update DNS Data for Dynamic IP Addresses
MIT License
40 stars 28 forks source link

Service Options in config file do not work #24

Closed mmannerm closed 5 years ago

mmannerm commented 5 years ago

Service Options in config file do not work properly, as the plugins assume a list of options, not a string that is given by the Python configparser module.

[update]
address-plugin = default-web-ip
service-plugin = cloudflare.com
hostname = myhost.example.com
ip-version = v4
service-options = zone=example.com
loglevel = info

This results into

INFO - Loglevel: INFO
INFO - Using hostname: myhost.example.com
INFO - Using ip address plugin: default-web-ip
INFO - Using service plugin: cloudflare.com
INFO - Service options: z o n e = e x a m p l e . c o m
INFO - Address options: 
INFO - Using ip address: ['127.0.0.1', None]
ERROR - Cannot update DNS data: 'Required option zone= missing, giving up.'

I would suggest to moving YAML configurations, as there is another problem with current configuration, which is no support for multiple hosts or even same host for IPv4 and IPv6 which requires two different address plugins.

mmannerm commented 5 years ago

Alternatively if YAML is not to liking, and configparser still needs to be used, a better parsing logic on embedded maps is required.

leamas commented 5 years ago

Oops... seems like a regression. My bad, thanks for reporting!

Could you please try the attached patch before I push it on master?

As for YAML: It's indeed a great format. However, I don't see that the added dependency is motivated in this case. It was was an early design decision, and I think it's still valid.

0001-config-file-Fix-service-options-parse-regression-24.patch.gz

leamas commented 5 years ago

Fixed (al last?) in [6663b73], [035b5be] and [01790a2]