[pkg-eucalyptus-commits] [euca2ools] 36/41: Add a random ID to eustore image names
Charles Plessy
plessy at alioth.debian.org
Sat Oct 12 03:24:24 UTC 2013
This is an automated email from the git hooks/post-receive script.
plessy pushed a commit to branch master
in repository euca2ools.
commit aad208a5ddf70a78be79c69964698bac269973f6
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date: Tue Sep 24 15:20:40 2013 -0700
Add a random ID to eustore image names
This guards against multiple images with the same file name colliding
with each other.
Fixes TOOLS-387
---
euca2ools/commands/eustore/installimage.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/euca2ools/commands/eustore/installimage.py b/euca2ools/commands/eustore/installimage.py
index e7b9cec..328901e 100644
--- a/euca2ools/commands/eustore/installimage.py
+++ b/euca2ools/commands/eustore/installimage.py
@@ -38,6 +38,7 @@ from euca2ools.commands.walrus import Walrus
from euca2ools.util import mkdtemp_for_large_files
import hashlib
import os.path
+import random
from requestbuilder import Arg, MutuallyExclusiveArgList
from requestbuilder.auth import QuerySigV2Auth, S3RestAuth
import requestbuilder.commands.http
@@ -276,7 +277,8 @@ class InstallImage(EuStoreRequest, FileTransferProgressBarMixin):
def bundle_and_register_all(self, workdir, tarball_filename):
if self.args['show_progress']:
print 'Preparing to extract image...'
- image_name = 'eustore-{0}'.format(
+ image_name = 'eustore-{0:0>8x}-{1}'.format(
+ random.randrange(16**8),
os.path.splitext(os.path.basename(tarball_filename))[0]
.replace('.', '_'))
tarball = tarfile.open(tarball_filename, 'r:gz')
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-eucalyptus/euca2ools.git
More information about the pkg-eucalyptus-commits
mailing list