Mailinglist Archive: yast-commit (265 mails)
| < Previous | Next > |
[yast-commit] r67113 - in /trunk/restore: VERSION package/yast2-restore.changes src/Restore.ycp
- From: locilka@xxxxxxxxxxxxxxxxx
- Date: Thu, 05 Jan 2012 14:25:10 -0000
- Message-id: <20120105142511.845B532522@svn2.opensuse.org>
Author: locilka
Date: Thu Jan 5 15:25:10 2012
New Revision: 67113
URL: http://svn.opensuse.org/viewcvs/yast?rev=67113&view=rev
Log:
- Checking, installing and/or adjusting rpcbind or portmap (as
fallback) before mounting an NFS share (bnc #682064).
- 2.22.0
Modified:
trunk/restore/VERSION
trunk/restore/package/yast2-restore.changes
trunk/restore/src/Restore.ycp
Modified: trunk/restore/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/restore/VERSION?rev=67113&r1=67112&r2=67113&view=diff
==============================================================================
--- trunk/restore/VERSION (original)
+++ trunk/restore/VERSION Thu Jan 5 15:25:10 2012
@@ -1 +1 @@
-2.21.2
+2.22.0
Modified: trunk/restore/package/yast2-restore.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/restore/package/yast2-restore.changes?rev=67113&r1=67112&r2=67113&view=diff
==============================================================================
--- trunk/restore/package/yast2-restore.changes (original)
+++ trunk/restore/package/yast2-restore.changes Thu Jan 5 15:25:10 2012
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Thu Jan 5 15:10:33 CET 2012 - locilka@xxxxxxx
+
+- Checking, installing and/or adjusting rpcbind or portmap (as
+ fallback) before mounting an NFS share (bnc #682064).
+- 2.22.0
+
+-------------------------------------------------------------------
Wed Dec 7 10:04:58 UTC 2011 - coolo@xxxxxxxx
- fix license to be in spdx.org format
Modified: trunk/restore/src/Restore.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/restore/src/Restore.ycp?rev=67113&r1=67112&r2=67113&view=diff
==============================================================================
--- trunk/restore/src/Restore.ycp (original)
+++ trunk/restore/src/Restore.ycp Thu Jan 5 15:25:10 2012
@@ -499,6 +499,50 @@
}
/**
+ * Checks whether the portmapper service is installed and started.
+ * Installs and/or starts the service otherwise.
+ */
+
+ boolean CheckAndPrepareNFS (map parsed_url) {
+ boolean ret = false;
+
+ // both new and old services are supported (portmap got replaced by
rpcbind)
+ // names of packages and service names match
+ foreach (string portmapper, ["rpcbind", "portmap"], {
+ // checking if rpcbind is installed
+ integer package_installed = (integer) SCR::Execute (.target.bash,
sformat("/bin/rpm -q %1", portmapper));
+ y2milestone("%1 is instaled: %2", portmapper, package_installed);
+
+ if (package_installed != 0) {
+ y2milestone ("%1 package is not installed", portmapper);
+ boolean installed = Package::DoInstall ([portmapper]);
+ y2milestone ("Package %1 installed: %2", portmapper, installed);
+
+ // try next service
+ if (installed != true) return;
+ }
+
+ // checking if portmapper is running
+ integer portmapper_status = Service::Status (portmapper);
+ y2milestone ("portmap status: %1", portmapper_status);
+
+ // portmapper is running
+ if (portmapper_status == 0) {
+ ret = true;
+ } else {
+ // start portmapper
+ boolean started = Service::Start (portmapper);
+ y2milestone ("%1 start result: %2", portmapper, started);
+ ret = started;
+ }
+
+ if (ret == true) break;
+ });
+
+ return ret;
+ }
+
+ /**
* Mount input source
* @param input File in URl-like syntax
* @return map Map $[ "success" : boolean (true on success), "mpoint" :
string (mount point), "file" : string (file name on the local system) ];
@@ -522,44 +566,19 @@
map parsed_url = URL::Parse(input);
string scheme = parsed_url["scheme"]:"file";
- if (scheme == "nfs")
- {
- string nfs_server = parsed_url["host"]:"";
- //substring(tail, 0, pos);
- string nfs_file = parsed_url["path"]:"";
- //substring(tail, pos + delimiter_correction);
-
- // check if portmapper is installed
- integer result = (integer) SCR::Execute(.target.bash, "/bin/rpm -q
portmap");
- y2milestone("check result: rpm: %1", result);
-
- if (result != 0)
- {
- y2milestone("portmapper package is not installed");
- Package::DoInstall(["portmap"]);
+ if (scheme == "nfs") {
+ if (CheckAndPrepareNFS (parsed_url)) {
+ y2milestone ("NFS-related services adjusted");
+ } else {
+ y2error ("Cannot adjust NFS-related services");
}
- // check if portmapper is running
- integer portmapper_status = Service::Status("portmap");
- y2milestone("portmap status: %1", portmapper_status);
+ y2milestone("NFS source - server: %1 file: %2",
parsed_url["host"]:"", parsed_url["path"]:"");
+ map mountresult = mountNFS(parsed_url["host"]:"",
parsed_url["path"]:"");
- if (portmapper_status != 0)
- {
- // start portmapper
- boolean started = Service::Start("portmap");
- y2milestone("portmap start result: %1", started);
- }
-
- y2milestone("NFS source - server: %1 file: %2", nfs_server,
nfs_file);
-
- map mountresult = mountNFS(nfs_server, nfs_file);
-
- if (mountresult["mounted"]:false == false)
- {
+ if (mountresult["mounted"]:false == false) {
y2error("Cannot read source '%1' - NFS mount failed", input);
- }
- else
- {
+ } else {
mpoint = mountresult["mountpoint"]:"";
file = mpoint + "/" + mountresult["file"]:"";
success = true;
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
Date: Thu Jan 5 15:25:10 2012
New Revision: 67113
URL: http://svn.opensuse.org/viewcvs/yast?rev=67113&view=rev
Log:
- Checking, installing and/or adjusting rpcbind or portmap (as
fallback) before mounting an NFS share (bnc #682064).
- 2.22.0
Modified:
trunk/restore/VERSION
trunk/restore/package/yast2-restore.changes
trunk/restore/src/Restore.ycp
Modified: trunk/restore/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/restore/VERSION?rev=67113&r1=67112&r2=67113&view=diff
==============================================================================
--- trunk/restore/VERSION (original)
+++ trunk/restore/VERSION Thu Jan 5 15:25:10 2012
@@ -1 +1 @@
-2.21.2
+2.22.0
Modified: trunk/restore/package/yast2-restore.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/restore/package/yast2-restore.changes?rev=67113&r1=67112&r2=67113&view=diff
==============================================================================
--- trunk/restore/package/yast2-restore.changes (original)
+++ trunk/restore/package/yast2-restore.changes Thu Jan 5 15:25:10 2012
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Thu Jan 5 15:10:33 CET 2012 - locilka@xxxxxxx
+
+- Checking, installing and/or adjusting rpcbind or portmap (as
+ fallback) before mounting an NFS share (bnc #682064).
+- 2.22.0
+
+-------------------------------------------------------------------
Wed Dec 7 10:04:58 UTC 2011 - coolo@xxxxxxxx
- fix license to be in spdx.org format
Modified: trunk/restore/src/Restore.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/restore/src/Restore.ycp?rev=67113&r1=67112&r2=67113&view=diff
==============================================================================
--- trunk/restore/src/Restore.ycp (original)
+++ trunk/restore/src/Restore.ycp Thu Jan 5 15:25:10 2012
@@ -499,6 +499,50 @@
}
/**
+ * Checks whether the portmapper service is installed and started.
+ * Installs and/or starts the service otherwise.
+ */
+
+ boolean CheckAndPrepareNFS (map parsed_url) {
+ boolean ret = false;
+
+ // both new and old services are supported (portmap got replaced by
rpcbind)
+ // names of packages and service names match
+ foreach (string portmapper, ["rpcbind", "portmap"], {
+ // checking if rpcbind is installed
+ integer package_installed = (integer) SCR::Execute (.target.bash,
sformat("/bin/rpm -q %1", portmapper));
+ y2milestone("%1 is instaled: %2", portmapper, package_installed);
+
+ if (package_installed != 0) {
+ y2milestone ("%1 package is not installed", portmapper);
+ boolean installed = Package::DoInstall ([portmapper]);
+ y2milestone ("Package %1 installed: %2", portmapper, installed);
+
+ // try next service
+ if (installed != true) return;
+ }
+
+ // checking if portmapper is running
+ integer portmapper_status = Service::Status (portmapper);
+ y2milestone ("portmap status: %1", portmapper_status);
+
+ // portmapper is running
+ if (portmapper_status == 0) {
+ ret = true;
+ } else {
+ // start portmapper
+ boolean started = Service::Start (portmapper);
+ y2milestone ("%1 start result: %2", portmapper, started);
+ ret = started;
+ }
+
+ if (ret == true) break;
+ });
+
+ return ret;
+ }
+
+ /**
* Mount input source
* @param input File in URl-like syntax
* @return map Map $[ "success" : boolean (true on success), "mpoint" :
string (mount point), "file" : string (file name on the local system) ];
@@ -522,44 +566,19 @@
map parsed_url = URL::Parse(input);
string scheme = parsed_url["scheme"]:"file";
- if (scheme == "nfs")
- {
- string nfs_server = parsed_url["host"]:"";
- //substring(tail, 0, pos);
- string nfs_file = parsed_url["path"]:"";
- //substring(tail, pos + delimiter_correction);
-
- // check if portmapper is installed
- integer result = (integer) SCR::Execute(.target.bash, "/bin/rpm -q
portmap");
- y2milestone("check result: rpm: %1", result);
-
- if (result != 0)
- {
- y2milestone("portmapper package is not installed");
- Package::DoInstall(["portmap"]);
+ if (scheme == "nfs") {
+ if (CheckAndPrepareNFS (parsed_url)) {
+ y2milestone ("NFS-related services adjusted");
+ } else {
+ y2error ("Cannot adjust NFS-related services");
}
- // check if portmapper is running
- integer portmapper_status = Service::Status("portmap");
- y2milestone("portmap status: %1", portmapper_status);
+ y2milestone("NFS source - server: %1 file: %2",
parsed_url["host"]:"", parsed_url["path"]:"");
+ map mountresult = mountNFS(parsed_url["host"]:"",
parsed_url["path"]:"");
- if (portmapper_status != 0)
- {
- // start portmapper
- boolean started = Service::Start("portmap");
- y2milestone("portmap start result: %1", started);
- }
-
- y2milestone("NFS source - server: %1 file: %2", nfs_server,
nfs_file);
-
- map mountresult = mountNFS(nfs_server, nfs_file);
-
- if (mountresult["mounted"]:false == false)
- {
+ if (mountresult["mounted"]:false == false) {
y2error("Cannot read source '%1' - NFS mount failed", input);
- }
- else
- {
+ } else {
mpoint = mountresult["mountpoint"]:"";
file = mpoint + "/" + mountresult["file"]:"";
success = true;
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
| < Previous | Next > |