Skip to content

Instantly share code, notes, and snippets.

@clayg
Created April 16, 2015 00:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clayg/3a79b6066065a1ba80c2 to your computer and use it in GitHub Desktop.
Save clayg/3a79b6066065a1ba80c2 to your computer and use it in GitHub Desktop.
diff --git a/swift/obj/reconstructor.py b/swift/obj/reconstructor.py
index 0ee2afb..8134a48 100644
--- a/swift/obj/reconstructor.py
+++ b/swift/obj/reconstructor.py
@@ -260,14 +260,9 @@ class ObjectReconstructor(Daemon):
rebuilt_fragment_iter)
def _reconstruct(self, policy, fragment_payload, frag_index):
- # XXX with jerasure this doesn't work if we need to rebuild a
- # parity fragment, and not all data fragments are available
- # segment = policy.pyeclib_driver.reconstruct(
- # fragment_payload, [frag_index])[0]
-
- # for safety until pyeclib 1.0.7 we'll just use decode and encode
- segment = policy.pyeclib_driver.decode(fragment_payload)
- return policy.pyeclib_driver.encode(segment)[frag_index]
+ segment = policy.pyeclib_driver.reconstruct(
+ fragment_payload, [frag_index])[0]
+ return segment
def make_rebuilt_fragment_iter(self, responses, path, policy, frag_index):
"""
@peluse
Copy link

peluse commented Apr 16, 2015

+2 heh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment