Mailinglist Archive: yast-commit (2080 mails)

< Previous Next >
[yast-commit] <rest-service> network : add exception if file missing or is corrupted and use it in basesystem
  • From: Josef Reidinger <jreidinger@xxxxxxx>
  • Date: Thu, 10 Sep 2009 10:26:49 +0200
  • Message-id: <E1Mm10s-0002P4-J0@xxxxxxxxxxxxxxxx>
ref: refs/heads/network
commit 3e13bced7f737de59a88b425e2c055adc132c152
Author: Josef Reidinger <jreidinger@xxxxxxx>
Date: Thu Sep 10 10:26:49 2009 +0200

add exception if file missing or is corrupted and use it in basesystem
---
plugins/basesystem/app/models/basesystem.rb | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/plugins/basesystem/app/models/basesystem.rb
b/plugins/basesystem/app/models/basesystem.rb
index f89a078..d3b0c58 100644
--- a/plugins/basesystem/app/models/basesystem.rb
+++ b/plugins/basesystem/app/models/basesystem.rb
@@ -2,6 +2,7 @@
# Provides access to basic system settings module queue. Provides and updates
# if base system settings is already done.
require "yast/config_file"
+require "exceptions"
class Basesystem

# steps needed by base system
@@ -25,7 +26,11 @@ class Basesystem
def Basesystem.find
base = Basesystem.new
base.finish = File.exist?(FINISH_FILE)
- base.steps = YaST::ConfigFile.new(BASESYSTEM_CONF)["steps"] || []
+ begin
+ base.steps = YaST::ConfigFile.new(BASESYSTEM_CONF)["steps"] || []
+ rescue Exception => e
+ raise CorruptedFileException.new(File.join
YaST::ConfigFile.config_default_location, "#{BASESYSTEM_CONF.to_s}.yml")
+ end
return base
end

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages