)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"a8e849c7f458695f7a4adc6b1cb85f1988799fde","unresolved":false,"context_lines":[{"line_number":10,"context_line":"a method/function signature), adopt the convention of using the"},{"line_number":11,"context_line":"policy instance (instead of just the policy_index)."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This puts the earnest on the caller to make the decision if it can"},{"line_number":14,"context_line":"safely assume the legacy policy was intended."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":" * added StoragePolicyCollection.legacy property to name the legacy Policy-0"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9a80dd14_661abd18","line":13,"updated":"2015-03-12 17:12:27.000000000","message":"typo s/earnest/onus/","commit_id":"4db8360874f865087ab500afa6521e68684bcef9"}],"swift/cli/info.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"a8e849c7f458695f7a4adc6b1cb85f1988799fde","unresolved":false,"context_lines":[{"line_number":341,"context_line":"    datadir \u003d DATADIR_BASE"},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"    # try to extract policy index from datafile disk path"},{"line_number":344,"context_line":"    policy \u003d extract_policy(datafile)"},{"line_number":345,"context_line":"    if policy:"},{"line_number":346,"context_line":"        policy_index \u003d int(policy)"},{"line_number":347,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a80dd14_a92c864b","line":344,"updated":"2015-03-12 17:12:27.000000000","message":"nit:\n\n  policy_index  \u003d int(extract_policy(datafile) or POLICIES.legacy)\n\nbut also see comment in diskfile.py line 184","commit_id":"4db8360874f865087ab500afa6521e68684bcef9"}],"swift/common/request_helpers.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"a8e849c7f458695f7a4adc6b1cb85f1988799fde","unresolved":false,"context_lines":[{"line_number":85,"context_line":"    \"\"\""},{"line_number":86,"context_line":"    Utility function to split and validate the request path and storage"},{"line_number":87,"context_line":"    policy.  The storage policy is extracted from the headers of the"},{"line_number":88,"context_line":"    request and converted to an integer, and then the args are passed"},{"line_number":89,"context_line":"    through to :meth:`split_and_validate_path`."},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    :returns: a list, result of :meth:`split_and_validate_path` with"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a80dd14_2925f6c1","line":88,"updated":"2015-03-12 17:12:27.000000000","message":"the policy isn\u0027t converted to an int anymore, how about:\n\n  The storage policy index is extracted from the headers of the request and\n  converted to a StoragePolicy instance.","commit_id":"4db8360874f865087ab500afa6521e68684bcef9"}],"swift/common/storage_policy.py":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"1ae213fb1b7e688c13e551e5ac5a7a9206675994","unresolved":false,"context_lines":[{"line_number":16,"context_line":"import textwrap"},{"line_number":17,"context_line":"import string"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from os.path import splitext"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from swift.common.utils import config_true_value, SWIFT_CONF_FILE"},{"line_number":22,"context_line":"from swift.common.ring import Ring"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_f94828ce","line":19,"updated":"2015-03-12 06:19:51.000000000","message":"Why are we importing splitext, it isn\u0027t being used.\n\nUPDATE: According the Jenkins there are a bunch of imports not being used.. assume this is rebasing related.","commit_id":"2140bdfb30b4a55bc6b3615da05a443d3be9ce39"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"1ae213fb1b7e688c13e551e5ac5a7a9206675994","unresolved":false,"context_lines":[{"line_number":619,"context_line":"            try:"},{"line_number":620,"context_line":"                index \u003d int(index)"},{"line_number":621,"context_line":"            except ValueError:"},{"line_number":622,"context_line":"                return None"},{"line_number":623,"context_line":"        return self.by_index.get(index)"},{"line_number":624,"context_line":""},{"line_number":625,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_796d1804","line":622,"updated":"2015-03-12 06:19:51.000000000","message":"This looks kinda meh, can\u0027t we:\n\n  try:\n      index \u003d 0 if not index else int(index)\n  except ValueError:\n      return None\n\nOr for the glass half full people:\n\n  try:\n      index \u003d int(index) if index else 0\n  except ValueError:\n      return None","commit_id":"2140bdfb30b4a55bc6b3615da05a443d3be9ce39"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"a8e849c7f458695f7a4adc6b1cb85f1988799fde","unresolved":false,"context_lines":[{"line_number":69,"context_line":"    if isinstance(policy_or_index, StoragePolicy):"},{"line_number":70,"context_line":"        policy \u003d policy_or_index"},{"line_number":71,"context_line":"    else:"},{"line_number":72,"context_line":"        policy \u003d POLICIES.get_by_index(policy_or_index)"},{"line_number":73,"context_line":"        if policy is None:"},{"line_number":74,"context_line":"            raise PolicyError(\"Unknown policy\", index\u003dpolicy_or_index)"},{"line_number":75,"context_line":"    return _get_policy_string(base, int(policy))"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a80dd14_bc0842da","line":72,"updated":"2015-03-12 17:12:27.000000000","message":"(slightly playful, but I am buying into the int(policy) mantra :)...\n\ncouldn\u0027t this if/else reduce to just:\n\n  policy \u003d POLICIES.get_by_index(policy_or_index)\n\nsince get_by_index coerces policy_or_index to an int","commit_id":"4db8360874f865087ab500afa6521e68684bcef9"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"a8e849c7f458695f7a4adc6b1cb85f1988799fde","unresolved":false,"context_lines":[{"line_number":71,"context_line":"    else:"},{"line_number":72,"context_line":"        policy \u003d POLICIES.get_by_index(policy_or_index)"},{"line_number":73,"context_line":"        if policy is None:"},{"line_number":74,"context_line":"            raise PolicyError(\"Unknown policy\", index\u003dpolicy_or_index)"},{"line_number":75,"context_line":"    return _get_policy_string(base, int(policy))"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a80dd14_5c4e66c2","line":74,"updated":"2015-03-12 17:12:27.000000000","message":"I\u0027m getting feeling there are a bunch of places that call get_by_index() and then test for policy \u003d\u003d None and raise an error (but with a variety of msg strings) - maybe just need get_by_index to raise a PolicyError when policy is required.","commit_id":"4db8360874f865087ab500afa6521e68684bcef9"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"a8e849c7f458695f7a4adc6b1cb85f1988799fde","unresolved":false,"context_lines":[{"line_number":596,"context_line":"        \"\"\""},{"line_number":597,"context_line":"        return self.by_name.get(name.upper())"},{"line_number":598,"context_line":""},{"line_number":599,"context_line":"    def get_by_index(self, index):"},{"line_number":600,"context_line":"        \"\"\""},{"line_number":601,"context_line":"        Find a storage policy by its index."},{"line_number":602,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a80dd14_1f414039","line":599,"updated":"2015-03-12 17:12:27.000000000","message":"feels like i have seen several callers test result \u003d\u003d None and then raise a PolicyError.\n\nMight be slicker to have a required\u003d\u003cboolean\u003e optional arg, then before returning:\n\n  if required and not result:\n      raise PolicyError()\n  return result","commit_id":"4db8360874f865087ab500afa6521e68684bcef9"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"a8e849c7f458695f7a4adc6b1cb85f1988799fde","unresolved":false,"context_lines":[{"line_number":610,"context_line":"            index \u003d 0"},{"line_number":611,"context_line":"        else:"},{"line_number":612,"context_line":"            try:"},{"line_number":613,"context_line":"                index \u003d int(index)"},{"line_number":614,"context_line":"            except ValueError:"},{"line_number":615,"context_line":"                return None"},{"line_number":616,"context_line":"        return self.by_index.get(index)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a80dd14_3cd612c4","line":613,"updated":"2015-03-12 17:12:27.000000000","message":"makes it easy for callers to pass in a policy :)","commit_id":"4db8360874f865087ab500afa6521e68684bcef9"},{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"bbbe32e22416cdafe2f83833cc6cb1f412340301","unresolved":false,"context_lines":[{"line_number":95,"context_line":"    policy \u003d POLICIES.get_by_index(policy_index)"},{"line_number":96,"context_line":"    if get_policy_string(base, policy) !\u003d policy_string:"},{"line_number":97,"context_line":"        raise PolicyError(\"Unknown policy\", index\u003dpolicy_index)"},{"line_number":98,"context_line":"    return base, policy"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"class StoragePolicy(object):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a80dd14_736b34b9","line":98,"updated":"2015-03-13 09:48:32.000000000","message":"I\u0027m wondering if this might create problems in the future with an empty policy_string because an empty string will always interpreted as the legacy policy?","commit_id":"853a6f15f06bd832153ef0129ee5f395e0f199ec"}],"swift/obj/diskfile.py":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"1ae213fb1b7e688c13e551e5ac5a7a9206675994","unresolved":false,"context_lines":[{"line_number":64,"context_line":"    ReplicationLockTimeout, DiskFileExpired, DiskFileXattrNotSupported"},{"line_number":65,"context_line":"from swift.common.swob import multi_range_iterator"},{"line_number":66,"context_line":"from swift.common.storage_policy import ("},{"line_number":67,"context_line":"    get_policy_string, split_policy_string, PolicyError, POLICIES)"},{"line_number":68,"context_line":"from functools import partial"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_94a8d3dc","line":67,"updated":"2015-03-12 06:19:51.000000000","message":"NIT: If your going to use \u0027(..)\u0027 syntax for import, then change the rest of the multi-line imports on this page, OCD is playing up when I see mixed syntax types.\n\nNOTE: OCD NIT ONLY (no real need to fix unless you want to stop my pain) :P","commit_id":"2140bdfb30b4a55bc6b3615da05a443d3be9ce39"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"a8e849c7f458695f7a4adc6b1cb85f1988799fde","unresolved":false,"context_lines":[{"line_number":181,"context_line":"    try:"},{"line_number":182,"context_line":"        base, policy \u003d split_policy_string(obj_dirname)"},{"line_number":183,"context_line":"    except PolicyError:"},{"line_number":184,"context_line":"        return None"},{"line_number":185,"context_line":"    return policy"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a80dd14_a979e6fd","line":184,"updated":"2015-03-12 17:12:27.000000000","message":"as far as I can see, both places this is called we end up default to POLICIES.legacy so maybe just return that here?\n\nOh, apart from in tests! So how about adding an arg:\n\n  def extract_policy(obj_path, default\u003dFalse)\n\n...\n\n  except PolicyError:\n      if default:\n          return POLICIES.legacy\n      return None","commit_id":"4db8360874f865087ab500afa6521e68684bcef9"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"a8e849c7f458695f7a4adc6b1cb85f1988799fde","unresolved":false,"context_lines":[{"line_number":200,"context_line":"    policy \u003d extract_policy(corrupted_file_path)"},{"line_number":201,"context_line":"    if policy is None:"},{"line_number":202,"context_line":"        # TODO: support a quarantine-unknown location"},{"line_number":203,"context_line":"        policy \u003d POLICIES.get_by_index(None)"},{"line_number":204,"context_line":"    from_dir \u003d dirname(corrupted_file_path)"},{"line_number":205,"context_line":"    to_dir \u003d join(device_path, \u0027quarantined\u0027,"},{"line_number":206,"context_line":"                  get_data_dir(policy),"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a80dd14_3fd8c47e","line":203,"updated":"2015-03-12 17:12:27.000000000","message":"or (being explicit):\n\n  policy \u003d POLICIES.legacy\n\nBUT see comment line 184 - extract_policy could just return POLICIES.legacy","commit_id":"4db8360874f865087ab500afa6521e68684bcef9"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"a8e849c7f458695f7a4adc6b1cb85f1988799fde","unresolved":false,"context_lines":[{"line_number":1229,"context_line":"        self._bytes_per_sync \u003d mgr.bytes_per_sync"},{"line_number":1230,"context_line":"        self._use_splice \u003d use_splice"},{"line_number":1231,"context_line":"        self._pipe_size \u003d pipe_size"},{"line_number":1232,"context_line":"        if not policy:"},{"line_number":1233,"context_line":"            raise TypeError(\u0027You need to specify the policy\u0027)"},{"line_number":1234,"context_line":"        self.policy \u003d policy"},{"line_number":1235,"context_line":"        if account and container and obj:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a80dd14_3fd604c4","line":1232,"updated":"2015-03-12 17:12:27.000000000","message":"so we have to do this because we can\u0027t change the constructor signature to require policy to be set?","commit_id":"4db8360874f865087ab500afa6521e68684bcef9"}],"swift/obj/ssync_sender.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"a8e849c7f458695f7a4adc6b1cb85f1988799fde","unresolved":false,"context_lines":[{"line_number":254,"context_line":"            # the missing EC archives in self.send_list.  The"},{"line_number":255,"context_line":"            # EC reconstructor returns us the reconstructed archive"},{"line_number":256,"context_line":"            # here and we then self.send_put() it here"},{"line_number":257,"context_line":"            if self.job[\u0027policy\u0027].policy_type \u003d\u003d EC_POLICY:"},{"line_number":258,"context_line":"                # This entire area is reworked on the reconstructor patch"},{"line_number":259,"context_line":"                pass"},{"line_number":260,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a80dd14_baecc22a","line":257,"updated":"2015-03-12 17:12:27.000000000","message":"nit: policy.policy_type seems overly verbose vs policy.type, or maybe its just me?","commit_id":"4db8360874f865087ab500afa6521e68684bcef9"}],"test/unit/common/test_storage_policy.py":[{"author":{"_account_id":6968,"name":"Christian Schwede","email":"cschwede@nvidia.com","username":"cschwede"},"change_message_id":"bbbe32e22416cdafe2f83833cc6cb1f412340301","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            \u0027objects-+bar\u0027: PolicyError,"},{"line_number":108,"context_line":"            # questionable, demonstrated as inverse of get_policy_string"},{"line_number":109,"context_line":"            \u0027objects+0\u0027: (\u0027objects+0\u0027, POLICIES[0]),"},{"line_number":110,"context_line":"            \u0027\u0027: (\u0027\u0027, POLICIES[0]),"},{"line_number":111,"context_line":"            \u00270\u0027: (\u00270\u0027, POLICIES[0]),"},{"line_number":112,"context_line":"            \u0027-1\u0027: (\u0027\u0027, POLICIES[1]),"},{"line_number":113,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a80dd14_73a254fd","line":110,"updated":"2015-03-13 09:48:32.000000000","message":"There is it again - the empty string is a valid policy. Hmm.","commit_id":"853a6f15f06bd832153ef0129ee5f395e0f199ec"}]}
