Skip to content

Commit

Permalink
Obsolete Service.Status replaced with Service.active?
Browse files Browse the repository at this point in the history
- added better checking
  • Loading branch information
kobliha committed May 5, 2014
1 parent acc25ea commit 83c5b1d
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/modules/Nfs.rb
Expand Up @@ -34,6 +34,7 @@ def main
Yast.import "PackageSystem"
Yast.import "PackagesProposal"
Yast.import "Wizard"
Yast.import "Message"

Yast.include self, "nfs/routines.rb"

Expand Down Expand Up @@ -519,15 +520,17 @@ def Write

Progress.NextStage
if Ops.greater_than(Builtins.size(@nfs_entries), 0)
if Service.Status(@portmapper) != 0
# portmap must not be started if it is running already (see bug # 9999)
Service.Start(@portmapper)
# portmap must not be started if it is running already (see bug # 9999)
Service.Start(@portmapper) unless Service.active?(@portmapper)

unless Service.active?(@portmapper)
Report.Error(Message.CannotStartService(@portmapper))
return false
end

Service.Start("nfs")
# #74597: if all mounts are noauto, $? is 6 (unconfigured)
status = Service.Status("nfs")
if status != 0 && status != 6

unless Service.active?("nfs")
# error popup message
Report.Error(_("Unable to mount the NFS entries from /etc/fstab."))
return false
Expand Down Expand Up @@ -614,8 +617,8 @@ def Mount(server, share, mpoint, options, type)


# start portmapper if it isn't running
if Service.Status(portmapper) != 0
if Service.Start(portmapper) == false
unless Service.active?(portmapper)
unless Service.Start(portmapper)
Builtins.y2warning("%1 cannot be started", portmapper)
return nil
end
Expand Down

0 comments on commit 83c5b1d

Please sign in to comment.