[Title] fix client initializeing error
authorjiil.hyoun <jiil.hyoun@samsung.com>
Fri, 4 Jan 2013 06:24:37 +0000 (15:24 +0900)
committerjiil.hyoun <jiil.hyoun@samsung.com>
Fri, 4 Jan 2013 06:24:37 +0000 (15:24 +0900)
[Type] Bugfix
[Module] Toolchain /
[Priority] Minor
[Jira#]
[Redmine#] 7954
[Problem]
[Cause]
[Solution]
[TestCase]

Change-Id: I725c88ed008d3282bb2f31cd2754626fdaa34bce

src/pkg_server/client.rb

index 2039d25a04bd60be82d8e93f902890997322c1ea..f1407f55f73e5dce027a986e687848ab36d92a6f 100644 (file)
@@ -69,6 +69,13 @@ class Client
        # @location = client location (download and install file to this location)
        def initialize(server_addr, location, logger)
 
+               # set log
+               if logger.nil? or logger.class.to_s.eql? "String" then
+                       @log = DummyLog.new()
+               else
+                       @log = logger
+               end
+
                # create directory
                if not File.exist? CONFIG_PATH then FileUtils.mkdir_p "#{CONFIG_PATH}" end
 
@@ -107,13 +114,6 @@ class Client
                if not File.exist? @snapshots_path then FileUtils.mkdir_p "#{@snapshots_path}" end
                if not File.exist? @tmp_path then FileUtils.mkdir_p "#{@tmp_path}" end
 
-               # set log
-               if logger.nil? or logger.class.to_s.eql? "String" then
-                       @log = DummyLog.new()
-               else
-                       @log = logger
-               end
-
                # read installed pkg list, and create hash
                if not File.exist? @location then FileUtils.mkdir_p "#{@location}" end
                @log.info "Update local package list.. [#{@location}]"
@@ -518,7 +518,8 @@ class Client
                server = @server_addr
                if server.nil? or server.empty? then
                        @log.error "Server addr is nil"
-                       return nil
+                       @log.error "check sync_pkg_servers table pkgsvr_url column is null"
+                       return "nil"
                end
 
                server = server.delete ".:/@"