)]}'
{"doc/source/overview_policies.rst":[{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"8b66d7a6752f6480c3b32872c6d7d3cb24678ae3","unresolved":false,"context_lines":[{"line_number":304,"context_line":"There are some other considerations when managing policies:"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"    * Policy names can be changed. Aliases are now supported using"},{"line_number":307,"context_line":"      comma seperation. The first added name is considered the "},{"line_number":308,"context_line":"      \u0027default\u0027 and any following names aliases, e.g: name \u003d name1, name2"},{"line_number":309,"context_line":"    * You cannot change the index of a policy once it has been created"},{"line_number":310,"context_line":"    * The default policy can be changed at any time, by adding the"}],"source_content_type":"text/x-rst","patch_set":1,"id":"fa80f949_14587f31","line":307,"updated":"2015-11-05 22:56:41.000000000","message":"nit: \"separation\"","commit_id":"3eaa142976ce6fa7cbf68d0a006b9669cd2a798c"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"5de405aaf2b3814f0fa78d134e76664644828e22","unresolved":false,"context_lines":[{"line_number":57,"context_line":"the storage policy index.  Note that internally, Swift relies on policy"},{"line_number":58,"context_line":"indexes and not policy names.  Policy names exist for human readability and"},{"line_number":59,"context_line":"translation is managed in the proxy.  When a container is created, one new"},{"line_number":60,"context_line":"optional header is supported to specify the policy name. Additional names"},{"line_number":61,"context_line":"can be added in the form of aliases. If no name is specified, the default"},{"line_number":62,"context_line":"policy is used (and if no other policies defined, Policy-0 is considered"},{"line_number":63,"context_line":"the default).  We will be covering the difference between default and"}],"source_content_type":"text/x-rst","patch_set":7,"id":"7a740942_f4b9b0cc","line":60,"updated":"2015-12-09 14:59:22.000000000","message":"this sentence can be a bit confusing. additional names can be added to the header?? I think maybe make clear that the user could provide either the policy name or one of its aliases to the header. The idea of naming rules and aliases itself is going to be explained later in the doc.","commit_id":"84d289e9eadc7654f9ece1cd46ca2bef6e4f0c65"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"5de405aaf2b3814f0fa78d134e76664644828e22","unresolved":false,"context_lines":[{"line_number":307,"context_line":"There are some other considerations when managing policies:"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"    * Policy names can be changed."},{"line_number":310,"context_line":"    * Aliases are now supported."},{"line_number":311,"context_line":"    * You cannot change the index of a policy once it has been created"},{"line_number":312,"context_line":"    * The default policy can be changed at any time, by adding the"},{"line_number":313,"context_line":"      default directive to the desired policy section"}],"source_content_type":"text/x-rst","patch_set":7,"id":"7a740942_d41034ae","line":310,"updated":"2015-12-09 14:59:22.000000000","message":"how about \"Aliases are supported.\"?\ncan they be changed too? like names can?","commit_id":"84d289e9eadc7654f9ece1cd46ca2bef6e4f0c65"}],"etc/swift.conf-sample":[{"author":{"_account_id":330,"name":"John Dickinson","email":"me@not.mn","username":"notmyname"},"change_message_id":"d966e1f99262cc59033275833c84b948fdca017f","unresolved":false,"context_lines":[{"line_number":29,"context_line":"name \u003d Policy-0"},{"line_number":30,"context_line":"default \u003d yes"},{"line_number":31,"context_line":"#policy_type \u003d replication"},{"line_number":32,"context_line":"aliases \u003d yellow, orange"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"# the following section would declare a policy called \u0027silver\u0027, the number of"},{"line_number":35,"context_line":"# replicas will be determined by how the ring is built.  In this example the"}],"source_content_type":"application/octet-stream","patch_set":4,"id":"9a8ffd7b_eaff7832","line":32,"updated":"2015-11-24 19:10:01.000000000","message":"Note for other reviewers: normally we\u0027d have this optional value commented out, but having it uncommented means that it gets used (and therefore tested) in the in-process func tests, which is what the gate uses.\n\nThe note above explicitly says it\u0027s optional, so I think this is fine.","commit_id":"595ce6611b9b780a0797226a38234bdd4219bef1"},{"author":{"_account_id":330,"name":"John Dickinson","email":"me@not.mn","username":"notmyname"},"change_message_id":"546d20c8638b327c32601a340181f84db071b5f7","unresolved":false,"context_lines":[{"line_number":41,"context_line":"# this config has specified it as the default.  However if a legacy container"},{"line_number":42,"context_line":"# (one created with a pre-policy version of swift) is accessed, it is known"},{"line_number":43,"context_line":"# implicitly to be assigned to the policy with index 0 as opposed to the"},{"line_number":44,"context_line":"# current default. Note that even without specifying any aliases, a policy "},{"line_number":45,"context_line":"# always has at least the default name stored in aliases because this field is"},{"line_number":46,"context_line":"# used to contain all human readable names for a storage policy."},{"line_number":47,"context_line":"#"}],"source_content_type":"application/octet-stream","patch_set":6,"id":"7a740942_b39cf30e","line":44,"updated":"2015-12-08 05:57:45.000000000","message":"nit: trailing whitespace","commit_id":"6012aef8f595d587a907db87e9d4c29e46e64730"}],"swift/common/storage_policy.py":[{"author":{"_account_id":330,"name":"John Dickinson","email":"me@not.mn","username":"notmyname"},"change_message_id":"30429e363efd7991977e7d0598c88856a2e615d2","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        return self.names[0]"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    @name.setter"},{"line_number":196,"context_line":"    def x(self, name):"},{"line_number":197,"context_line":"        self._validate_policy_name(name)"},{"line_number":198,"context_line":"        self.names[0] \u003d name"},{"line_number":199,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"fa80f949_f49ffb4d","line":196,"updated":"2015-11-05 20:10:08.000000000","message":"just a nit: being explicit here (eg \"def name_setter(self, name):\" will probably help future-me more easily read the code","commit_id":"3eaa142976ce6fa7cbf68d0a006b9669cd2a798c"},{"author":{"_account_id":330,"name":"John Dickinson","email":"me@not.mn","username":"notmyname"},"change_message_id":"30429e363efd7991977e7d0598c88856a2e615d2","unresolved":false,"context_lines":[{"line_number":731,"context_line":"        \"\"\""},{"line_number":732,"context_line":"        Adds a new name or names to a policy"},{"line_number":733,"context_line":""},{"line_number":734,"context_line":"        :param policy_idex: index of a policy in this policy collection."},{"line_number":735,"context_line":"        \"\"\""},{"line_number":736,"context_line":"        for alias in aliases:"},{"line_number":737,"context_line":"            policy \u003d self.get_by_index(policy_idex)"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa80f949_f4229b00","line":734,"updated":"2015-11-05 20:10:08.000000000","message":"should add in docs on param *aliases","commit_id":"3eaa142976ce6fa7cbf68d0a006b9669cd2a798c"},{"author":{"_account_id":330,"name":"John Dickinson","email":"me@not.mn","username":"notmyname"},"change_message_id":"30429e363efd7991977e7d0598c88856a2e615d2","unresolved":false,"context_lines":[{"line_number":734,"context_line":"        :param policy_idex: index of a policy in this policy collection."},{"line_number":735,"context_line":"        \"\"\""},{"line_number":736,"context_line":"        for alias in aliases:"},{"line_number":737,"context_line":"            policy \u003d self.get_by_index(policy_idex)"},{"line_number":738,"context_line":"            if alias.upper() in self.by_name:"},{"line_number":739,"context_line":"                raise PolicyError(\u0027Duplicate name %s in use \u0027"},{"line_number":740,"context_line":"                                \u0027by policy %s\u0027 % (alias, "}],"source_content_type":"text/x-python","patch_set":1,"id":"fa80f949_d4551750","line":737,"updated":"2015-11-05 20:10:08.000000000","message":"why is this in the loop?","commit_id":"3eaa142976ce6fa7cbf68d0a006b9669cd2a798c"},{"author":{"_account_id":330,"name":"John Dickinson","email":"me@not.mn","username":"notmyname"},"change_message_id":"30429e363efd7991977e7d0598c88856a2e615d2","unresolved":false,"context_lines":[{"line_number":747,"context_line":"        \"\"\""},{"line_number":748,"context_line":"        Removes a name or names from a policy."},{"line_number":749,"context_line":""},{"line_number":750,"context_line":"        :param alias: The string name of an existing policy in the collection."},{"line_number":751,"context_line":"        \"\"\""},{"line_number":752,"context_line":"        for alias in aliases:"},{"line_number":753,"context_line":"            policy \u003d self.get_by_name(alias)"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa80f949_747d4be6","line":750,"updated":"2015-11-05 20:10:08.000000000","message":"should make this about the arbitrary number of aliases that can be passed in","commit_id":"3eaa142976ce6fa7cbf68d0a006b9669cd2a798c"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"b49a935f2bdf512e14fb5f68227080513835d8bc","unresolved":false,"context_lines":[{"line_number":312,"context_line":"        :param name: a new alias for the storage policy"},{"line_number":313,"context_line":"        \"\"\""},{"line_number":314,"context_line":"        if self._validate_policy_name(name):"},{"line_number":315,"context_line":"            self.alias_list.append(name)"},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"    def remove_name(self, name):"},{"line_number":318,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"9a8ffd7b_d9a35a9d","line":315,"updated":"2015-11-25 02:36:43.000000000","message":"So this adds a new alias to a policy, but this doesn\u0027t update .aliases, so now .alias_list isn\u0027t the same as .name + .aliases. So why are we keeping .aliases. Can\u0027t be just store name + aliases in alias_list?\n\nE.g:\n\n  @property\n  def aliases(self):\n      return list() if len(self.alias_list) \u003d\u003d 1 else self.alias_list[1:] \n\n  @property name(self):\n      return self.alias_list[0]\n\nThis way we are storing all the aliases in one data structure. In fact if we do this we don\u0027t need to keep a stale list of aliases and doesn\u0027t that simplify the code?","commit_id":"a7d18f98ee9bd7aa47ac4b60e8ccdc0a9fde7004"},{"author":{"_account_id":12279,"name":"Janie Richling","email":"jrichli@us.ibm.com","username":"jrichli"},"change_message_id":"4da42351e5ce3575f6f6c247bce793f10b56f497","unresolved":false,"context_lines":[{"line_number":312,"context_line":"        :param name: a new alias for the storage policy"},{"line_number":313,"context_line":"        \"\"\""},{"line_number":314,"context_line":"        if self._validate_policy_name(name):"},{"line_number":315,"context_line":"            self.alias_list.append(name)"},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"    def remove_name(self, name):"},{"line_number":318,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"9a8ffd7b_602392be","line":315,"in_reply_to":"9a8ffd7b_d9a35a9d","updated":"2015-11-25 04:09:00.000000000","message":"honestly, I did wonder why we have both names and aliases, and add/remove for both.  If we go with what you are suggesting, then there would be only one add/remove method, right?","commit_id":"a7d18f98ee9bd7aa47ac4b60e8ccdc0a9fde7004"},{"author":{"_account_id":330,"name":"John Dickinson","email":"me@not.mn","username":"notmyname"},"change_message_id":"546d20c8638b327c32601a340181f84db071b5f7","unresolved":false,"context_lines":[{"line_number":177,"context_line":"            names_list \u003d list_from_csv(aliases)"},{"line_number":178,"context_line":"            for alias in names_list:"},{"line_number":179,"context_line":"                if alias \u003d\u003d name:"},{"line_number":180,"context_line":"                    break"},{"line_number":181,"context_line":"                self._validate_policy_name(alias)"},{"line_number":182,"context_line":"                self.alias_list.append(alias)"},{"line_number":183,"context_line":"        self.is_deprecated \u003d config_true_value(is_deprecated)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a740942_937697d5","line":180,"updated":"2015-12-08 05:57:45.000000000","message":"Why break instead of continue? A \"continue\" simply ignores the single duplicate instead of stopping all processing of further aliases.\n\nHowever, something needs to happen here. We could ignore with a continue. We could raise a PolicyError. Actually in that case, why have this conditional at all? When the alias is validated in the next line, we\u0027ll raise an error.\n\nWhatever the final implementation is, it needs a test for when an alias has an element that matches the name (or an existing element).","commit_id":"6012aef8f595d587a907db87e9d4c29e46e64730"},{"author":{"_account_id":330,"name":"John Dickinson","email":"me@not.mn","username":"notmyname"},"change_message_id":"546d20c8638b327c32601a340181f84db071b5f7","unresolved":false,"context_lines":[{"line_number":405,"context_line":"                 ec_type\u003dNone, ec_ndata\u003dNone, ec_nparity\u003dNone):"},{"line_number":406,"context_line":""},{"line_number":407,"context_line":"        super(ECStoragePolicy, self).__init__("},{"line_number":408,"context_line":"            idx, name, is_default, is_deprecated, object_ring)"},{"line_number":409,"context_line":""},{"line_number":410,"context_line":"        # Validate erasure_coding policy specific members"},{"line_number":411,"context_line":"        # ec_type is one of the EC implementations supported by PyEClib"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a740942_4eec04f3","line":408,"updated":"2015-12-08 05:57:45.000000000","message":"You\u0027re missing passing aliases to the base class here.\n\nAlso, I *strongly* recommend being explicit about the named arguments. eg (..., name\u003dname, aliases\u003daliases, is_default\u003dis_default, ...). This way, even if the argument order changes in the super class[1], the calls from child classes will still work.\n\nTest coverage for EC policies needs to be done too.\n\n\n[1] as an example of when that could happen, this patch is doing it!","commit_id":"6012aef8f595d587a907db87e9d4c29e46e64730"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"5de405aaf2b3814f0fa78d134e76664644828e22","unresolved":false,"context_lines":[{"line_number":336,"context_line":"                              \"Policies must have at least one name.\""},{"line_number":337,"context_line":"                              % (name, self.idx))"},{"line_number":338,"context_line":"        else:"},{"line_number":339,"context_line":"            self.alias_list.remove(name)"},{"line_number":340,"context_line":""},{"line_number":341,"context_line":"    def _validate_ring(self):"},{"line_number":342,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_63d0a0f8","line":339,"updated":"2015-12-09 14:59:22.000000000","message":"what if the removed name is the actual name of the policy (not one of its aliases)?","commit_id":"84d289e9eadc7654f9ece1cd46ca2bef6e4f0c65"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"5de405aaf2b3814f0fa78d134e76664644828e22","unresolved":false,"context_lines":[{"line_number":741,"context_line":"            policy_info.append(policy_entry)"},{"line_number":742,"context_line":"        return policy_info"},{"line_number":743,"context_line":""},{"line_number":744,"context_line":"    def add_policy_alias(self, policy_index, *aliases):"},{"line_number":745,"context_line":"        \"\"\""},{"line_number":746,"context_line":"        Adds a new name or names to a policy"},{"line_number":747,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_a92186b6","line":744,"updated":"2015-12-09 14:59:22.000000000","message":"when would these two methods be used (add_policy_alias and remove_policy_alias)?","commit_id":"84d289e9eadc7654f9ece1cd46ca2bef6e4f0c65"},{"author":{"_account_id":9625,"name":"Thiago da Silva","email":"thiagodasilva@gmail.com","username":"thiago"},"change_message_id":"5de405aaf2b3814f0fa78d134e76664644828e22","unresolved":false,"context_lines":[{"line_number":758,"context_line":"                policy.add_name(alias)"},{"line_number":759,"context_line":"                self.by_name[alias.upper()] \u003d policy"},{"line_number":760,"context_line":""},{"line_number":761,"context_line":"    def remove_policy_alias(self, *aliases):"},{"line_number":762,"context_line":"        \"\"\""},{"line_number":763,"context_line":"        Removes a name or names from a policy."},{"line_number":764,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_445487c9","line":761,"updated":"2015-12-09 14:59:22.000000000","message":"my concern is that the caller of this method could actually remove the primary name of the policy, but not add a new name (the next alias in the list becomes the new primary name). is that correct? if so, is that desirable?","commit_id":"84d289e9eadc7654f9ece1cd46ca2bef6e4f0c65"}],"test/unit/common/test_storage_policy.py":[{"author":{"_account_id":330,"name":"John Dickinson","email":"me@not.mn","username":"notmyname"},"change_message_id":"d966e1f99262cc59033275833c84b948fdca017f","unresolved":false,"context_lines":[{"line_number":81,"context_line":"#        expect \u003d [{\u0027aliases\u0027: [\u0027zero\u0027], \u0027default\u0027: True, \u0027name\u0027: \u0027zero\u0027, },"},{"line_number":82,"context_line":"#                  {\u0027aliases\u0027: [\u0027two\u0027], \u0027name\u0027: \u0027two\u0027},"},{"line_number":83,"context_line":"#                  {\u0027aliases\u0027: [\u0027one\u0027], \u0027name\u0027: \u0027one\u0027},"},{"line_number":84,"context_line":"#                  {\u0027aliases\u0027: [\u0027ten\u0027], \u0027name\u0027: \u0027ten\u0027}]"},{"line_number":85,"context_line":"        swift_info \u003d POLICIES.get_policy_info()"},{"line_number":86,"context_line":"        self.assertEqual(sorted(expect, key\u003dlambda k: k[\u0027name\u0027]),"},{"line_number":87,"context_line":"                         sorted(swift_info, key\u003dlambda k: k[\u0027name\u0027]))"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a8ffd7b_c002953e","line":84,"updated":"2015-11-24 19:10:01.000000000","message":"nit: commented out lines not needed","commit_id":"595ce6611b9b780a0797226a38234bdd4219bef1"},{"author":{"_account_id":330,"name":"John Dickinson","email":"me@not.mn","username":"notmyname"},"change_message_id":"d966e1f99262cc59033275833c84b948fdca017f","unresolved":false,"context_lines":[{"line_number":1019,"context_line":"                            ec_ndata\u003d10, ec_nparity\u003d3),"},{"line_number":1020,"context_line":"            ECStoragePolicy(11, \u0027done\u0027, is_deprecated\u003dTrue,"},{"line_number":1021,"context_line":"                            ec_type\u003dDEFAULT_TEST_EC_TYPE,"},{"line_number":1022,"context_line":"                            ec_ndata\u003d10, ec_nparity\u003d3),"},{"line_number":1023,"context_line":"        ]"},{"line_number":1024,"context_line":"        policies \u003d StoragePolicyCollection(test_policies)"},{"line_number":1025,"context_line":"        expected \u003d {"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a8ffd7b_63a093f5","line":1022,"updated":"2015-11-24 19:10:01.000000000","message":"might be nice to have an alias on one of these","commit_id":"595ce6611b9b780a0797226a38234bdd4219bef1"}]}
