[luci] [LuCI] #78: uci.changes() doesn't list all changes
LuciTrac
trac at luci.subsignal.org
Wed Aug 12 22:06:30 CEST 2009
#78: uci.changes() doesn't list all changes
-----------------------+----------------------------------------------------
Reporter: reporter | Owner:
Type: defect | Status: new
Priority: major | Milestone:
Component: LuCI Base | Keywords:
-----------------------+----------------------------------------------------
This is probably an issue in the upstream uci (I tried 0.7.5), but for now
I have only a luci testcase [*] (attached). I hooked into the Map.uci
commit function to do stuff when this happens, I'm especially interested
in the changes happening. But only if you press "Save & Apply" or have
autoapply set for the model.
But for some reason does the changes() table not contain all data. To try
this, use the attached CBI model (guess you know how to do this), go to
the page and enter "1" in the Baz field, then click "Add Entry", enter
"2", click "Add Entry" and enter "3". Now click "Save & Apply". You
lucid's stdout should look like this:
{{{
=> changes:
cfg026865.baz=1
cfg026865..type=test
cfg026865.foo=foo
cfg026865.bar=A
cfg036865.baz=2
cfg036865..type=test
cfg036865.foo=foo
cfg036865.bar=A
cfg046865..type=test
cfg046865.foo=foo
cfg046865.bar=A
=> config:
cfg026865..name=cfg026865
cfg026865..type=test
cfg026865.baz=1
cfg026865.foo=foo
cfg026865..index=0
cfg026865..anonymous=true
cfg026865.bar=A
cfg036865..name=cfg036865
cfg036865..type=test
cfg036865.baz=2
cfg036865.foo=foo
cfg036865..index=1
cfg036865..anonymous=true
cfg036865.bar=A
cfg046865..name=cfg046865
cfg046865..type=test
cfg046865.baz=3
cfg046865.foo=foo
cfg046865..index=2
cfg046865..anonymous=true
cfg046865.bar=A
=> cat:
+testcase.cfg026865=test
testcase.cfg026865.bar=A
testcase.cfg026865.foo=foo
testcase.cfg026865.baz=1
+testcase.cfg036865=test
testcase.cfg036865.bar=A
testcase.cfg036865.foo=foo
testcase.cfg036865.baz=2
+testcase.cfg046865=test
testcase.cfg046865.bar=A
testcase.cfg046865.foo=foo
testcase.cfg046865.baz=3
=> call:
testcase.cfg026865=test
testcase.cfg026865.bar=A
testcase.cfg026865.foo=foo
testcase.cfg026865.baz=1
testcase.cfg036865=test
testcase.cfg036865.bar=A
testcase.cfg036865.foo=foo
testcase.cfg036865.baz=2
testcase.cfg046865=test
testcase.cfg046865.bar=A
testcase.cfg046865.foo=foo
testcase.cfg046865.baz=3
sh: /sbin/luci-reload: not found
}}}
Note that there was no baz=3 in the changes output; the config data, the
staging dir and the uci command itself do report that value, only
changes() misses it (and anything else which wasn't set per default).
----
[*] I tried to whip up a plain lua testcase but lua fails like this and
I'm too tired to debug it:
{{{
$ LD_LIBRARY_PATH=./usr/lib LUA_PATH="./usr/lib/lua/?.so"
LUA_CPATH="./usr/lib/lua/?.so" lua ../../testcase.lua
lua: error loading module 'uci' from file './usr/lib/lua/uci.so':
./usr/lib/lua/uci.so:1: unexpected symbol near 'char(127)'
stack traceback:
[C]: ?
[C]: in function 'require'
../../testcase.lua:3: in main chunk
[C]: ?
}}}
--
Ticket URL: <http://luci.subsignal.org/trac/ticket/78>
LuCI <http://luci.subsignal.org/trac>
LuCI - Lua Configuration Interface
More information about the luci
mailing list