question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

model.uci.Cursor:set_list(cfg,sect,opt,list) returns true when it doesn't do anything

See original GitHub issue

on both BB & CC:

luci.model.uci.Cursor:set_list returns true even when it doesn’t succeed. If the config file doesn’t exist, set_list returns false, but if the file exists, but the section doesn’t, it returns true without doing anything. Likewise with commit and save.

Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio (double int32)
> uci = require("luci.model.uci")
> ucic = uci.cursor()
> bsl = ucic:set_list("blah", "some_section", "some_option", { 1,2,3})
> =bsl
false
> bsl2 = ucic:set_list("remake", "some_section", "some_option", {1,2,3})
> =bsl2
true
> =ucic:save("remake")
true
> =ucic:commit("remake")
true
> 

Config files themselves:

root@eg-02D455:~# uci show remake  # blank file, but exists
root@eg-02D455:~# uci show blah    # file doesn't exist.
uci: Entry not found
root@eg-02D455:~#

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
jow-commented, Aug 8, 2018

@karlp - will be fixed by the same rpcd updates though:

root@jj:~# lua -lluci.model.uci -e 'print(luci.model.uci:set_list("notexists", "notexist", "test", { 1, 2, 3 }))'
false	Entry not found
root@jj:~# lua -lluci.model.uci -e 'print(luci.model.uci:set_list("network", "notexist", "test", { 1, 2, 3 }))'
false	Entry not found
root@jj:~# lua -lluci.model.uci -e 'print(luci.model.uci:set_list("network", "lan", "test", { 1, 2, 3 }))'
true	nil
root@jj:~# 

0reactions
karlpcommented, Aug 20, 2018

confirmed this is fixed in 1806 era and later after the rpcd fixes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Object Instance luci.model.uci
Get a boolean option and return it's value as true or false. Cursor:get_confdir (), Get the configuration directory. Cursor:get_first (config, type, option, ...
Read more >
Crawford Hall, Irvine, CA, USA Concert Setlists
Located on the campus of the University of California, Irvine. Also known as UCI Crawford Hall. Oct ...
Read more >
[OpenWrt Wiki] The UCI system
List staged changes to the given configuration file or if none given, all configuration files. Add an anonymous section of type section-type to ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found