SeattleMeshnet / meshbox

The Hyperboria peering device
https://github.com/hyperboria/cjdns
GNU General Public License v3.0
141 stars 25 forks source link

Don't include uncommitted config changes #12

Closed ghost closed 9 years ago

ghost commented 10 years ago

Right now, cjdns.uci.get() includes uncommitted config changes. Instead, only stuff that's committed should be included.

Expected:

$ s=$(uci add cjdns password); uci set cjdns.$s.password=12345
$ cat /etc/config/cjdns | grep 12345
$ cjdrouteconf get | grep 12345

$ uci commit
$ cjdrouteconf get | grep 12345
    "password":"12345",
$ cat /etc/config/cjdns | grep 12345
    option password '12345'

Actual:

$ s=$(uci add cjdns password); uci set cjdns.$s.password=12345
$ cat /etc/config/cjdns | grep 12345
$ cjdrouteconf get | grep 12345
    "password":"12345",

$ uci commit
$ cjdrouteconf get | grep 12345
    "password":"12345",
$ cat /etc/config/cjdns | grep 12345
    option password '12345'
ghost commented 9 years ago

This is actually just how UCI is supposed to worked.

1 - Make change, reload config 2 - Test change 3a - Commit change 3b - Revert change, reload config

Everything is good.