timothymiller/cloudflare-ddns

Broken image after code cleanup

aykonsvk opened this issue · 2 comments

Describe the bug
The code is getting incorrect values from config.

cloudflare-ddns      | 🕰️ Updating IPv4 (A) records every 5 minutes
cloudflare-ddns      | Traceback (most recent call last):
cloudflare-ddns      |   File "/cloudflare-ddns.py", line 227, in <module>
cloudflare-ddns      |     updateIPs(getIPs())
cloudflare-ddns      |   File "/cloudflare-ddns.py", line 181, in updateIPs
cloudflare-ddns      |     commitRecord(ip)
cloudflare-ddns      |   File "/cloudflare-ddns.py", line 102, in commitRecord
cloudflare-ddns      |     subdomain = subdomain.lower().strip()
cloudflare-ddns      | AttributeError: 'dict' object has no attribute 'lower'
cloudflare-ddns exited with code 1
{
  "cloudflare": [
    {
      "authentication": {
        "api_token": "token"
      },
      "zone_id": "zone",
      "subdomains": [
        {
          "name": "first",
          "proxied": false
        },
        {
          "name": "second",
          "proxied": true
        }
      ]
    }
  ],
  "a": true,
  "aaaa": false,
  "purgeUnknownRecords": false
}

To Reproduce
Steps to reproduce the behavior:

  1. get newest image from docker hub
  2. use config above
  3. error is present

Expected behavior
The application should parse and update dns

Desktop (please complete the following information):

  • OS: MacOS
  • Version BigSur

Did you solve this?

@shortgame11 Yes this is solved.