)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"dbaf567ed1404505f5b492751ca4f9ef17437ca5","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Yuan Zhou \u003cyuan.zhou@intel.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-12-18 15:09:09 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add swift-ec-info tool"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: Ief288e46ef974d9c5e60ce45d8ef68c9ad34d061"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3a961159_46a74850","line":7,"updated":"2014-12-22 04:14:19.000000000","message":"Alot more detail is required here.\n\nThe first line (what you have is ok) but there needs to be a blank like and then a description of the change. In this case, seeing as you are adding a new script, it would need to be what the script is, what it\u0027s used for, etc.\n\n  Add swift-ec-info tool to bin/\n\n  \u003cdescription of tool, what it does, what it\u0027s used for, example usage, etc\u003e\n\nThis is important for not only reviewers who want to know what you are adding but more importantly so we have a complete git log in the repository.\n\nFurther, a DocImpact flag should be set, as this will require documentation changes.\n\nFor notes on commit message style see: https://wiki.openstack.org/wiki/GitCommitMessages#Summary_of_Git_commit_message_structure","commit_id":"7f72edf72d61aa0db1dc47d35f61dbd46edb55aa"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"d587be64ed1c23550b75eae693714ec1cc71300c","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Yuan Zhou \u003cyuan.zhou@intel.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-12-18 15:09:09 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add swift-ec-info tool"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: Ief288e46ef974d9c5e60ce45d8ef68c9ad34d061"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"9a80dd14_6a98e01b","line":7,"in_reply_to":"3a961159_46a74850","updated":"2015-03-12 04:31:16.000000000","message":"+1","commit_id":"7f72edf72d61aa0db1dc47d35f61dbd46edb55aa"}],"bin/swift-ec-info":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"dbaf567ed1404505f5b492751ca4f9ef17437ca5","unresolved":false,"context_lines":[{"line_number":13,"context_line":"# implied."},{"line_number":14,"context_line":"# See the License for the specific language governing permissions and"},{"line_number":15,"context_line":"# limitations under the License."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"import argparse"},{"line_number":19,"context_line":"import sys"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"3a961159_46f9084d","line":16,"updated":"2014-12-22 04:14:19.000000000","message":"A doc string explaining what this script is used for, what is does would be useful. Other scripts haven\u0027t done it, but is useful, I think for Ops and reviews like me :)\n\nYou can hit 2 birds with one stone and just use the explanation from the commit message (once you have written one).","commit_id":"7f72edf72d61aa0db1dc47d35f61dbd46edb55aa"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"dbaf567ed1404505f5b492751ca4f9ef17437ca5","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"parser \u003d argparse.ArgumentParser()"},{"line_number":27,"context_line":"parser.add_argument(\u0027-P\u0027, \u0027--policy\u0027, help\u003d\"the name of the policy\")"},{"line_number":28,"context_line":"parser.add_argument(\u0027file\u0027, help\u003d\"name of object to examine\")"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"def main():"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"3a961159_a6cd4c33","line":28,"updated":"2014-12-22 04:14:19.000000000","message":"You are setting help test, but never actually displaying the help or usage in the code. A --help or -h would be useful so users will know how to use the file.","commit_id":"7f72edf72d61aa0db1dc47d35f61dbd46edb55aa"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"d587be64ed1c23550b75eae693714ec1cc71300c","unresolved":false,"context_lines":[{"line_number":41,"context_line":"            ec_policy \u003d policy"},{"line_number":42,"context_line":"            break"},{"line_number":43,"context_line":"    else:"},{"line_number":44,"context_line":"        return \u0027ERROR: unable to find EC policy\u0027"},{"line_number":45,"context_line":"    if not os.path.isfile(args.file):"},{"line_number":46,"context_line":"        return \u0027ERROR: unable to find the object\u0027"},{"line_number":47,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":1,"id":"9a80dd14_de342ae1","line":44,"updated":"2015-03-12 04:31:16.000000000","message":"Does this include \"some EC policies ware found but they didn\u0027t match the specified policy name\"?\n\nTo be helpful, we should handle the different situation (EC policy not found or EC policy exists but not match), IMHO.","commit_id":"7f72edf72d61aa0db1dc47d35f61dbd46edb55aa"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"d587be64ed1c23550b75eae693714ec1cc71300c","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    file_path \u003d os.path.abspath(args.file)"},{"line_number":49,"context_line":"    if ec_policy and (not get_data_dir(ec_policy.idx) in file_path):"},{"line_number":50,"context_line":"        return \u0027ERROR: object is not stored with this policy\u0027"},{"line_number":51,"context_line":"    df_metadata \u003d read_metadata(args.file)"},{"line_number":52,"context_line":"    segment_size \u003d int(df_metadata[\u0027X-Object-Sysmeta-Ec-Segment-Size\u0027])"},{"line_number":53,"context_line":"    with open(args.file) as fragment:"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"9a80dd14_beda16e7","line":50,"updated":"2015-03-12 04:31:16.000000000","message":"If there is miss configuration at ec setting in conf, this script seems to raise the Invalid Storage Policy Configuration, immediately. However, the ec_policy is used for just checking the place to store. So..it would be better to suppress it (or warn) to fail unfortunately.","commit_id":"7f72edf72d61aa0db1dc47d35f61dbd46edb55aa"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"d587be64ed1c23550b75eae693714ec1cc71300c","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    segment_size \u003d int(df_metadata[\u0027X-Object-Sysmeta-Ec-Segment-Size\u0027])"},{"line_number":53,"context_line":"    with open(args.file) as fragment:"},{"line_number":54,"context_line":"        segment \u003d fragment.read(segment_size)"},{"line_number":55,"context_line":"        raw_metadata \u003d policy.pyeclib_driver.get_metadata(segment)"},{"line_number":56,"context_line":"    metadata \u003d struct.unpack(\u00275I\u0027, raw_metadata)"},{"line_number":57,"context_line":"    print \u0027Encoding Fragment Archive Index: %d\u0027 % metadata[1]"},{"line_number":58,"context_line":"    if metadata[1] !\u003d int(df_metadata[\u0027X-Object-Sysmeta-Ec-Archive-Index\u0027]):"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"9a80dd14_fe92cef4","line":55,"updated":"2015-03-12 04:31:16.000000000","message":"I wonder if you could use get_metadata(segment, formatted\u003d1) after PyECLib version dumped. (Perhaps current requirement version already might support the argument) It should return a dictionary of the fragment_metadata and we could show them directly :)","commit_id":"7f72edf72d61aa0db1dc47d35f61dbd46edb55aa"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"dbaf567ed1404505f5b492751ca4f9ef17437ca5","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    return 0"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"if __name__ \u003d\u003d \"__main__\":"},{"line_number":69,"context_line":"    sys.exit(main())"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"3a961159_e6d3d4d2","line":69,"updated":"2014-12-22 04:14:19.000000000","message":"You are using the return of main as the parameter to sys.exit. This should return an int (0 on success and \u003e 0 on error). When there is an error, printing it out and then returning a \u003e0 integer would be expected by swift operators.","commit_id":"7f72edf72d61aa0db1dc47d35f61dbd46edb55aa"}]}
