in case you lose your builder backups

Change-Id: Ica555be2be492c3ec5fdeab738058ff35989a603
workaround probetest race from early response

Change-Id: I594633887c86fc2212850409a37ee2257633a23c
test: improve db_replicator coverage

This patch adds a test for ReplicatorRpc.complete_rsync()
and complete extract_device() coverage.

test_extract_device:
  test the case the parameter is invalid

test_complete_rsync_with_bad_input:
  ensure the use of invalid parameters return a 404 erro

test_complete_rsync:
  validate the returned code in case of success

Change-Id: I59e0d26a1efe59d8beff1e81c2a7edc6de0872e9
Protect against hash cleanup errors on PUTs

In http://launchpad.net/bugs/1254405 an exception occurs when
finalizing the PUT of an object, but it is obscured by the thread pool
code, so we don't see the actual line where it originated. However,
there are two possible functions where this exception could originate:

    1. renamer()
    2. hash_cleanup_listdir()

If this is an error in renamer(), there is some other waky problem
where the temporary file has been removed. It is likely that this is a
problem where a file name from os.listdir ends up disappearing (but
even this is a rare occurence). Regardless, it is not clear that we
really want an error from hash_cleanup_listdir() from affecting the
return result of the PUT.

To that end, we squelsh OSErrors from hash_cleanup_listdir() for
now. One might argue for all errors, but since os.unlink() and
os.listdir() raise OSError today, that is probably sufficient.

Even that we use "Closes-Bug" below, it is not clear it can even be
determined that this closes that bug report.

Change-Id: I2f55df835c387e4d17cffda74c04c9994aebbe1f
Closes-Bug: 1254405
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Remove unnecessary "is not None" check

From a review comment on https://review.openstack.org/30051 remove
the "is not None" check, as the assignment in the try block will
never assign None as value as the int() built-in will not return it.

There was some concern of long-term maintenance of the DiskFile
class's _quarantine method raising exceptions. If that routine were
ever mistakenly changed to NOT raise an exception, subtle problems
could creep into the code (see https://review.openstack.org/53237).
We address this concern by raising an exception explicitly at the
call sites of DiskFile._quarantine().

Change-Id: I1729a2d77a6b72b4494b24a8838b47ad5272c075
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Add a unit test to verify proxy logging fields

Also bring unit test coverage to 100% (well, at least every line is
reported as "covered").

Change-Id: I659d0c02008368897b1307a7a5c9aaba73b80588
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Merge "Add a unit test to verify proxy logging fields"
Merge "test: improve db_replicator coverage"
Merge "Remove unnecessary "is not None" check"
Merge "workaround probetest race from early response"
Merge "in case you lose your builder backups"
Merge "Protect against hash cleanup errors on PUTs"