Closed tdilauro closed 6 years ago
Yes, same here:
irb(main):002:0> puts Wdmc::Client.new.network
{:ifname=>"egiga", :iftype=>"wired", :proto=>"dhcp_client", :ip=>"192.168.180.10", :netmask=>"255.255.255.0", :gateway=>"192.168.180.1", :dns0=>"172.16.20.1\n", :dns1=>"8.8.8.8\n", :dns2=>"8.8.4.4\n", :gateway_mac_address=>""}
=> nil
irb(main):003:0>
Blocks #4.
Yes, same here:
irb(main):002:0> puts Wdmc::Client.new.network {:ifname=>"egiga", :iftype=>"wired", :proto=>"dhcp_client", :ip=>"192.168.180.10", :netmask=>"255.255.255.0", :gateway=>"192.168.180.1", :dns0=>"172.16.20.1\n", :dns1=>"8.8.8.8\n", :dns2=>"8.8.4.4\n", :gateway_mac_address=>""} => nil irb(main):003:0>
Yeah, makes sense. I suspect that this is what you were fixing in commit https://github.com/okleinschmidt/wdmc/commit/a872d92f920767f922f6e2385332a4f085b494ff.
Work-around added/documented on PR #6. Removed old eval()-based work-around on PR #7.
Resolved. Closing.
Nota bene: This is not a problem with the code, but with the server with which it interacts.
My WD PR4100 NAS returns invalid JSON in response to this method in the Client class. The response includes an unescaped newline (\n), resulting in JSON which cannot be parsed.
Running the response body through jq...
...produces the following:
Running it through od...
...produces the following:
Would be interested to know if others have this problem, as well.