[Title] Fixed a bug that download log does not work
authordonghee yang <donghee.yang@samsung.com>
Tue, 9 Oct 2012 01:04:21 +0000 (10:04 +0900)
committerdonghee yang <donghee.yang@samsung.com>
Tue, 9 Oct 2012 01:04:21 +0000 (10:04 +0900)
src/common/execute_with_log.rb
src/pkg_server/downloader.rb

index 799069702cc2634083535364150e4aa78392f1b7..f98a8fc15ec5b6b4d15002359424f5cfa58e393d 100755 (executable)
@@ -36,7 +36,11 @@ cmd = ARGV[0]
 log_path = ARGV[1]
 
 # create logger
-log = Logger.new(log_path)
+if log_path.nil? or log_path.empty? then
+       log = Logger.new(STDOUT)
+else
+       log = Logger.new(log_path)
+end
 
 # generate command
 cmd = Utils.generate_shell_command(cmd, nil)
index 982fde0ff5a0ebea055d5fe14c867ec8c77eab00..a01bd248cd236d59ba1f2c7a51e89cda2b2546bf 100644 (file)
@@ -45,7 +45,7 @@ class FileDownLoader
 
                logger.info "Downloading #{url}"
         if is_remote then
-            pid,status = Utils.execute_shell_with_log( "wget #{url} -O #{fullpath} -nv", logger )
+            pid,status = Utils.execute_shell_with_log( "wget #{url} -O #{fullpath} -nv", logger.path )
                        ret = status.exitstatus != 0 ? false : true
             #ret = Utils.execute_shell( "wget #{url} -O #{fullpath} -q")
         else