Author: locilka
Date: Tue Apr 15 11:49:06 2008
New Revision: 46653
URL: http://svn.opensuse.org/viewcvs/yast?rev=46653&view=rev
Log:
AutoYaST enabled .... now
Modified:
trunk/sshd/src/Sshd.ycp
trunk/sshd/src/sshd_auto.ycp
Modified: trunk/sshd/src/Sshd.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/sshd/src/Sshd.ycp?rev=46653&r1=46652&r2=46653&view=diff
==============================================================================
--- trunk/sshd/src/Sshd.ycp (original)
+++ trunk/sshd/src/Sshd.ycp Tue Apr 15 11:49:06 2008
@@ -147,6 +147,34 @@
}
/**
+ * Exports the current configuration.
+ *
+ * @return map of a current configuration
+ *
+ * @struct $[
+ * "config" : (map ) SETTINGS,
+ * "status" : (boolean) service_status,
+ * ]
+ */
+global map Export () {
+ return $[
+ "config" : SETTINGS,
+ "status" : sshd_is_running,
+ ];
+}
+
+/**
+ * Imports a configuration
+ */
+global boolean Import (map import_map) {
+ SETTINGS = (map ) import_map["config"]:$[];
+ sshd_is_running = (import_map["status"]:false == true);
+ SetModified();
+ y2milestone ("Configuration has been imported");
+ return true;
+}
+
+/**
* Restarts the sshd when the daemon was running when starting the configuration
*/
boolean WriteSSHDService () {
Modified: trunk/sshd/src/sshd_auto.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/sshd/src/sshd_auto.ycp?rev=46653&r1=46652&r2=46653&view=diff
==============================================================================
--- trunk/sshd/src/sshd_auto.ycp (original)
+++ trunk/sshd/src/sshd_auto.ycp Tue Apr 15 11:49:06 2008
@@ -15,6 +15,8 @@
textdomain "sshd";
+import "Progress";
+
/* The main () */
y2milestone ("----------------------------------------");
y2milestone ("sshd_auto module started");
@@ -42,10 +44,15 @@
break;
// reset the current configuration to the default one
- case "Reset" : break;
+ case "Reset" :
+ boolean orig = Progress::set (false);
+ ret = Sshd::Read();
+ Progress::set (orig);
+ break;
// define map of lists of packages
- case "Packages" : break;
+ // case "Packages" :
+ // break;
// call the AutoYaST sequence here
case "Change" :
@@ -55,22 +62,38 @@
break;
// import the configuration here
- case "Import" : break;
+ case "Import" :
+ ret = Sshd::Import ((map) param);
+ break;
// read the current configuration from system
- case "Read" : break;
+ case "Read" :
+ boolean orig1 = Progress::set (false);
+ ret = Sshd::Read();
+ Progress::set (orig1);
+ break;
// export the current configuration from memory
- case "Export" : break;
+ case "Export" :
+ ret = Sshd::Export();
+ break;
// return the modified flag
- case "GetModified" : break;
+ case "GetModified" :
+ ret = Sshd::GetModified();
+ break;
// set the modified flag
- case "SetModified" : break;
+ case "SetModified" :
+ Sshd::SetModified();
+ break;
// write the confuguration to the system
- case "Write" : break;
+ case "Write" :
+ boolean orig2 = Progress::set (false);
+ ret = Sshd::Write();
+ Progress::set (orig2);
+ break;
y2error("Unknown function: %1, Params %2", func, param);
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org