initialize action plan api array

This commit is contained in:
Radu Ioan Fericean
2015-12-02 19:25:51 +02:00
parent a01cad9039
commit b45581968a
2 changed files with 2 additions and 2 deletions

View File

@@ -1624,7 +1624,7 @@ func TestApierLocalGetScheduledActions(t *testing.T) {
}
var rply []*ScheduledActions
if err := rater.Call("ApierV1.GetScheduledActions", AttrsGetScheduledActions{}, &rply); err != nil {
t.Error("Unexpected error: ", err.Error())
t.Error("Unexpected error: ", err)
}
}

View File

@@ -113,7 +113,7 @@ func (self *ApierV1) GetScheduledActions(attrs AttrsGetScheduledActions, reply *
if self.Sched == nil {
return errors.New("SCHEDULER_NOT_ENABLED")
}
var schedActions []*ScheduledActions
schedActions := make([]*ScheduledActions, 0) // needs to be initialized if remains empty
scheduledActions := self.Sched.GetQueue()
for _, qActions := range scheduledActions {
sas := &ScheduledActions{ActionsId: qActions.ActionsId, ActionPlanId: qActions.Id, ActionPlanUuid: qActions.Uuid}