[yast-commit] r67980 - /branches/SuSE-Code-11-SP2-Branch/lxc/src/Lxc.ycp
Author: jsuchome Date: Mon Apr 23 10:46:41 2012 New Revision: 67980 URL: http://svn.opensuse.org/viewcvs/yast?rev=67980&view=rev Log: show each lxc only once Modified: branches/SuSE-Code-11-SP2-Branch/lxc/src/Lxc.ycp Modified: branches/SuSE-Code-11-SP2-Branch/lxc/src/Lxc.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/src/Lxc.ycp?rev=67980&r1=67979&r2=67980&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/lxc/src/Lxc.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/lxc/src/Lxc.ycp Mon Apr 23 10:46:41 2012 @@ -92,17 +92,20 @@ global list<term> GetContainers () { - list<term> ret = []; + list<term> ret = []; + map lxc_index = $[]; + map out = (map) SCR::Execute (.target.bash_output, "lxc-ls -1"); foreach (string line, sort (splitstring (out["stdout"]:"", "\n")), { - if (line != "") + if (line != "" && !haskey (lxc_index, line)) { string cmd= sformat ("lxc-info -n %1 | grep state", line); out = (map) SCR::Execute (.target.bash_output, cmd, $[ "LANG" : "C" ]); list<string> state = splitstring (deletechars (out["stdout"]:"", " \t\n"), ":"); ret = add (ret, `item (line, state[1]:"")); // FIXME translate + lxc_index[line] = true; } }); return ret; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
jsuchome@svn2.opensuse.org