euca-bundle-vol does not check rsync return code

Bug #523332 reported by Neil Soman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Eucalyptus
Fix Released
Medium
Neil Soman
euca2ools (Ubuntu)
Fix Released
Medium
Dustin Kirkland 

Bug Description

Patch from Tim Gerla.

=== modified file 'euca2ools/euca2ools/__init__.py'
--- euca2ools/euca2ools/__init__.py 2010-02-03 22:19:05 +0000
+++ euca2ools/euca2ools/__init__.py 2010-02-16 17:25:19 +0000
@@ -986,7 +986,9 @@
         print "Copying files..."
      for exclude in excludes:
   print "Excluding:", exclude
- output = Popen(rsync_cmd, stdout=PIPE, stderr=PIPE).communicate()
+
+ pipe = Popen(rsync_cmd, stdout=PIPE, stderr=PIPE)
+ output = pipe.communicate()
         for dir in self.img.ESSENTIAL_DIRS:
             dir_path = os.path.join(mount_point, dir)
             if not os.path.exists(dir_path):
@@ -1010,8 +1012,15 @@
           print 'Making essential directory %s' % mount_location
       os.makedirs(dir_path)
  mtab_file.close()
- if output[1]:
- raise CopyError
+ if pipe.returncode:
+ # rsync return code 23: Partial transfer due to error
+ # rsync return code 24: Partial transfer due to vanished source files
+ if pipe.returncode in (23, 24):
+ print "Warning: rsync reports files partially copied:"
+ print output
+ else:
+ print "Error: rsync failed with return code %d" % pipe.returncode
+ raise CopyError

     def unmount_image(self, mount_point):
         try:

Revision history for this message
Neil Soman (neilsoman) wrote :

Fixed in revno 253.

Changed in eucalyptus:
status: New → Fix Committed
assignee: nobody → Neil Soman (neilsoman)
importance: Undecided → Medium
Changed in euca2ools (Ubuntu):
status: New → In Progress
importance: Undecided → Low
importance: Low → Medium
assignee: nobody → Dustin Kirkland (kirkland)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package euca2ools - 1.2-0ubuntu5

---------------
euca2ools (1.2-0ubuntu5) lucid; urgency=low

  * Cherry pick fixes from upstream, up to bzr r265, fixes:
    - LP: #522398 - throw exceptions instead of sys.exit(1)
    - LP: #522396 - fix version string
    - LP: #523332 - check rsync return code
    - LP: #516738 - upstream fix for image store
    - LP: #525137 - don't sys.exit(1)
    - LP: #526697 - merge upstream fix for this one
    - LP: #531076 - fix euca-describe-instances against one instance
    - LP: #526591 - fix config file parsing
 -- Dustin Kirkland <email address hidden> Fri, 05 Mar 2010 16:59:25 -0600

Changed in euca2ools (Ubuntu):
status: In Progress → Fix Released
Changed in eucalyptus:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.