)]}'
{"drydock_provisioner/objects/site.py":[{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"36501a252650e540bc2b67af578fda1766be1be1","unresolved":false,"context_lines":[{"line_number":203,"context_line":"        self.networks.append(new_network)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def get_network(self, network_key):"},{"line_number":206,"context_line":"        if self.networks:"},{"line_number":207,"context_line":"            for n in self.networks:"},{"line_number":208,"context_line":"                if n.get_id() \u003d\u003d network_key:"},{"line_number":209,"context_line":"                    return n"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_6ba50504","line":206,"updated":"2018-08-08 04:52:12.000000000","message":"What do these conditionals accomplish? Unless self.networks is None as opposed to a list in which case this makes sense though why not just default self.networks to [] if it\u0027s None? Ditto below.","commit_id":"f3155da94214aca57680c4b95655c616af017b0c"},{"author":{"_account_id":26449,"name":"Scott Hussey","email":"sthussey@att.com","username":"sh8121"},"change_message_id":"02b29baff9907cf87bcc7546f0fc42e1de70fbcd","unresolved":false,"context_lines":[{"line_number":203,"context_line":"        self.networks.append(new_network)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def get_network(self, network_key):"},{"line_number":206,"context_line":"        if self.networks:"},{"line_number":207,"context_line":"            for n in self.networks:"},{"line_number":208,"context_line":"                if n.get_id() \u003d\u003d network_key:"},{"line_number":209,"context_line":"                    return n"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_3208a72a","line":206,"in_reply_to":"3f79a3b5_6ba50504","updated":"2018-08-09 22:05:50.000000000","message":"Because self.networks is a oslo.versionedobject thing, I\u0027m not sure I can default it to []. This is a pattern I know works with ovo.","commit_id":"f3155da94214aca57680c4b95655c616af017b0c"}],"drydock_provisioner/orchestrator/validations/hostname_validity.py":[{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"36501a252650e540bc2b67af578fda1766be1be1","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        # Check each label in the domain name is \u003c\u003d 63 characters per RFC 1035"},{"line_number":39,"context_line":"        # and only contains A-Z,a-z,0-9,-"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        valid_label \u003d re.compile(\u0027[a-z0-9-]{1,63}\u0027, flags\u003dre.I)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        for n in node_list:"},{"line_number":44,"context_line":"            domain_labels \u003d n.get_fqdn(site_design).split(\u0027.\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_2baf0de4","line":41,"range":{"start_line":41,"start_character":8,"end_line":41,"end_character":63},"updated":"2018-08-08 04:52:12.000000000","message":"If you compile this at the global/class level then that will be an ever slight optimization.","commit_id":"f3155da94214aca57680c4b95655c616af017b0c"},{"author":{"_account_id":26449,"name":"Scott Hussey","email":"sthussey@att.com","username":"sh8121"},"change_message_id":"02b29baff9907cf87bcc7546f0fc42e1de70fbcd","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        # Check each label in the domain name is \u003c\u003d 63 characters per RFC 1035"},{"line_number":39,"context_line":"        # and only contains A-Z,a-z,0-9,-"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        valid_label \u003d re.compile(\u0027[a-z0-9-]{1,63}\u0027, flags\u003dre.I)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        for n in node_list:"},{"line_number":44,"context_line":"            domain_labels \u003d n.get_fqdn(site_design).split(\u0027.\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_0d2c7097","line":41,"range":{"start_line":41,"start_character":8,"end_line":41,"end_character":63},"in_reply_to":"3f79a3b5_2baf0de4","updated":"2018-08-09 22:05:50.000000000","message":"True, but for the optimization I\u0027d have to dirty a wider namespace which I attempt to avoid. This only runs once per call to validation, so I think it is okay to pay the price.","commit_id":"f3155da94214aca57680c4b95655c616af017b0c"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"36501a252650e540bc2b67af578fda1766be1be1","unresolved":false,"context_lines":[{"line_number":48,"context_line":"                        n.get_fqdn(site_design), l)"},{"line_number":49,"context_line":"                    self.report_error("},{"line_number":50,"context_line":"                        msg, [n.doc_ref],"},{"line_number":51,"context_line":"                        \"RFC 1035 requires each label in a DNS name to be \u003c 63 characters and contain \""},{"line_number":52,"context_line":"                        \"only A-Z, 0-9, and hyphens.\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_0bb49134","line":51,"range":{"start_line":51,"start_character":74,"end_line":51,"end_character":75},"updated":"2018-08-08 04:52:12.000000000","message":"\u003c\u003d as per your comment on L38","commit_id":"f3155da94214aca57680c4b95655c616af017b0c"},{"author":{"_account_id":26449,"name":"Scott Hussey","email":"sthussey@att.com","username":"sh8121"},"change_message_id":"02b29baff9907cf87bcc7546f0fc42e1de70fbcd","unresolved":false,"context_lines":[{"line_number":48,"context_line":"                        n.get_fqdn(site_design), l)"},{"line_number":49,"context_line":"                    self.report_error("},{"line_number":50,"context_line":"                        msg, [n.doc_ref],"},{"line_number":51,"context_line":"                        \"RFC 1035 requires each label in a DNS name to be \u003c 63 characters and contain \""},{"line_number":52,"context_line":"                        \"only A-Z, 0-9, and hyphens.\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_4d46e851","line":51,"range":{"start_line":51,"start_character":74,"end_line":51,"end_character":75},"in_reply_to":"3f79a3b5_0bb49134","updated":"2018-08-09 22:05:50.000000000","message":"Done","commit_id":"f3155da94214aca57680c4b95655c616af017b0c"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"c57abf02e03eadb92f15b8759d2e228228ef59d6","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        # Check each label in the domain name is \u003c\u003d 63 characters per RFC 1035"},{"line_number":39,"context_line":"        # and only contains A-Z,a-z,0-9,-"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        valid_label \u003d re.compile(\u0027[a-z0-9-]{1,63}\u0027, flags\u003dre.I)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        for n in node_list:"},{"line_number":44,"context_line":"            domain_labels \u003d n.get_fqdn(site_design).split(\u0027.\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_11d469bc","line":41,"range":{"start_line":41,"start_character":35,"end_line":41,"end_character":38},"updated":"2018-08-11 05:54:16.000000000","message":"This is missing A-Z as per comment on L39. Only handles lower-case right now.","commit_id":"e8903665fc3d50ad40de0729a9ce20148e5133d0"},{"author":{"_account_id":26449,"name":"Scott Hussey","email":"sthussey@att.com","username":"sh8121"},"change_message_id":"7efeb8a7d218734e766bd3a4f1d1d038e90a5ca5","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        # Check each label in the domain name is \u003c\u003d 63 characters per RFC 1035"},{"line_number":39,"context_line":"        # and only contains A-Z,a-z,0-9,-"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        valid_label \u003d re.compile(\u0027[a-z0-9-]{1,63}\u0027, flags\u003dre.I)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        for n in node_list:"},{"line_number":44,"context_line":"            domain_labels \u003d n.get_fqdn(site_design).split(\u0027.\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_67c3bc8a","line":41,"range":{"start_line":41,"start_character":35,"end_line":41,"end_character":38},"in_reply_to":"3f79a3b5_11d469bc","updated":"2018-08-22 14:08:38.000000000","message":"The flags argument sets the pattern matching to be case insensitive (as DNS names are case insensitive per RFC).","commit_id":"e8903665fc3d50ad40de0729a9ce20148e5133d0"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"30ac4e62a33e454c75ab355eb5f490e8c0a32c86","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        # Check each label in the domain name is \u003c\u003d 63 characters per RFC 1035"},{"line_number":39,"context_line":"        # and only contains A-Z,a-z,0-9,-"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        valid_label \u003d re.compile(\u0027[a-z0-9-]{1,63}\u0027, flags\u003dre.I)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        for n in node_list:"},{"line_number":44,"context_line":"            domain_labels \u003d n.get_fqdn(site_design).split(\u0027.\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_d32b6ee8","line":41,"range":{"start_line":41,"start_character":35,"end_line":41,"end_character":38},"in_reply_to":"3f79a3b5_67c3bc8a","updated":"2018-08-22 15:19:51.000000000","message":"Gotcha, with flag this makes sense","commit_id":"e8903665fc3d50ad40de0729a9ce20148e5133d0"},{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"c57abf02e03eadb92f15b8759d2e228228ef59d6","unresolved":false,"context_lines":[{"line_number":49,"context_line":"                    self.report_error("},{"line_number":50,"context_line":"                        msg, [n.doc_ref],"},{"line_number":51,"context_line":"                        \"RFC 1035 requires each label in a DNS name to be \u003c\u003d 63 characters and contain \""},{"line_number":52,"context_line":"                        \"only A-Z, 0-9, and hyphens.\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_b1dc95e4","line":52,"range":{"start_line":52,"start_character":30,"end_line":52,"end_character":33},"updated":"2018-08-11 05:54:16.000000000","message":"A-Z, a-z\n\nThough perhaps this is clearer:\n\n\"... and contain only alphanumeric characters and hyphens.\"","commit_id":"e8903665fc3d50ad40de0729a9ce20148e5133d0"},{"author":{"_account_id":26449,"name":"Scott Hussey","email":"sthussey@att.com","username":"sh8121"},"change_message_id":"7efeb8a7d218734e766bd3a4f1d1d038e90a5ca5","unresolved":false,"context_lines":[{"line_number":49,"context_line":"                    self.report_error("},{"line_number":50,"context_line":"                        msg, [n.doc_ref],"},{"line_number":51,"context_line":"                        \"RFC 1035 requires each label in a DNS name to be \u003c\u003d 63 characters and contain \""},{"line_number":52,"context_line":"                        \"only A-Z, 0-9, and hyphens.\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_aaa0bb43","line":52,"range":{"start_line":52,"start_character":30,"end_line":52,"end_character":33},"in_reply_to":"3f79a3b5_b1dc95e4","updated":"2018-08-22 14:08:38.000000000","message":"DNS names are case insensitive, A-Z \u003d\u003d a-z, but I will update to clarify.","commit_id":"e8903665fc3d50ad40de0729a9ce20148e5133d0"}],"tests/unit/test_validation_rule_hostname_validity.py":[{"author":{"_account_id":23186,"name":"Felipe Monteiro","email":"felipe.carneiro.monteiro@gmail.com","username":"felipe.monteiro"},"change_message_id":"36501a252650e540bc2b67af578fda1766be1be1","unresolved":false,"context_lines":[{"line_number":60,"context_line":"            LOG.debug(msg)"},{"line_number":61,"context_line":"            assert msg.get(\u0027error\u0027)"},{"line_number":62,"context_line":"            assert len(msg.get(\u0027documents\u0027)) \u003e 0"},{"line_number":63,"context_line":"            assert \"bad__name\" in msg.get(\u0027message\u0027) or long_label in msg.get("},{"line_number":64,"context_line":"                \u0027message\u0027)"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        assert len(message_list) \u003e 1"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_4b9369a4","line":63,"range":{"start_line":63,"start_character":20,"end_line":63,"end_character":29},"updated":"2018-08-08 04:52:12.000000000","message":"Is this really meaningful to check now that hyphens are allowed? Should update the YAML with something else.\n\nAlso usage of \"or\" in the assertion makes this a less-than-ideal assertion as it could skip over the LHS side each time (i.e. fail every time, which is not the intention).","commit_id":"f3155da94214aca57680c4b95655c616af017b0c"},{"author":{"_account_id":26449,"name":"Scott Hussey","email":"sthussey@att.com","username":"sh8121"},"change_message_id":"02b29baff9907cf87bcc7546f0fc42e1de70fbcd","unresolved":false,"context_lines":[{"line_number":60,"context_line":"            LOG.debug(msg)"},{"line_number":61,"context_line":"            assert msg.get(\u0027error\u0027)"},{"line_number":62,"context_line":"            assert len(msg.get(\u0027documents\u0027)) \u003e 0"},{"line_number":63,"context_line":"            assert \"bad__name\" in msg.get(\u0027message\u0027) or long_label in msg.get("},{"line_number":64,"context_line":"                \u0027message\u0027)"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        assert len(message_list) \u003e 1"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_8daac0cf","line":63,"range":{"start_line":63,"start_character":20,"end_line":63,"end_character":29},"in_reply_to":"3f79a3b5_4b9369a4","updated":"2018-08-09 22:05:50.000000000","message":"Double underscore is particularly import to ensure fails validation because it is used as a delimiter in a string containing the hostname.\n\nI\u0027m unclear on the issue w/ the assertion. With an or [0] the LHS should be evaluated and if false, the RHS would be evaluated. So this seems fine because the only time the assertion fails is if the LHS and RHS are both false. Or I totally misunderstand how it works.\n\n[0] https://docs.python.org/3/reference/expressions.html#grammar-token-or_test","commit_id":"f3155da94214aca57680c4b95655c616af017b0c"}]}
