CA-148382: Make sure the auto-cert-kit script doesn't get deactivated on upgrade

Unfortunatly, due to the way RPM scriplets get executed, the chkconfig --del
auto-cert-kit command was being executed on upgrade after running the new
packages install scripts. This stopped re-running after reboot from working.

This patch should address that issue and make sure we only remove the chkconfig
entry when the RPM is actually being removed (in which case the next RPM to be
installed will setup the chkconfig entry correctly).

Signed-off-by: Rob Dobson <rob.dobson@citrix.com>
Merge pull request #77 from rdobson/ca-148382-chkconfig

CA-148382: Make sure the auto-cert-kit script doesn't get deactivated on upgrade
CA-147967: Don't convert the reboot flag's timestamp to GMT.

Keep the local time of the reboot flag in order to compare with the crashdump time handed back by XAPI. We might even want to think writing the timestamp out-to-file
to ensure that the local time doesn't become out of sync with XAPI's time. This should however not be the case. Also added some unittests for reading/writing flags.

Swapping to use time.strptime instead of datetime.strptime due it's
non-existence in python 2.4 (as pointed out by Jun).

Signed-off-by: Rob Dobson <rob.dobson@citrix.com>
Reviewed-by: Jun Wook Kwak <junwook.kwak@citrix.com>
Fixing unittest code to make use of pythons mkdtemp function and ensure the created directory is removed as part of tear down.

Signed-off-by: Rob Dobson <rob.dobson@citrix.com>
Merge pull request #78 from rdobson/ca-147967

CA-147967: Don't convert the reboot flag's timestamp to GMT.
Moved pre-cleanup to before running test suite
Small changes for stability.