[pkg-eucalyptus-commits] [SCM] managing cloud instances for Eucalyptus branch, master, updated. 3.0.0-alpha3-257-g1da8e3a
Garrett Holmstrom
gholms at fedoraproject.org
Sun Jun 16 02:31:26 UTC 2013
The following commit has been merged in the master branch:
commit f719d4951e90e4a19a6b78b93bf4818e0cfa9c2a
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date: Tue May 14 14:53:08 2013 -0700
Be consistent in how warnings are shown
diff --git a/euca2ools/commands/bundle/bundlevol.py b/euca2ools/commands/bundle/bundlevol.py
index 89b395d..f60abde 100644
--- a/euca2ools/commands/bundle/bundlevol.py
+++ b/euca2ools/commands/bundle/bundlevol.py
@@ -147,11 +147,12 @@ class BundleVol(BundleCreator):
print sys.stderr, msg
self.log.warn(msg)
except ServerError:
- print >> sys.stderr, 'Unable to read instance metadata.'
- print >> sys.stderr, 'Pass the --no-inherit option if you wish to', \
- 'exclude instance metadata.'
+ msg = ('Unable to read instance metadata. Use --no-inherit if '
+ 'you want to proceed without the metadata service.')
+ print >> sys.stderr, msg
+ self.log.warn(msg)
raise
-
+
def _filter_args_for_bundle_image(self):
"""Make a complete copy of args to pass along to BundleImage. We first
need to remove any arguments that BundleImage would not know about.
diff --git a/euca2ools/commands/bundle/imagecreator.py b/euca2ools/commands/bundle/imagecreator.py
index 2df85da..0a9a64d 100644
--- a/euca2ools/commands/bundle/imagecreator.py
+++ b/euca2ools/commands/bundle/imagecreator.py
@@ -271,9 +271,10 @@ class VolumeSync(object):
# rsync return code 24: Partial transfer due to missing source files
#
if err.returncode in (23, 24):
+ msg = 'rsync reports files partially copied'
if self.log:
- self.log.warn('rsync reports files partially copied.')
- print sys.stderr, "Warning: rsync reports files partially copied."
+ self.log.warn(msg)
+ print >> sys.stderr, 'warning:', msg
else:
raise
@@ -336,13 +337,13 @@ class ImageCreator(object):
if not (os.path.exists(self.destination) or \
os.path.isdir(self.destination)):
raise ValueError("'{0}' is not a directory or does not exist."
- .format(self.destination))
+ .format(self.destination))
def run(self):
"""
Prepare a disk image
"""
- sys.stderr.write("Creating image...")
+ print >> sys.stderr, "Creating image...",
self._create_raw_diskimage()
self._populate_filesystem_info()
self._make_filesystem(**self.fs)
@@ -352,7 +353,7 @@ class ImageCreator(object):
# as a loop device. If for any reason a failure occurs
# the device will automatically be unmounted and cleaned up.
#
- sys.stderr.write("Syncing volume contents...")
+ print >> sys.stderr, "Syncing volume contents...",
with VolumeSync(self.volume, self.image, log=self.log) as volsync:
if self.fstab:
volsync.install_fstab_from_file(self.fstab)
--
managing cloud instances for Eucalyptus
More information about the pkg-eucalyptus-commits
mailing list