Mailinglist Archive: yast-devel (26 mails)

< Previous Next >
[yast-devel] Re: [yast-commit] r67965 - in /branches/SuSE-Code-11-SP2-Branch/lxc: ./ doc/ doc/autodocs/ package/ src/ testsuite/ testsuite/tests/
Nice to see module for such interesting technology like containers, just few
notes. First is if we should not start immediatelly in git with such module?


On Tue, 17 Apr 2012 15:43:26 -0000
jsuchome@xxxxxxxxxxxxxxxxx wrote:

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:
+/**
+ * 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);

Is sleeps really needed? And if so please document it, it looks extremely magic
for me why we need it ( especially before we start reading anything). Same
apply for write. If we need it for cache writing or UI redraw, please document
it.

+
+ // 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;
+}
+
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

cvsingore??? does we really need it???


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.

^^^
year here

+/**
+ * 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" ];

Does we really support only two bridges? and if so why? document please


+ if (out["exit"]:0 != 0)
+ {
+ // error message
+ Report::Error (sformat (_("Error occured during
configuration:
+
+%1"), out["stdout"]:""));

Why is there stdout and not stderr? And can be message more descriptive like
"lxconfig failed with this output:"
So it is clear, that problem is not on our side ( of course if we not pass
something wrongly )


Josef
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: yast-devel+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups