Author: jsuchome
Date: Tue Apr 17 17:43:25 2012
New Revision: 67965
URL: http://svn.opensuse.org/viewcvs/yast?rev=67965&view=rev
Log:
module for LXC (Linux Containers)
Added:
branches/SuSE-Code-11-SP2-Branch/lxc/
branches/SuSE-Code-11-SP2-Branch/lxc/MAINTAINER
branches/SuSE-Code-11-SP2-Branch/lxc/Makefile.cvs
branches/SuSE-Code-11-SP2-Branch/lxc/RPMNAME
branches/SuSE-Code-11-SP2-Branch/lxc/VERSION
branches/SuSE-Code-11-SP2-Branch/lxc/_cvsignore
branches/SuSE-Code-11-SP2-Branch/lxc/configure.in.in
branches/SuSE-Code-11-SP2-Branch/lxc/doc/
branches/SuSE-Code-11-SP2-Branch/lxc/doc/Makefile.am
branches/SuSE-Code-11-SP2-Branch/lxc/doc/_cvsignore
branches/SuSE-Code-11-SP2-Branch/lxc/doc/autodocs/
branches/SuSE-Code-11-SP2-Branch/lxc/doc/autodocs/Makefile.am
branches/SuSE-Code-11-SP2-Branch/lxc/doc/autodocs/_cvsignore
branches/SuSE-Code-11-SP2-Branch/lxc/package/
branches/SuSE-Code-11-SP2-Branch/lxc/package/_cvsignore
branches/SuSE-Code-11-SP2-Branch/lxc/package/yast2-lxc.changes
branches/SuSE-Code-11-SP2-Branch/lxc/src/
branches/SuSE-Code-11-SP2-Branch/lxc/src/Lxc.ycp (with props)
branches/SuSE-Code-11-SP2-Branch/lxc/src/Makefile.am
branches/SuSE-Code-11-SP2-Branch/lxc/src/_cvsignore
branches/SuSE-Code-11-SP2-Branch/lxc/src/dialogs.ycp (with props)
branches/SuSE-Code-11-SP2-Branch/lxc/src/lxc.desktop
branches/SuSE-Code-11-SP2-Branch/lxc/src/lxc.ycp (with props)
branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/
branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/Makefile.am
branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/_cvsignore
branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/tests/
branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/tests/Lxc.err
branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/tests/Lxc.out
branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/tests/Lxc.ycp (with props)
branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/tests/_cvsignore
branches/SuSE-Code-11-SP2-Branch/lxc/yast2-lxc.spec.in
Added: branches/SuSE-Code-11-SP2-Branch/lxc/MAINTAINER
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/MAINTAINER?rev=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/MAINTAINER (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/MAINTAINER Tue Apr 17 17:43:25 2012
@@ -0,0 +1 @@
+Jiri Suchomel
Added: branches/SuSE-Code-11-SP2-Branch/lxc/Makefile.cvs
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/Makefile.cvs?rev=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/Makefile.cvs (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/Makefile.cvs Tue Apr 17 17:43:25 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: branches/SuSE-Code-11-SP2-Branch/lxc/RPMNAME
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/RPMNAME?rev=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/RPMNAME (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/RPMNAME Tue Apr 17 17:43:25 2012
@@ -0,0 +1 @@
+yast2-lxc
Added: branches/SuSE-Code-11-SP2-Branch/lxc/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/VERSION?rev=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/VERSION (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/VERSION Tue Apr 17 17:43:25 2012
@@ -0,0 +1 @@
+2.17.0
Added: branches/SuSE-Code-11-SP2-Branch/lxc/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/_cvsignore?rev=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/_cvsignore (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/_cvsignore Tue Apr 17 17:43:25 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: branches/SuSE-Code-11-SP2-Branch/lxc/configure.in.in
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/configure.in.in?rev=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/configure.in.in (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/configure.in.in Tue Apr 17 17:43:25 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: branches/SuSE-Code-11-SP2-Branch/lxc/doc/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/doc/Makefile.am?rev=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/doc/Makefile.am (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/doc/Makefile.am Tue Apr 17 17:43:25 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: branches/SuSE-Code-11-SP2-Branch/lxc/doc/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/doc/_cvsignore?rev=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/doc/_cvsignore (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/doc/_cvsignore Tue Apr 17 17:43:25 2012
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Added: branches/SuSE-Code-11-SP2-Branch/lxc/doc/autodocs/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/doc/autodocs/Makefile.am?rev=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/doc/autodocs/Makefile.am (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/doc/autodocs/Makefile.am Tue Apr 17 17:43:25 2012
@@ -0,0 +1,3 @@
+# Makefile.am for lxc/doc/autodocs
+
+include $(top_srcdir)/autodocs-ycp.ami
Added: branches/SuSE-Code-11-SP2-Branch/lxc/doc/autodocs/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/doc/autodocs/_cvsignore?rev=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/doc/autodocs/_cvsignore (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/doc/autodocs/_cvsignore Tue Apr 17 17:43:25 2012
@@ -0,0 +1,3 @@
+Makefile
+Makefile.in
+*.html
Added: branches/SuSE-Code-11-SP2-Branch/lxc/package/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/package/_cvsignore?rev=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/package/_cvsignore (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/package/_cvsignore Tue Apr 17 17:43:25 2012
@@ -0,0 +1,2 @@
+*.spec
+*.bz2
Added: branches/SuSE-Code-11-SP2-Branch/lxc/package/yast2-lxc.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/package/yast2-lxc.changes?rev=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/package/yast2-lxc.changes (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/package/yast2-lxc.changes Tue Apr 17 17:43:25 2012
@@ -0,0 +1,4 @@
+-------------------------------------------------------------------
+Fri Apr 13 13:01:03 2012 - jsuchome@suse.cz
+
+- initial version
Added: 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=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/src/Lxc.ycp (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/src/Lxc.ycp Tue Apr 17 17:43:25 2012
@@ -0,0 +1,323 @@
+/* ------------------------------------------------------------------------------
+ * 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: 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 "Progress";
+import "Report";
+import "Summary";
+import "Message";
+
+/**
+ * Prototypes
+ */
+global boolean Modified();
+
+/**
+ * Data was modified?
+ */
+boolean modified = false;
+
+/**
+ */
+boolean proposal_valid = false;
+
+/**
+ * Write only, used during autoinstallation.
+ * Don't run services and SuSEconfig, it's all done at one place.
+ */
+boolean write_only = false;
+
+/**
+ * Abort function
+ * return boolean return true if abort
+ */
+boolean() AbortFunction = Modified;
+
+/**
+ * Abort function
+ * @return boolean return true if abort
+ */
+global define boolean Abort() ``{
+ if(AbortFunction != nil)
+ {
+ return AbortFunction () == true;
+ }
+ return false;
+}
+
+/**
+ * Data was modified?
+ * @return true if modified
+ */
+global boolean Modified() {
+ y2debug("modified=%1",modified);
+ return modified;
+}
+
+/**
+ * Mark as modified, for Autoyast.
+ */
+global void SetModified(boolean value) {
+ modified = true;
+ }
+
+global boolean ProposalValid() {
+ return proposal_valid;
+}
+
+global void SetProposalValid(boolean value) {
+ proposal_valid = value;
+}
+
+/**
+ * @return true if module is marked as "write only" (don't start services etc...)
+ */
+global boolean WriteOnly() {
+ return write_only;
+}
+
+/**
+ * Set write_only flag (for autoinstalation).
+ */
+global void SetWriteOnly(boolean value) {
+ write_only = value;
+}
+
+
+global void SetAbortFunction(boolean() function) {
+ AbortFunction = function;
+}
+
+
+// Settings: Define all variables needed for configuration of lxc
+// TODO FIXME: Define all the variables necessary to hold
+// TODO FIXME: the configuration here (with the appropriate
+// TODO FIXME: description)
+// TODO FIXME: For example:
+// /**
+// * List of the configured cards.
+// */
+// list cards = [];
+//
+// /**
+// * Some additional parameter needed for the configuration.
+// */
+// boolean additional_parameter = true;
+
+/**
+ * Read all lxc settings
+ * @return true on success
+ */
+global boolean Read() {
+
+ /* Lxc read dialog caption */
+ string caption = _("Initializing lxc Configuration");
+
+ // TODO FIXME Set the right number of stages
+ integer steps = 4;
+
+ integer sl = 500;
+ sleep(sl);
+
+ // TODO FIXME Names of real stages
+ // We do not set help text here, because it was set outside
+ Progress::New( caption, " ", steps, [
+ /* Progress stage 1/3 */
+ _("Read the database"),
+ /* Progress stage 2/3 */
+ _("Read the previous settings"),
+ /* Progress stage 3/3 */
+ _("Detect the devices")
+ ], [
+ /* Progress step 1/3 */
+ _("Reading the database..."),
+ /* Progress step 2/3 */
+ _("Reading the previous settings..."),
+ /* Progress step 3/3 */
+ _("Detecting the devices..."),
+ /* Progress finished */
+ _("Finished")
+ ],
+ ""
+ );
+
+ // read database
+ if(Abort()) return false;
+ Progress::NextStage();
+ /* Error message */
+ if(false) Report::Error(_("Cannot read database1."));
+ sleep(sl);
+
+ // read another database
+ if(Abort()) return false;
+ Progress::NextStep();
+ /* Error message */
+ if(false) Report::Error(_("Cannot read database2."));
+ sleep(sl);
+
+ // read current settings
+ if(Abort()) return false;
+ Progress::NextStage();
+ /* Error message */
+ if(false) Report::Error(Message::CannotReadCurrentSettings());
+ sleep(sl);
+
+ // detect devices
+ if(Abort()) return false;
+ Progress::NextStage();
+ /* Error message */
+ if(false) Report::Warning(_("Cannot detect devices."));
+ sleep(sl);
+
+ if(Abort()) return false;
+ /* Progress finished */
+ Progress::NextStage();
+ sleep(sl);
+
+ if(Abort()) return false;
+ modified = false;
+ return true;
+}
+
+/**
+ * Write all lxc settings
+ * @return true on success
+ */
+global boolean Write() {
+
+ /* Lxc read dialog caption */
+ string caption = _("Saving lxc Configuration");
+
+ // TODO FIXME And set the right number of stages
+ integer steps = 2;
+
+ integer sl = 500;
+ sleep(sl);
+
+ // TODO FIXME Names of real stages
+ // We do not set help text here, because it was set outside
+ Progress::New(caption, " ", steps, [
+ /* Progress stage 1/2 */
+ _("Write the settings"),
+ /* Progress stage 2/2 */
+ _("Run SuSEconfig")
+ ], [
+ /* Progress step 1/2 */
+ _("Writing the settings..."),
+ /* Progress step 2/2 */
+ _("Running SuSEconfig..."),
+ /* Progress finished */
+ _("Finished")
+ ],
+ ""
+ );
+
+ // write settings
+ if(Abort()) return false;
+ Progress::NextStage();
+ /* Error message */
+ if(false) Report::Error (_("Cannot write settings."));
+ sleep(sl);
+
+ // run SuSEconfig
+ if(Abort()) return false;
+ Progress::NextStage ();
+ /* Error message */
+ if(false) Report::Error (Message::SuSEConfigFailed());
+ sleep(sl);
+
+ if(Abort()) return false;
+ /* Progress finished */
+ Progress::NextStage();
+ sleep(sl);
+
+ if(Abort()) return false;
+ return true;
+}
+
+/**
+ * Get all lxc settings from the first parameter
+ * (For use by autoinstallation.)
+ * @param settings The YCP structure to be imported.
+ * @return boolean True on success
+ */
+global boolean Import (map settings) {
+ // TODO FIXME: your code here (fill the above mentioned variables)...
+ return true;
+}
+
+/**
+ * Dump the lxc settings to a single map
+ * (For use by autoinstallation.)
+ * @return map Dumped settings (later acceptable by Import ())
+ */
+global map Export () {
+ // TODO FIXME: your code here (return the above mentioned variables)...
+ return $[];
+}
+
+/**
+ * Create a textual summary and a list of unconfigured cards
+ * @return summary of the current configuration
+ */
+global list Summary() {
+ // TODO FIXME: your code here...
+ /* Configuration summary text for autoyast */
+ return [ _("Configuration summary..."), [] ];
+}
+
+/**
+ * Create an overview table with all configured cards
+ * @return table items
+ */
+global list Overview() {
+ // TODO FIXME: your code here...
+ return [];
+}
+
+/**
+ * Return packages needed to be installed and removed during
+ * Autoinstallation to insure module has all needed software
+ * installed.
+ * @return map with 2 lists.
+ */
+global map AutoPackages() {
+ // TODO FIXME: your code here...
+ return $[ "install":[], "remove":[] ];
+}
+
+/* EOF */
+}
Added: branches/SuSE-Code-11-SP2-Branch/lxc/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/src/Makefile.am?rev=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/src/Makefile.am (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/src/Makefile.am Tue Apr 17 17:43:25 2012
@@ -0,0 +1,24 @@
+# Makefile.am for lxc/src
+
+yncludedir = @yncludedir@/lxc
+
+client_DATA = \
+ lxc.ycp
+
+ynclude_DATA = \
+ 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: branches/SuSE-Code-11-SP2-Branch/lxc/src/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/src/_cvsignore?rev=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/src/_cvsignore (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/src/_cvsignore Tue Apr 17 17:43:25 2012
@@ -0,0 +1,4 @@
+Makefile
+Makefile.in
+*.ybc
+.dep
Added: branches/SuSE-Code-11-SP2-Branch/lxc/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/src/dialogs.ycp?rev=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/src/dialogs.ycp (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/src/dialogs.ycp Tue Apr 17 17:43:25 2012
@@ -0,0 +1,298 @@
+/* ------------------------------------------------------------------------------
+ * 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/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";
+
+
+list<term> read_templates () {
+
+ 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, splitstring (out["stdout"]:"", "\n"), {
+ if (line != "")
+ {
+ ret = add (ret, `item (line, line == "sles"));
+ }
+ });
+ }
+ return ret;
+}
+
+// encrypt given password using current method
+string crypt_password (string pw, string method) {
+
+ 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);
+}
+
+/**
+ * Configure1 dialog
+ * @return dialog result
+ */
+any LxcDialog () {
+
+ boolean orig = Progress::set (false);
+ Security::Read ();
+ Progress::set (orig);
+
+ map security = Security::Export ();
+ string method = tolower (security["PASSWD_ENCRYPTION"]:"des");
+
+ /* Lxc configure1 dialog caption */
+ string caption = _("LXC Configuration");
+
+ list<string> bridge_items = [ "br0", "br1" ];
+ list<term> template_items = read_templates ();
+
+ term contents = `HBox (`HSpacing (), `VBox (
+ `VSpacing (),
+ // text entry
+ `Left (`TextEntry (`id (`name), _("Container Name"))),
+ // combo box label
+ `Left (`ComboBox (`id (`template), `opt (`hstretch), _("Template"), template_items)),
+ `VSpacing (),
+ // frame label
+ `Frame (_("Network Settings"), `HBox (
+ `HSpacing (0.5), `VBox (
+ `VSpacing (0.5),
+ `HBox (
+ `TextEntry (`id (`ip), _("IP Address")),
+ `TextEntry (`id (`subnet), _("Subnet"), "/24")
+ ),
+ `Left (`ComboBox (`id (`bridge), _("Bridge"), bridge_items))
+ ),
+ `HSpacing (0.5)
+ )),
+ // frame label
+ `Frame (_("Password Settings"), `HBox (
+ `HSpacing (0.5),
+ // password entry
+ `HWeight (1, `Password (`id (`pw1), _("Root Password"))),
+ // password entry
+ `HWeight (1, `Password (`id (`pw2), _("Repeat Password"))),
+ `HSpacing (0.5)
+ )),
+ `VSpacing (2),
+ `ReplacePoint (`id (`rpbutton),
+ // button label
+ `PushButton (`id (`start), _("Create New Container"))
+ )
+ ), `HSpacing ());
+
+ string help_text = "";
+
+ Wizard::CreateDialog();
+ Wizard::SetContentsButtons(caption, contents, help_text,
+ Label::BackButton(), Label::CloseButton());
+ Wizard::HideBackButton ();
+ Wizard::HideAbortButton ();
+
+ UI::ChangeWidget (`id (`ip), `ValidChars, IP::ValidChars4);
+
+ any ret = nil;
+ while(true) {
+
+ ret = UI::UserInput();
+
+ if (ret == `abort || ret == `cancel || ret == `next || ret == `back) {
+ break;
+ }
+
+ string name = (string) UI::QueryWidget (`id (`name), `Value);
+ string ip = (string) UI::QueryWidget (`id (`ip), `Value);
+ string subnet = (string) UI::QueryWidget (`id (`subnet), `Value);
+ string bridge = (string) UI::QueryWidget (`id (`bridge), `Value);
+ string template = (string) UI::QueryWidget (`id (`template), `Value);
+ string pw1 = (string) UI::QueryWidget (`id (`pw1), `Value);
+ string pw2 = (string) UI::QueryWidget (`id (`pw2), `Value);
+
+ if (name == "")
+ {
+ // error popup
+ Report::Error (_("Name was not entered."));
+ UI::SetFocus (`id (`name));
+ continue;
+ }
+
+ if (ip != "" && !IP::Check (ip))
+ {
+ Report::Error (IP::Valid4 ());
+ UI::SetFocus (`id (`ip));
+ continue;
+ }
+ if (pw1 != pw2)
+ {
+ // error message
+ Report::Error (_("The passwords do not match."));
+ UI::SetFocus (`id (`pw1));
+ continue;
+ }
+
+ if (ret == `start)
+ {
+ // busy message
+ Popup::ShowFeedback ("", "Creating Configuration...");
+
+ // lxc-createconfig -n <name> [-i ] [-b <bridge>] [-t http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/src/lxc.desktop?rev=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/src/lxc.desktop (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/src/lxc.desktop Tue Apr 17 17:43:25 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: 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=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/src/lxc.ycp (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/src/lxc.ycp Tue Apr 17 17:43:25 2012
@@ -0,0 +1,77 @@
+/* ------------------------------------------------------------------------------
+ * 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: 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/dialogs.ycp";
+
+map cmdline_description = $[
+ "id" : "lxc",
+ /* Command line help text for the Xlxc module */
+ "help" : _("Configuration of LXC"),
+ "guihandler" : LxcDialog,
+ "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: branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/Makefile.am?rev=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/Makefile.am (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/Makefile.am Tue Apr 17 17:43:25 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: branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/_cvsignore?rev=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/_cvsignore (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/_cvsignore Tue Apr 17 17:43:25 2012
@@ -0,0 +1,11 @@
+Makefile
+Makefile.in
+site.exp
+*.sum
+*.log
+tmp.out*
+tmp.err*
+tmp.log*
+config
+run
+*.test
Added: branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/tests/Lxc.err
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/tests/Lxc.err?rev=67965&view=auto
==============================================================================
(empty)
Added: branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/tests/Lxc.out
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/tests/Lxc.out?rev=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/tests/Lxc.out (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/tests/Lxc.out Tue Apr 17 17:43:25 2012
@@ -0,0 +1,2 @@
+Dump Lxc::Modified
+Return false
Added: branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/tests/Lxc.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/tests/Lxc.ycp?rev=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/tests/Lxc.ycp (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/tests/Lxc.ycp Tue Apr 17 17:43:25 2012
@@ -0,0 +1,13 @@
+{
+
+// testedfiles: Lxc.ycp
+
+include "testsuite.ycp";
+TESTSUITE_INIT([], nil);
+
+import "Lxc";
+
+DUMP("Lxc::Modified");
+TEST(``(Lxc::Modified()), [], nil);
+
+}
Added: branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/tests/_cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/testsuite/tests/_cvsignore?rev=67965&view=auto
==============================================================================
(empty)
Added: branches/SuSE-Code-11-SP2-Branch/lxc/yast2-lxc.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/lxc/yast2-lxc.spec.in?rev=67965&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/lxc/yast2-lxc.spec.in (added)
+++ branches/SuSE-Code-11-SP2-Branch/lxc/yast2-lxc.spec.in Tue Apr 17 17:43:25 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
+
+BuildArchitectures: noarch
+
+Summary: Configuration of 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