diff mbox

[Branch,~linaro-image-tools/linaro-image-tools/trunk] Rev 446: Changing the timestamp on the hwpack to use utc time than the local time and fixing the tempdir c...

Message ID 20111012182110.7062.69653.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Deepti B. Kalakeri Oct. 12, 2011, 6:21 p.m. UTC
Merge authors:
  Deepti B. Kalakeri (deeptik)
Related merge proposals:
  https://code.launchpad.net/~deeptik/linaro-image-tools/fix-hwpack-timestamp/+merge/79161
  proposed by: Deepti B. Kalakeri (deeptik)
  review: Approve - James Westby (james-w)
------------------------------------------------------------
revno: 446 [merge]
committer: Deepti B. Kalakeri<deepti.kalakeri@linaro.org>
branch nick: linaro-image-tools
timestamp: Wed 2011-10-12 18:16:48 +0000
message:
  Changing the timestamp on the hwpack to use utc time than the local time and fixing the tempdir cleanup
modified:
  linaro-hwpack-replace


--
lp:linaro-image-tools
https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk

You are subscribed to branch lp:linaro-image-tools.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'linaro-hwpack-replace'
--- linaro-hwpack-replace	2011-10-12 07:34:51 +0000
+++ linaro-hwpack-replace	2011-10-12 17:49:06 +0000
@@ -78,7 +78,7 @@ 
 
 
 def get_hwpack_name(old_hwpack):
-    timestamp = [datetime.datetime.now().strftime("%Y%m%d-%H%M")]
+    timestamp = [datetime.datetime.utcnow().strftime("%Y%m%d-%H%M")]
     hwpack_name_parts = (old_hwpack.split('_', 3))
     return('_'.join(hwpack_name_parts[:2] + timestamp + hwpack_name_parts[3:]))
 
@@ -172,6 +172,7 @@ 
     new_deb_file_to_copy = args.deb_pack
     prefix_pkg_remove = args.prefix_pkg_remove
     status = 0
+    tempdir = ""
 
     try:
         # Get the new hardware pack name
@@ -227,7 +228,8 @@ 
         status = 1
 
     finally:
-        shutil.rmtree(tempdir)
+        if os.path.exists(tempdir):
+            shutil.rmtree(tempdir)
 
     if status == 0:
         logger.info("The debian package '%s' has been been included in '%s'",