Author: remi
Date: 2009-09-11 16:50:10 +0200 (Fri, 11 Sep 2009)
New Revision: 5362

Modified:
   
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/03_resourceUgcServer.py
Log:
* Fixed bug with ugc task insertions

Modified: 
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/03_resourceUgcServer.py
===================================================================
--- 
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/03_resourceUgcServer.py
        2009-09-11 13:11:01 UTC (rev 5361)
+++ 
software_suite_v3/smart-core/smart-server/trunk/resources/03_content_servers/03_resourceUgcServer.py
        2009-09-11 14:50:10 UTC (rev 5362)
@@ -300,26 +300,28 @@
                 [delay['hour'], delay['minute'], delay['second']],
                 data)
             ugcTask.setTaskId1(taskId)
-            if ugc.getCommand(parentTask.getCommand()).isDaemon() and \
-               parentTask.getType() == "DAILY AT":
-                command = "resourceUgcServer.stopUgc"
-                arguments = (ugc.getDescription().getUuid(),)
-                data = {
-                    'commandType' : 'ugc_stop',
-                    'uuid' : ugc.getDescription().getUuid(),
-                }
-                taskId, taskName = resourceScheduler.createTask(
-                    command,
-                    arguments,
-                    parentTask.getType(),
-                    ugcTask.getName(),
-                    ugcTask.getWeekMask(),
-                    [date['year'], date['month'], date['day']],
-                    [hoursEnd['hour'], hoursEnd['minute'], hoursEnd['second']],
-                    [hoursEnd['hour'], hoursEnd['minute'], hoursEnd['second']],
-                    [delay['hour'], delay['minute'], delay['second']],
-                    data)
-                ugcTask.setTaskId2(taskId)
+            parentCommand = ugc.getCommand(parentTask.getCommand())
+            if parentCommand != None:
+                if parentCommand.isDaemon() and \
+                   parentTask.getType() == "DAILY AT":
+                    command = "resourceUgcServer.stopUgc"
+                    arguments = (ugc.getDescription().getUuid(),)
+                    data = {
+                        'commandType' : 'ugc_stop',
+                        'uuid' : ugc.getDescription().getUuid(),
+                    }
+                    taskId, taskName = resourceScheduler.createTask(
+                        command,
+                        arguments,
+                        parentTask.getType(),
+                        ugcTask.getName(),
+                        ugcTask.getWeekMask(),
+                        [date['year'], date['month'], date['day']],
+                        [hoursEnd['hour'], hoursEnd['minute'], 
hoursEnd['second']],
+                        [hoursEnd['hour'], hoursEnd['minute'], 
hoursEnd['second']],
+                        [delay['hour'], delay['minute'], delay['second']],
+                        data)
+                    ugcTask.setTaskId2(taskId)
 
     def deleteAlertsFromScheduler(self, ugc):
         """Delete activated ugc alerts from the scheduler.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to