Revision c4e55622 snf-cyclades-app/synnefo/logic/management/commands/reconcile.py

b/snf-cyclades-app/synnefo/logic/management/commands/reconcile.py
35 35

  
36 36
"""
37 37
import sys
38
import datetime
38 39

  
39 40
from optparse import make_option
40 41

  
......
144 145
                "Simulating successful Ganeti removal for %d " \
145 146
                "servers in the DB:" % len(stale)
146 147
            for vm in VirtualMachine.objects.filter(pk__in=stale):
147
                backend.process_op_status(vm=vm, jobid=-0,
148
                event_time = datetime.datetime.now()
149
                backend.process_op_status(vm=vm, etime=event_time, jobid=-0,
148 150
                    opcode='OP_INSTANCE_REMOVE', status='success',
149 151
                    logmsg='Reconciliation: simulated Ganeti event')
150 152
            print >> sys.stderr, "    ...done"
......
166 168
                vm = VirtualMachine.objects.get(pk=id)
167 169
                opcode = "OP_INSTANCE_REBOOT" if ganeti_up \
168 170
                         else "OP_INSTANCE_SHUTDOWN"
169
                backend.process_op_status(vm=vm, jobid=-0,
171
                event_time = datetime.datetime.now()
172
                backend.process_op_status(vm=vm, etime=event_time ,jobid=-0,
170 173
                    opcode=opcode, status='success',
171 174
                    logmsg='Reconciliation: simulated Ganeti event')
172 175
            print >> sys.stderr, "    ...done"

Also available in: Unified diff