Author: jsuchome
Date: Fri Apr 27 15:19:45 2012
New Revision: 68035
URL: http://svn.opensuse.org/viewcvs/yast?rev=68035&view=rev
Log:
new module for LXC
Added:
trunk/lxc/
trunk/lxc/MAINTAINER
trunk/lxc/Makefile.cvs
trunk/lxc/RPMNAME
trunk/lxc/VERSION
trunk/lxc/_cvsignore
trunk/lxc/configure.in.in
trunk/lxc/doc/
trunk/lxc/doc/Makefile.am
trunk/lxc/doc/_cvsignore
trunk/lxc/doc/autodocs/
trunk/lxc/doc/autodocs/Makefile.am
trunk/lxc/doc/autodocs/_cvsignore
trunk/lxc/package/
trunk/lxc/package/_cvsignore
trunk/lxc/package/yast2-lxc.changes
trunk/lxc/src/
trunk/lxc/src/Lxc.ycp (with props)
trunk/lxc/src/Makefile.am
trunk/lxc/src/_cvsignore
trunk/lxc/src/dialogs.ycp (with props)
trunk/lxc/src/helps.ycp (with props)
trunk/lxc/src/lxc.desktop
trunk/lxc/src/lxc.ycp (with props)
trunk/lxc/src/wizards.ycp (with props)
trunk/lxc/testsuite/
trunk/lxc/testsuite/Makefile.am
trunk/lxc/testsuite/_cvsignore
trunk/lxc/testsuite/tests/
trunk/lxc/testsuite/tests/_cvsignore
trunk/lxc/yast2-lxc.spec.in
Added: trunk/lxc/MAINTAINER
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/MAINTAINER?rev=68035&view=auto
==============================================================================
--- trunk/lxc/MAINTAINER (added)
+++ trunk/lxc/MAINTAINER Fri Apr 27 15:19:45 2012
@@ -0,0 +1 @@
+Jiri Suchomel
Added: trunk/lxc/Makefile.cvs
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/Makefile.cvs?rev=68035&view=auto
==============================================================================
--- trunk/lxc/Makefile.cvs (added)
+++ trunk/lxc/Makefile.cvs Fri Apr 27 15:19:45 2012
@@ -0,0 +1,22 @@
+#
+# Makefile.cvs
+#
+PREFIX = /usr
+
+LIB = $(shell y2tool get-lib)
+
+configure: all
+ ./configure --prefix=$(PREFIX) --libdir=$(PREFIX)/$(LIB)
+
+all:
+ y2tool y2autoconf
+ y2tool y2automake
+ autoreconf --force --install
+
+install: configure
+ make
+ make install
+
+reconf: all
+ ./config.status --recheck
+ ./config.status
Added: trunk/lxc/RPMNAME
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/RPMNAME?rev=68035&view=auto
==============================================================================
--- trunk/lxc/RPMNAME (added)
+++ trunk/lxc/RPMNAME Fri Apr 27 15:19:45 2012
@@ -0,0 +1 @@
+yast2-lxc
Added: trunk/lxc/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/VERSION?rev=68035&view=auto
==============================================================================
--- trunk/lxc/VERSION (added)
+++ trunk/lxc/VERSION Fri Apr 27 15:19:45 2012
@@ -0,0 +1 @@
+2.22.0
Added: trunk/lxc/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/_cvsignore?rev=68035&view=auto
==============================================================================
--- trunk/lxc/_cvsignore (added)
+++ trunk/lxc/_cvsignore Fri Apr 27 15:19:45 2012
@@ -0,0 +1,20 @@
+Makefile
+Makefile.am
+Makefile.am.common
+Makefile.in
+aclocal.m4
+config.cache
+config.guess
+config.h.in
+config.log
+config.status
+config.sub
+configure
+configure.in
+depcomp
+install-sh
+missing
+mkinstalldirs
+stamp-h
+lxc.pot
+autom4te.cache
Added: trunk/lxc/configure.in.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/configure.in.in?rev=68035&view=auto
==============================================================================
--- trunk/lxc/configure.in.in (added)
+++ trunk/lxc/configure.in.in Fri Apr 27 15:19:45 2012
@@ -0,0 +1,12 @@
+## YCP module configure.in.in
+
+## Initialize
+@YAST2-INIT-COMMON@
+@YAST2-INIT-YCP@
+
+## some common checks
+@YAST2-CHECKS-COMMON@
+@YAST2-CHECKS-YCP@
+
+## and generate the output...
+@YAST2-OUTPUT@
Added: trunk/lxc/doc/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/doc/Makefile.am?rev=68035&view=auto
==============================================================================
--- trunk/lxc/doc/Makefile.am (added)
+++ trunk/lxc/doc/Makefile.am Fri Apr 27 15:19:45 2012
@@ -0,0 +1,10 @@
+# Makefile.am for lxc/doc
+
+SUBDIRS = autodocs
+
+htmldir = $(docdir)
+
+doc_DATA =
+html_DATA =
+
+EXTRA_DIST = $(doc_DATA) $(html_DATA)
Added: trunk/lxc/doc/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/doc/_cvsignore?rev=68035&view=auto
==============================================================================
--- trunk/lxc/doc/_cvsignore (added)
+++ trunk/lxc/doc/_cvsignore Fri Apr 27 15:19:45 2012
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Added: trunk/lxc/doc/autodocs/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/doc/autodocs/Makefile.am?rev=68035&view=auto
==============================================================================
--- trunk/lxc/doc/autodocs/Makefile.am (added)
+++ trunk/lxc/doc/autodocs/Makefile.am Fri Apr 27 15:19:45 2012
@@ -0,0 +1,3 @@
+# Makefile.am for lxc/doc/autodocs
+
+include $(top_srcdir)/autodocs-ycp.ami
Added: trunk/lxc/doc/autodocs/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/doc/autodocs/_cvsignore?rev=68035&view=auto
==============================================================================
--- trunk/lxc/doc/autodocs/_cvsignore (added)
+++ trunk/lxc/doc/autodocs/_cvsignore Fri Apr 27 15:19:45 2012
@@ -0,0 +1,3 @@
+Makefile
+Makefile.in
+*.html
Added: trunk/lxc/package/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/package/_cvsignore?rev=68035&view=auto
==============================================================================
--- trunk/lxc/package/_cvsignore (added)
+++ trunk/lxc/package/_cvsignore Fri Apr 27 15:19:45 2012
@@ -0,0 +1,2 @@
+*.spec
+*.bz2
Added: trunk/lxc/package/yast2-lxc.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/package/yast2-lxc.changes?rev=68035&view=auto
==============================================================================
--- trunk/lxc/package/yast2-lxc.changes (added)
+++ trunk/lxc/package/yast2-lxc.changes Fri Apr 27 15:19:45 2012
@@ -0,0 +1,49 @@
+-------------------------------------------------------------------
+Fri Apr 27 14:48:38 CEST 2012 - jsuchome@suse.cz
+
+- openSUSE version
+- 2.22.0
+
+-------------------------------------------------------------------
+Fri Apr 27 13:21:01 CEST 2012 - jsuchome@suse.cz
+
+- updated help texts
+- try to higlight lxc-checkconfig output in ncurses
+- 2.17.5
+
+-------------------------------------------------------------------
+Thu Apr 26 16:06:25 CEST 2012 - jsuchome@suse.cz
+
+- check if configuration is prepared
+- updated help texts
+- 2.17.4
+
+-------------------------------------------------------------------
+Mon Apr 23 16:42:59 CEST 2012 - jsuchome@suse.cz
+
+- handle more consoles running
+- check console processes state
+- properly handle buttons enablement
+- report error on start failure
+- stop container before deleting
+- enable manual refreshing of the table
+- 2.17.3
+
+-------------------------------------------------------------------
+Mon Apr 23 11:54:12 CEST 2012 - jsuchome@suse.cz
+
+- show list of containers
+- start container in background, allow connect via console
+- 2.17.2
+
+-------------------------------------------------------------------
+Fri Apr 20 12:38:23 CEST 2012 - jsuchome@suse.cz
+
+- read bridges id's
+- explicit buttons for Create/Start/Destroy
+- 2.17.1
+
+-------------------------------------------------------------------
+Fri Apr 13 13:01:03 2012 - jsuchome@suse.cz
+
+- initial version
Added: trunk/lxc/src/Lxc.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/src/Lxc.ycp?rev=68035&view=auto
==============================================================================
--- trunk/lxc/src/Lxc.ycp (added)
+++ trunk/lxc/src/Lxc.ycp Fri Apr 27 15:19:45 2012
@@ -0,0 +1,253 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2012 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: modules/Lxc.ycp
+ * Package: Configuration of lxc
+ * Summary: Lxc settings, input and output functions
+ * Authors: Jiri Suchomel
+ *
+ * $Id$
+ *
+ * Representation of the configuration of lxc.
+ * Input and output routines.
+ */
+
+{
+
+module "Lxc";
+textdomain "lxc";
+
+import "Directory";
+import "Progress";
+import "Security";
+
+
+// text or graphic mode?
+global boolean textmode = false;
+
+// current password encryption method
+string method = "des";
+
+// read list of available templates
+global list<term> ReadTemplates () {
+
+ list<term> ret = [];
+ map out = (map) SCR::Execute (.target.bash_output, "rpm -ql lxc | grep 'templates/' | cut -f 2 -d -");
+ if (out["stdout"]:"" != "")
+ {
+ foreach (string line, sort (splitstring (out["stdout"]:"", "\n")), {
+ if (line != "")
+ {
+ ret = add (ret,
+ // sles goes later = selected if present
+ `item (line, line == "sles" || line == "opensuse"));
+ }
+ });
+ }
+ return ret;
+}
+
+// encrypt given password using current method
+global string CryptPassword (string pw) {
+
+ if (method == "md5")
+ return cryptmd5 (pw);
+ if (method == "blowfish")
+ return cryptblowfish (pw);
+ if (method == "sha256")
+ return cryptsha256 (pw);
+ if (method == "sha512")
+ return cryptsha512 (pw);
+ return crypt (pw);
+}
+
+global list<string> ReadBridgesIds () {
+
+ map out = (map) SCR::Execute (.target.bash_output, "brctl show | tail -n +2 | cut -f 1");
+ list<string> ret = [];
+
+ if (out["stdout"]:"" != "")
+ {
+ ret = maplist (string line, splitstring (out["stdout"]:"", "\n"), ``(line));
+ }
+ return ret;
+}
+
+global list<term> GetContainers () {
+
+ 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 != "" && !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;
+}
+
+/**
+ * Check if LXC is correctly configured
+ */
+boolean CheckLXCConfiguration () {
+
+ boolean problem = false;
+ // zgrep does not seem to work with .target.bash_output -> grep uncompressed config FIXME
+ string tmpdir = Directory::tmpdir;
+ SCR::Execute (.target.bash_output, sformat (
+ "cp /proc/config.gz %1/ && gunzip %1/config.gz", tmpdir));
+
+ map out = (map) SCR::Execute (.target.bash_output, sformat (
+// "GREP=grep CONFIG=%1/config /usr/bin/lxc-checkconfig", tmpdir));
+ "GREP=grep /usr/bin/lxc-checkconfig"));
+
+ list<string> rt = [];
+ map colors = $[
+ "blue" : "\033[1;32m",
+ "red" : "\033[1;31m",
+ "yellow" : "\033[1;33m"
+ ];
+ foreach (string line, splitstring (out["stdout"]:"", "\n"), {
+ boolean colored = false;
+ foreach (string name, string color, colors, {
+ if (colored)
+ {
+ break;
+ }
+ integer found = find (line, color);
+ if (found != nil && found > 0)
+ {
+ if (textmode)
+ {
+ line = sformat ("%1<i>%2</i>",
+ substring (line, 0, found),
+ substring (line, found + size (color))
+ );
+ }
+ else
+ {
+ line = sformat ("%1<font color=%2>%3</font>",
+ substring (line, 0, found),
+ name,
+ substring (line, found + size (color))
+ );
+ }
+ colored = true;
+ if (name == "red" || name == "yellow")
+ problem = true;
+ }
+ });
+ // 'normalizing' color
+ integer found = find (line, "\033[0;39m");
+ if (found != nil && found >= 0)
+ {
+ line = substring (line, 0, found) +
+ substring (line, found + size ( "\033[0;39m"));
+ }
+ rt = add (rt, line);
+ });
+
+ if (!problem)
+ {
+ return true;
+ }
+
+ UI::OpenDialog (`opt(`decorated), `HBox(`HSpacing(1.5),
+ `VSpacing (30),
+ `VBox (
+ `HSpacing(85),
+ `VSpacing(0.5),
+ // info label (try to keep the text short)
+ `Label (_("Some problems with LXC configuration were found. Check the documentation for details.")),
+ `VSpacing(0.5),
+ // output follows in widget below
+ `Left (`Label (_("Output of 'lxc-checkconfig' script:"))),
+ `RichText (`id (`rt), mergestring (rt, "<br>")),
+ `PushButton ("OK")
+ )));
+
+ UI::UserInput ();
+ UI::CloseDialog ();
+
+ return false;
+}
+
+/**
+ * Read all lxc settings
+ * @return true on success
+ */
+global boolean Read() {
+
+ /* Lxc read dialog caption */
+ string caption = _("Initializing LXC Configuration");
+
+ integer steps = 2;
+
+ // We do not set help text here, because it was set outside
+ Progress::New( caption, " ", steps, [
+ // Progress stage
+ _("Check LXC availability"),
+ // Progress stage
+ _("Read system settings"),
+ ], [
+ // Progress step
+ _("Check LXC availability..."),
+ // Progress step
+ _("Reading system settings..."),
+ // Progress finished
+ _("Finished")
+ ],
+ ""
+ );
+
+
+ Progress::NextStage();
+
+ textmode = UI::GetDisplayInfo()["TextMode"]:false;
+
+ CheckLXCConfiguration ();
+
+ Progress::NextStage();
+
+ boolean orig = Progress::set (false);
+
+ Security::Read ();
+
+ Progress::set (orig);
+
+ map security = Security::Export ();
+ method = tolower (security["PASSWD_ENCRYPTION"]:"des");
+
+ Progress::NextStage();
+
+ return true;
+}
+
+/* EOF */
+}
Added: trunk/lxc/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/src/Makefile.am?rev=68035&view=auto
==============================================================================
--- trunk/lxc/src/Makefile.am (added)
+++ trunk/lxc/src/Makefile.am Fri Apr 27 15:19:45 2012
@@ -0,0 +1,26 @@
+# Makefile.am for lxc/src
+
+yncludedir = @yncludedir@/lxc
+
+client_DATA = \
+ lxc.ycp
+
+ynclude_DATA = \
+ helps.ycp \
+ wizards.ycp \
+ dialogs.ycp
+
+desktop_DATA = \
+ lxc.desktop
+
+module_DATA = \
+ Lxc.ycp
+
+# create a symlink for local build, #145327
+lxc:
+ ln -sf . $@
+ycpchook = lxc
+
+EXTRA_DIST = $(client_DATA) $(ynclude_DATA) $(module_DATA) $(desktop_DATA)
+
+include $(top_srcdir)/Makefile.am.common
Added: trunk/lxc/src/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/src/_cvsignore?rev=68035&view=auto
==============================================================================
--- trunk/lxc/src/_cvsignore (added)
+++ trunk/lxc/src/_cvsignore Fri Apr 27 15:19:45 2012
@@ -0,0 +1,4 @@
+Makefile
+Makefile.in
+*.ybc
+.dep
Added: trunk/lxc/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/src/dialogs.ycp?rev=68035&view=auto
==============================================================================
--- trunk/lxc/src/dialogs.ycp (added)
+++ trunk/lxc/src/dialogs.ycp Fri Apr 27 15:19:45 2012
@@ -0,0 +1,548 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2012 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/lxc/dialogs.ycp
+ * Package: Configuration of lxc
+ * Summary: Dialogs definitions
+ * Authors: Jiri Suchomel
+ *
+ * $Id$
+ */
+
+{
+
+textdomain "lxc";
+
+import "FileUtils";
+import "IP";
+import "Label";
+import "Popup";
+import "Progress";
+import "Report";
+import "Security";
+import "Wizard";
+
+include "lxc/helps.ycp";
+
+// PIDs of running consoles (indexed by lxc names)
+map console_pids = $[];
+
+
+boolean CreateContainerConfig (string name, string ip, string subnet, string bridge, string template)
+{
+ // busy message
+ Popup::ShowFeedback ("", _("Creating Configuration..."));
+
+ // lxc-createconfig -n <name> [-i ] [-b <bridge>] [-t 0)
+ {
+ sleep (100);
+ ret = UI::PollInput();
+ }
+ else
+ {
+ ret = UI::UserInput();
+ }
+
+ if (ret == `abort || ret == `cancel || ret == `next || ret == `back) {
+ break;
+ }
+
+ if (ret == `add_button) {
+ ret = `add;
+ break;
+ }
+ selected = (string) UI::QueryWidget (`id (`table), `CurrentItem);
+ integer console_pid = console_pids[selected]:nil;
+
+ // check the status of console process
+ if (console_pid != nil && SCR::Read (.process.running, console_pid) != true) {
+ y2milestone ("console process is dead");
+ console_pids = remove (console_pids, selected);
+ update_buttons (selected);
+ continue;
+ }
+
+ if (ret == `table) {
+ update_buttons (selected);
+ }
+
+ if (ret == `refresh) {
+ update_table ();
+ }
+
+ if (ret == `start) {
+ StartContainer (selected);
+ update_table ();
+ }
+
+ if (ret == `connect && console_pid == nil) {
+ console_pids[selected] = Connect (selected);
+ update_buttons (selected);
+ }
+
+ if (ret == `disconnect && console_pid != nil) {
+ y2milestone ("killing console proces with PID %1...", console_pid);
+ SCR::Execute (.process.kill, console_pid, 15);
+ // FIXME timeout + kill -9
+ console_pids = remove (console_pids, selected);
+ update_buttons (selected);
+ }
+
+ if (ret == `stop) {
+ StopContainer (selected);
+ update_table ();
+ }
+
+ if (ret == `destroy && Popup::YesNo (sformat (_("Are you sure to delete container '%1'?"), selected))) {
+ StopContainer (selected);
+ DestroyContainer (selected);
+ update_table ();
+ }
+ }
+
+ return ret;
+}
+
+/* EOF */
+}
Added: trunk/lxc/src/helps.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/src/helps.ycp?rev=68035&view=auto
==============================================================================
--- trunk/lxc/src/helps.ycp (added)
+++ trunk/lxc/src/helps.ycp Fri Apr 27 15:19:45 2012
@@ -0,0 +1,73 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/lxc/helps.ycp
+ * Package: Configuration of lxc
+ * Summary: Help texts of all the dialogs
+ * Authors: Jiri Suchomel
+ *
+ * $Id$
+ */
+
+{
+
+textdomain "lxc";
+
+/**
+ * All helps are here
+ */
+map HELPS = $[
+
+ /* Read dialog help */
+ "read" : _("<p><b><big>Initializing LXC Configuration</big></b><br>
+Please wait...<br></p>
+"),
+
+ // Overview dialog help, part 1
+ "overview" : _("<p><b><big>LXC Overview</big></b><br>
+Here, see the list of configured Linux Containers (LXC) with their current status.
+<p>Use <b>Create</b> to create new container. Delete existing one with <b>Destroy</b>.
+</p>") +
+
+ // Overview dialog help, part 2
+_("<p>You can start selected container with <b>Start</b>. The container is started in background. You can connect to it using <b>Connect</b> button or manually using <tt>lxc-console</tt> command. Once in console, you can close it from within or using the <b>Disconnect</b> button.</p>
+<p>Note that <b>Connect</b> option is not available in text mode.</p>"),
+
+ // Create dialog help, part 1
+ "create" : _("<p><b><big>Creating New Container</big></b></p>") +
+
+ // Create dialog help, part 2
+_("<p>Choose a <b>Name</b>, <b>Template</b> and enter network settings for the new container.</p>") +
+
+ // Create dialog help, part 3
+_("<p>Use the value <tt>0.0.0.0</tt> as <b>IP Address</b> to have dynamic address assigned by DHCP. If there's no bridge device configured yet, use <b>Configure Network</b> button and create one.</p>") +
+
+ // Create dialog help, part 4
+_("<p>Select a root password to use in the container. If no password is entered, the default value <tt>root</tt> will be used.</p>") +
+
+ // Create dialog help, part 5
+_("<p>Use <b>Create</b> to start the creation process.</p>")
+
+
+];
+
+/* EOF */
+}
Added: trunk/lxc/src/lxc.desktop
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/src/lxc.desktop?rev=68035&view=auto
==============================================================================
--- trunk/lxc/src/lxc.desktop (added)
+++ trunk/lxc/src/lxc.desktop Fri Apr 27 15:19:45 2012
@@ -0,0 +1,23 @@
+[Desktop Entry]
+Type=Application
+Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc;
+
+X-KDE-ModuleType=Library
+X-KDE-HasReadOnlyMode=true
+X-KDE-Library=yast2
+X-SuSE-YaST-Call=lxc
+
+X-SuSE-YaST-Group=Misc
+X-SuSE-YaST-Argument=
+X-SuSE-YaST-RootOnly=true
+X-SuSE-YaST-AutoInst=
+X-SuSE-YaST-Geometry=
+X-SuSE-YaST-SortKey=
+X-SuSE-YaST-AutoInstResource=lxc
+
+Icon=yast-lxc
+Exec=/usr/bin/xdg-su -c '/sbin/yast2 lxc'
+
+Name=Lxc
+GenericName=lxc
+StartupNotify=true
Added: trunk/lxc/src/lxc.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/src/lxc.ycp?rev=68035&view=auto
==============================================================================
--- trunk/lxc/src/lxc.ycp (added)
+++ trunk/lxc/src/lxc.ycp Fri Apr 27 15:19:45 2012
@@ -0,0 +1,78 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2012 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: clients/lxc.ycp
+ * Package: Configuration of lxc
+ * Summary: Main file
+ * Authors: Jiri Suchomel
+ *
+ * $Id$
+ *
+ * Main file for lxc configuration. Uses all other files.
+ */
+
+{
+
+/***
+ * <h3>Configuration of lxc</h3>
+ */
+
+textdomain "lxc";
+
+/* The main () */
+y2milestone ("----------------------------------------");
+y2milestone ("Lxc module started");
+
+import "Progress";
+import "Report";
+import "Summary";
+
+import "CommandLine";
+include "lxc/wizards.ycp";
+
+map cmdline_description = $[
+ "id" : "lxc",
+ /* Command line help text for the Xlxc module */
+ "help" : _("Configuration of LXC"),
+ "guihandler" : LxcSequence,
+ "initialize" : Lxc::Read,
+ "actions" : $[
+ ],
+ "options" : $[
+ ],
+ "mappings" : $[
+ ]
+];
+
+/* main ui function */
+any ret = nil;
+
+ret = CommandLine::Run(cmdline_description);
+y2debug("ret=%1", ret);
+
+/* Finish */
+y2milestone("Lxc module finished");
+y2milestone("----------------------------------------");
+
+return ret;
+
+/* EOF */
+}
Added: trunk/lxc/src/wizards.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/src/wizards.ycp?rev=68035&view=auto
==============================================================================
--- trunk/lxc/src/wizards.ycp (added)
+++ trunk/lxc/src/wizards.ycp Fri Apr 27 15:19:45 2012
@@ -0,0 +1,114 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/lxc/wizards.ycp
+ * Package: Configuration of lxc
+ * Summary: Wizards definitions
+ * Authors: Jiri Suchomel
+ *
+ * $Id$
+ */
+
+{
+
+textdomain "lxc";
+
+import "Confirm";
+import "Lxc";
+import "Sequencer";
+import "Wizard";
+
+include "lxc/dialogs.ycp";
+
+/**
+ * Read settings dialog
+ * @return `abort if aborted and `next otherwise
+ */
+symbol ReadDialog() {
+ Wizard::RestoreHelp(HELPS["read"]:"");
+ if (!Confirm::MustBeRoot()) return `abort;
+ boolean ret = Lxc::Read();
+ return ret ? `next : `abort;
+}
+
+/**
+ * Main workflow of the lxc configuration
+ * @return sequence result
+ */
+any MainSequence() {
+
+ map aliases = $[
+ "overview" : ``( OverviewDialog() ),
+ "add" : ``( AddDialog() ),
+ ];
+
+ map sequence = $[
+ "ws_start" : "overview",
+ "overview" : $[
+ `abort : `abort,
+ `next : `next,
+ `add : "add",
+ ],
+ "add" : $[
+ `abort : `abort,
+ `next : "overview",
+ ],
+ ];
+
+ any ret = Sequencer::Run(aliases, sequence);
+
+ return ret;
+}
+
+/**
+ * Whole configuration of lxc
+ * @return sequence result
+ */
+any LxcSequence() {
+
+ map aliases = $[
+ "read" : [ ``( ReadDialog() ), true ],
+ "main" : ``( MainSequence() ),
+ ];
+
+ map sequence = $[
+ "ws_start" : "read",
+ "read" : $[
+ `abort : `abort,
+ `next : "main"
+ ],
+ "main" : $[
+ `abort : `abort,
+ `next : `next
+ ],
+ ];
+
+ Wizard::CreateDialog();
+ Wizard::HideAbortButton ();
+
+ any ret = Sequencer::Run(aliases, sequence);
+
+ UI::CloseDialog();
+ return ret;
+}
+
+/* EOF */
+}
Added: trunk/lxc/testsuite/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/testsuite/Makefile.am?rev=68035&view=auto
==============================================================================
--- trunk/lxc/testsuite/Makefile.am (added)
+++ trunk/lxc/testsuite/Makefile.am Fri Apr 27 15:19:45 2012
@@ -0,0 +1,21 @@
+#
+# Makefile.am for .../testsuite
+#
+# Do not edit this file (Makefile.am) as it will be overwritten!
+#
+
+AUTOMAKE_OPTIONS = dejagnu
+EXTRA_DIST = $(wildcard tests/*.out) $(wildcard tests/*.err) $(wildcard tests/*.ycp) $(wildcard tests/*.yh)
+
+testsuite_prepare = @ydatadir@/testsuite/Makefile.testsuite
+
+all-local: $(testsuite_prepare)
+ make -f $(testsuite_prepare) RPMNAME=$(RPMNAME) srcdir=$(srcdir)
+
+clean-local: $(testsuite_prepare)
+ make -f $(testsuite_prepare) RPMNAME=$(RPMNAME) srcdir=$(srcdir) clean
+
+check-local: $(testsuite_prepare)
+ make -f $(testsuite_prepare) RPMNAME=$(RPMNAME) srcdir=$(srcdir) check
+
+# EOF
Added: trunk/lxc/testsuite/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/testsuite/_cvsignore?rev=68035&view=auto
==============================================================================
--- trunk/lxc/testsuite/_cvsignore (added)
+++ trunk/lxc/testsuite/_cvsignore Fri Apr 27 15:19:45 2012
@@ -0,0 +1,11 @@
+Makefile
+Makefile.in
+site.exp
+*.sum
+*.log
+tmp.out*
+tmp.err*
+tmp.log*
+config
+run
+*.test
Added: trunk/lxc/testsuite/tests/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/testsuite/tests/_cvsignore?rev=68035&view=auto
==============================================================================
(empty)
Added: trunk/lxc/yast2-lxc.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/lxc/yast2-lxc.spec.in?rev=68035&view=auto
==============================================================================
--- trunk/lxc/yast2-lxc.spec.in (added)
+++ trunk/lxc/yast2-lxc.spec.in Fri Apr 27 15:19:45 2012
@@ -0,0 +1,29 @@
+@HEADER-COMMENT@
+
+@HEADER@
+Requires: yast2 yast2-security lxc
+BuildRequires: perl-XML-Writer update-desktop-files yast2 yast2-devtools yast2-testsuite yast2-security
+
+BuildArchitectures: noarch
+
+Summary: Management tool for Linux Containers (LXC)
+
+%description
+-
+
+@PREP@
+
+@BUILD@
+
+@INSTALL@
+
+@CLEAN@
+
+%files
+%defattr(-,root,root)
+%dir @yncludedir@/lxc
+@yncludedir@/lxc/*
+@clientdir@/lxc.ycp
+@moduledir@/Lxc.*
+@desktopdir@/lxc.desktop
+%doc @docdir@
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org