)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"a66592785487c99cad46fda15a045e8aacab39fd","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Let swift-object-info print information about files"},{"line_number":8,"context_line":"in given directory, if directory is provided instead"},{"line_number":9,"context_line":"of data file together with --recursive option."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"If .meta file is present, use it to print updated"},{"line_number":12,"context_line":"metadata information of the data file."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"ba3cc151_48e8e1e2","line":10,"updated":"2015-06-30 03:23:15.000000000","message":"The make this change appear in gerrit more useful it is recommended to have the first line a shorter max of 50 characters, this is so listed changes are easy to read through, see:\n\n  https://wiki.openstack.org/wiki/GitCommitMessages#Summary_of_GIT_commit_message_structure\n\nSo it could be something like:\n\n  Let object-info find files in a given directory\n  \n  \u003ccurrent commit message\u003e","commit_id":"9f7fa9ddffe7937b6684ec11dca8dee60870fa5b"}],"bin/swift-object-info":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"a66592785487c99cad46fda15a045e8aacab39fd","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    parser.add_option("},{"line_number":36,"context_line":"        \u0027-r\u0027, \u0027--recursive\u0027, default\u003dFalse,"},{"line_number":37,"context_line":"        action\u003d\"store_true\", dest\u003d\u0027recursive\u0027,"},{"line_number":38,"context_line":"        help\u003d\"Accept directory as an argument for OBJECT_FILE\")"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    options, args \u003d parser.parse_args()"},{"line_number":41,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":8,"id":"ba3cc151_48a461a5","line":38,"updated":"2015-06-30 03:23:15.000000000","message":"See my comment in info.py.... but seeing as we aren\u0027t really recursively looking, having a recursive option is a bit misleading. If I saw a --recursive flag, I\u0027d suspect I could put in any folder and it would walk the tree finding and reporting on each datafile/meta it found.","commit_id":"9f7fa9ddffe7937b6684ec11dca8dee60870fa5b"}],"swift/cli/info.py":[{"author":{"_account_id":2696,"name":"Darrell Bishop","email":"dbishop@nvidia.com","username":"darrellb"},"change_message_id":"0f003034da166a3a3612a1421ff9b474f08af1f9","unresolved":false,"context_lines":[{"line_number":417,"context_line":"                                                swift_dir)"},{"line_number":418,"context_line":"                datadir \u003d get_data_dir(policy_index_for_name)"},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"    with open(datafile, \u0027rb\u0027) as fp:"},{"line_number":421,"context_line":""},{"line_number":422,"context_line":"        try:"},{"line_number":423,"context_line":"            datafile_metadata \u003d read_metadata(fp)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1af86dd1_adee45ea","line":420,"updated":"2015-06-12 16:15:56.000000000","message":"If you give a bogus directory, you get an bad error message from this line:\n\n vagrant@saio:~$ swift-object-info /srv/node1/sdb5/objects-2/32/68c -r\n Traceback (most recent call last):\n   File \"/usr/local/bin/swift-object-info\", line 10, in \u003cmodule\u003e\n     execfile(__file__)\n   File \"/vagrant/swift/bin/swift-object-info\", line 46, in \u003cmodule\u003e\n     print_obj(*args, **vars(options))\n   File \"/vagrant/swift/swift/cli/info.py\", line 420, in print_obj\n     with open(datafile, \u0027rb\u0027) as fp:\n TypeError: coercing to Unicode: need string or buffer, NoneType found","commit_id":"bcb4de26ea33c9a2b10ec0136149174179c6a79f"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"a66592785487c99cad46fda15a045e8aacab39fd","unresolved":false,"context_lines":[{"line_number":371,"context_line":"            if f.endswith(\u0027.meta\u0027):"},{"line_number":372,"context_line":"                metadatafile \u003d os.path.join(datafile, f)"},{"line_number":373,"context_line":"            if f.endswith(\u0027.data\u0027):"},{"line_number":374,"context_line":"                new_datafile \u003d os.path.join(datafile, f)"},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"        if new_datafile is None:"},{"line_number":377,"context_line":"            datafile \u003d metadatafile"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba3cc151_68c28587","line":374,"updated":"2015-06-30 03:23:15.000000000","message":"Because we are using os.listdir, we are not really being recursive are we? If I saw a recursive option, I imagine I could put in a lower directory path and it would recursively find all data/meta files and return me information on all.\n\nAnd if were not being recursive, why don\u0027t we just check to see if the datafile is a directory, and if it is look for data/meta?","commit_id":"9f7fa9ddffe7937b6684ec11dca8dee60870fa5b"},{"author":{"_account_id":12974,"name":"Ben Martin","email":"blmartin@us.ibm.com","username":"blmartin"},"change_message_id":"2ac702a3ce091e7fde165f05b139f8004e42a39e","unresolved":false,"context_lines":[{"line_number":344,"context_line":"    \"\"\""},{"line_number":345,"context_line":"    Display information about an object read from the datafile."},{"line_number":346,"context_line":"    Optionally verify the datafile content matches the ETag metadata."},{"line_number":347,"context_line":""},{"line_number":348,"context_line":"    :param datafile: path on disk to object file"},{"line_number":349,"context_line":"    :param check_etag: boolean, will read datafile content and verify"},{"line_number":350,"context_line":"                       computed checksum matches value stored in"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba3cc151_11750197","line":347,"updated":"2015-06-30 19:04:29.000000000","message":"Documentation needs update\nsomething like \u0027... to object file or containing directory\u0027","commit_id":"eb47acf26ea3d31419017bebec07eff70fc6e7c5"},{"author":{"_account_id":13340,"name":"Konstantin Baikov","email":"konstantin.baikov@gmail.com","username":"kbaikov"},"change_message_id":"a9991da028fbd6a849cf708ba0c34a245b3bdcfb","unresolved":false,"context_lines":[{"line_number":371,"context_line":"            if f.endswith(\u0027.meta\u0027):"},{"line_number":372,"context_line":"                metadatafile \u003d os.path.join(datafile, f)"},{"line_number":373,"context_line":"            if f.endswith(\u0027.data\u0027):"},{"line_number":374,"context_line":"                new_datafile \u003d os.path.join(datafile, f)"},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"        if new_datafile:"},{"line_number":377,"context_line":"            datafile \u003d new_datafile"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba15a1d1_65f598c9","line":374,"updated":"2015-09-22 13:48:57.000000000","message":"This code will not handle multiple .meta files situation.\nIMHO only the last one will be picked up.\nPlease also see similar situation here: https://github.com/openstack/swift/blob/master/swift/obj/diskfile.py#L490","commit_id":"4a24c8ff25b16f9bb8773211ea2866515b3ab09b"},{"author":{"_account_id":9963,"name":"Jiri Suchomel","email":"jiri.suchomel@suse.com","username":"jsuchome"},"change_message_id":"999714b5d1e1feeca2418bdef5f61a767a4156f2","unresolved":false,"context_lines":[{"line_number":371,"context_line":"            if f.endswith(\u0027.meta\u0027):"},{"line_number":372,"context_line":"                metadatafile \u003d os.path.join(datafile, f)"},{"line_number":373,"context_line":"            if f.endswith(\u0027.data\u0027):"},{"line_number":374,"context_line":"                new_datafile \u003d os.path.join(datafile, f)"},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"        if new_datafile:"},{"line_number":377,"context_line":"            datafile \u003d new_datafile"}],"source_content_type":"text/x-python","patch_set":16,"id":"3a29b11f_99669bb9","line":374,"in_reply_to":"ba15a1d1_65f598c9","updated":"2015-10-22 19:02:30.000000000","message":"If I understand that code in diskfile.py correctly, it\u0027s actually right thing to take the last meta file. But we must ensure it is the last one, hence the reverse sort function in that location. Will adapt it this way in next commit.","commit_id":"4a24c8ff25b16f9bb8773211ea2866515b3ab09b"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"97e63df53f112f3a9bfca5c062aa72519e211668","unresolved":false,"context_lines":[{"line_number":371,"context_line":"            if f.endswith(\u0027.meta\u0027) and not metadatafile:"},{"line_number":372,"context_line":"                metadatafile \u003d os.path.join(datafile, f)"},{"line_number":373,"context_line":"            if f.endswith(\u0027.data\u0027):"},{"line_number":374,"context_line":"                new_datafile \u003d os.path.join(datafile, f)"},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"        if new_datafile:"},{"line_number":377,"context_line":"            datafile \u003d new_datafile"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa69d971_6450d80b","line":374,"updated":"2016-01-06 14:14:04.000000000","message":"This for-loop starts from new and continue to process to older ones. If we have 2 .data (or .meta) files in the directory (I know it happens not so frequently but we have a chance to do so likely at the time of data overwritten), this patch look at the older one even though newer file exists there.\n\n\nI tested this like as follows:\n\nPrepare 2 files:\n /objects/209/f1b/d1e39b4e30201af3fb2ff333a9f72f1b/1449054818.19281.data \n /objects/209/f1b/d1e39b4e30201af3fb2ff333a9f72f1b/1449054810.19281.data \n\nDo swift-object-info\n\n swift-object-info /objects/209/f1b/d1e39b4e30201af3fb2ff333a9f72f1b\n\nIt shows the info about\n\n /objects/209/f1b/d1e39b4e30201af3fb2ff333a9f72f1b/1449054810.19281.data\n\nThat is a stale object.\n\nCircle back to bug report description on launchpad, Alistair seems to suggest to open Swift\u0027s DiskFile instance to gather the files information. If we could do so, it seems to help us to make this easier. (It might have more task swift-object-info handle the policy to select suitable diskfile class tho)\n\nNot sure if you like my suggestion to use diskfile so you don\u0027t have to address it but at least we should make this to reference newest .meta .data files, IMHO.","commit_id":"1e4af5fe45f75ae8dad8c25498bd46086d6ac1a5"},{"author":{"_account_id":9963,"name":"Jiri Suchomel","email":"jiri.suchomel@suse.com","username":"jsuchome"},"change_message_id":"dd6eeff1ceab8e56207c92a23c53c669cddd67f8","unresolved":false,"context_lines":[{"line_number":371,"context_line":"            if f.endswith(\u0027.meta\u0027) and not metadatafile:"},{"line_number":372,"context_line":"                metadatafile \u003d os.path.join(datafile, f)"},{"line_number":373,"context_line":"            if f.endswith(\u0027.data\u0027):"},{"line_number":374,"context_line":"                new_datafile \u003d os.path.join(datafile, f)"},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"        if new_datafile:"},{"line_number":377,"context_line":"            datafile \u003d new_datafile"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa69d971_7f3705ff","line":374,"in_reply_to":"fa69d971_6450d80b","updated":"2016-01-06 14:40:14.000000000","message":"Have you tested it with the latest code? My impression was that with reverse\u003dTrue option, I\u0027m actually going from the oldest to the newest meta files, just like in diskfile.py. \n\nThan I should reach the correct one at the end.","commit_id":"1e4af5fe45f75ae8dad8c25498bd46086d6ac1a5"},{"author":{"_account_id":4608,"name":"Kota Tsuyuzaki","email":"bloodeagle40234@gmail.com","username":"tsuyuzaki-kota"},"change_message_id":"389fbf21dff60f68e9f3b49fe505f75c5ed9b154","unresolved":false,"context_lines":[{"line_number":371,"context_line":"            if f.endswith(\u0027.meta\u0027) and not metadatafile:"},{"line_number":372,"context_line":"                metadatafile \u003d os.path.join(datafile, f)"},{"line_number":373,"context_line":"            if f.endswith(\u0027.data\u0027):"},{"line_number":374,"context_line":"                new_datafile \u003d os.path.join(datafile, f)"},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"        if new_datafile:"},{"line_number":377,"context_line":"            datafile \u003d new_datafile"}],"source_content_type":"text/x-python","patch_set":17,"id":"fa69d971_b35595fa","line":374,"in_reply_to":"fa69d971_7f3705ff","updated":"2016-01-07 06:15:42.000000000","message":"Absolutely with this code, otherwise we don\u0027t do \"swift-object-info \u003cdir\u003e\".\n\nI made sure the sort method order with [1]. Obviously sort(reverse\u003dTrue) will order them newest-\u003eoldest.\n\nThe reason you could get the newest *meta* file is:\n\n if f.endswith(\u0027.meta\u0027) and not metadatafile:\n\nThis code keeps the first metafile even if swift is searching from newest to oldest but *data* file doesn\u0027t.\n\nMoreover i found another issue for this, if we have older .data or .meta than .ts, this code will show the older info than .ts file.\n\nCould you double check the behavior by yourself?\n\n1: http://paste.openstack.org/show/483202/","commit_id":"1e4af5fe45f75ae8dad8c25498bd46086d6ac1a5"}]}
