DIBS: Fixed os_info value init process 88/15788/1
authorjonghwan2.park <jonghwan2.park@samsung.com>
Tue, 28 Jan 2014 09:50:58 +0000 (18:50 +0900)
committerjonghwan2.park <jonghwan2.park@samsung.com>
Tue, 28 Jan 2014 09:50:58 +0000 (18:50 +0900)
Change-Id: Ie084f513cd939d89c73e2bbf811fa521ec8e076c
Signed-off-by: jonghwan2.park <jonghwan2.park@samsung.com>
src/pkg_server/client.rb

index b3bf4dc51fef9b423a088211fdf4bbccda9330fe..0993b99924dbaa933ac93634872bf80340100ba3 100644 (file)
@@ -255,6 +255,9 @@ class Client
                 return false
             end
 
+            # clean
+            clean_list()
+
             if !exists_snapshot then
                 uniq_name = Utils.create_uniq_name
                 tmp_dir = File.join(@config_dist_path, uniq_name)
@@ -263,16 +266,22 @@ class Client
                     @log.error "\"#{@server_addr}\" does not have supported os list file properly."
                     Utils.execute_shell("rm -rf #{tmp_dir}")
                     return false
+                else
+                    read_supported_os_list(tmp_dir)
                 end
 
                 if not download_pkg_list(@is_server_remote, tmp_dir) then
                     @log.error "\"#{@server_addr}\" does not have package list file properly."
                     Utils.execute_shell("rm -rf #{tmp_dir}")
                     return false
+                else
+                    read_remote_pkg_list(tmp_dir)
                 end
 
                 if not download_archive_pkg_list(@is_server_remote, tmp_dir) then
                     @log.error "\"#{@server_addr}\" does not have archive package list file properly. This error can be ignored"
+                else
+                    read_archive_pkg_list(tmp_dir)
                 end
 
                 Utils.execute_shell("mv #{tmp_dir} #{list_path}")
@@ -282,14 +291,13 @@ class Client
                 # tmp_dir should be removed  whether mv command is failed
                 Utils.execute_shell("rm -rf #{tmp_dir}")
                 remove_snapshots()
+            else
+                # load os/package infos
+                read_supported_os_list(list_path)
+                read_remote_pkg_list(list_path)
+                read_archive_pkg_list(list_path)
             end
 
-            # load os/package infos
-            clean_list()
-            read_supported_os_list(list_path)
-            read_remote_pkg_list(list_path)
-            read_archive_pkg_list(list_path)
-
         ensure
             Utils.file_unlock(lock) if not lock.nil?
         end