]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tests: ceph_objectstore_tool.py fix off by 1 ATTR_OBJS handling
authorDavid Zafman <dzafman@redhat.com>
Sat, 15 Nov 2014 19:44:54 +0000 (11:44 -0800)
committerDavid Zafman <dzafman@redhat.com>
Tue, 3 Mar 2015 18:44:18 +0000 (10:44 -0800)
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit eaf1d1e35243566c46b478788e79e0ebf7583015)

src/test/ceph_objectstore_tool.py

index 97e50e7dd23069e649628b8e8fa4697230cf6e51..028ce09a42c43b08f18c4884144fe54222bcbc49 100755 (executable)
@@ -292,7 +292,7 @@ def main(argv):
 
             db[nspace][NAME] = {}
 
-            if i < ATTR_OBJS:
+            if i < ATTR_OBJS + 1:
                 keys = range(i)
             else:
                 keys = range(0)
@@ -311,7 +311,7 @@ def main(argv):
                 db[nspace][NAME]["xattr"][mykey] = myval
 
             # Create omap header in all objects but REPobject1
-            if i < ATTR_OBJS and i != 1:
+            if i < ATTR_OBJS + 1 and i != 1:
                 myhdr = "hdr{i}".format(i=i)
                 cmd = "./rados -p {pool} -N '{nspace}' setomapheader {name} {hdr}".format(pool=REP_POOL, name=NAME, hdr=myhdr, nspace=nspace)
                 logging.debug(cmd)
@@ -370,7 +370,7 @@ def main(argv):
             db[nspace][NAME] = {}
 
             db[nspace][NAME]["xattr"] = {}
-            if i < ATTR_OBJS:
+            if i < ATTR_OBJS + 1:
                 keys = range(i)
             else:
                 keys = range(0)