)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1b0a555ea1e43efc93d1a4c51b85d65009258a98","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Slugification utilities for placement names"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Names of resource providers, resource classes, and traits in placement"},{"line_number":10,"context_line":"are restricted to certain characters and lengths.  Consumers (e.g. virt"},{"line_number":11,"context_line":"driver implementations of update_provider_tree) may wish to generate"},{"line_number":12,"context_line":"such names dynamically based on inputs that don\u0027t necessarily know or"},{"line_number":13,"context_line":"follow those rules.  Such consumers could use a convenient way to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"bf659307_b68da47c","line":10,"range":{"start_line":10,"start_character":51,"end_line":10,"end_character":60},"updated":"2018-03-28 02:09:47.000000000","message":"Consumers? seems should be the provider?","commit_id":"93df5841a1ad7b2f2271b16af4108fcff39092dd"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"96757171bfeccfc763db5bd8f067f60e5ea48a39","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Slugification utilities for placement names"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Names of resource providers, resource classes, and traits in placement"},{"line_number":10,"context_line":"are restricted to certain characters and lengths.  Consumers (e.g. virt"},{"line_number":11,"context_line":"driver implementations of update_provider_tree) may wish to generate"},{"line_number":12,"context_line":"such names dynamically based on inputs that don\u0027t necessarily know or"},{"line_number":13,"context_line":"follow those rules.  Such consumers could use a convenient way to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"bf659307_0e1ea66f","line":10,"range":{"start_line":10,"start_character":51,"end_line":10,"end_character":60},"in_reply_to":"bf659307_b68da47c","updated":"2018-03-28 16:02:13.000000000","message":"I\u0027m talking about consumers of the placement API.","commit_id":"93df5841a1ad7b2f2271b16af4108fcff39092dd"}],"nova/api/openstack/placement/lib.py":[{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"f528fec7a14546211c2c5be615f64c216b02c8e5","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        self.member_of \u003d member_of or []"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def _convert(i):"},{"line_number":42,"context_line":"    # Legal characters are A-Z, 0-9, and _"},{"line_number":43,"context_line":"    # Goofy special case for py3: chr(223).upper() converts to \u0027SS\u0027, which"},{"line_number":44,"context_line":"    # sorts between \u0027A\u0027 and \u0027Z\u0027."},{"line_number":45,"context_line":"    if i \u003d\u003d 223:"},{"line_number":46,"context_line":"        return \u0027_\u0027"},{"line_number":47,"context_line":"    c \u003d chr(i).upper()"},{"line_number":48,"context_line":"    if \u0027A\u0027 \u003c\u003d c \u003c\u003d \u0027Z\u0027 or \u00270\u0027 \u003c\u003d c \u003c\u003d \u00279\u0027 or c \u003d\u003d \u0027_\u0027:"},{"line_number":49,"context_line":"        return c"},{"line_number":50,"context_line":"    return \u0027_\u0027"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"_SLUG_TRANSLATOR \u003d \u0027\u0027.join(_convert(i) for i in range(256))"}],"source_content_type":"text/x-python","patch_set":3,"id":"bf659307_367194e1","line":50,"range":{"start_line":41,"start_character":0,"end_line":50,"end_character":14},"updated":"2018-03-28 02:54:57.000000000","message":"Hi, Eric. In truth, I doubt the convert function is practical or not.\nCurrently, resource provider doesn\u0027t have any field to store specified data like gpu grou uuid, so we attach this id to the rp name. And convert it back when we need it.\nBecause we need to convert back, so could you provide both the functions? Or we can let the user write the function, you only provide a rp-name validity check function in this lib.\nAny suggestion?","commit_id":"93df5841a1ad7b2f2271b16af4108fcff39092dd"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"1554a50db0af9d8d228137025f5341e887f4a4b9","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        self.member_of \u003d member_of or []"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def _convert(i):"},{"line_number":42,"context_line":"    # Legal characters are A-Z, 0-9, and _"},{"line_number":43,"context_line":"    # Goofy special case for py3: chr(223).upper() converts to \u0027SS\u0027, which"},{"line_number":44,"context_line":"    # sorts between \u0027A\u0027 and \u0027Z\u0027."},{"line_number":45,"context_line":"    if i \u003d\u003d 223:"},{"line_number":46,"context_line":"        return \u0027_\u0027"},{"line_number":47,"context_line":"    c \u003d chr(i).upper()"},{"line_number":48,"context_line":"    if \u0027A\u0027 \u003c\u003d c \u003c\u003d \u0027Z\u0027 or \u00270\u0027 \u003c\u003d c \u003c\u003d \u00279\u0027 or c \u003d\u003d \u0027_\u0027:"},{"line_number":49,"context_line":"        return c"},{"line_number":50,"context_line":"    return \u0027_\u0027"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"_SLUG_TRANSLATOR \u003d \u0027\u0027.join(_convert(i) for i in range(256))"}],"source_content_type":"text/x-python","patch_set":3,"id":"bf659307_839852c0","line":50,"range":{"start_line":41,"start_character":0,"end_line":50,"end_character":14},"in_reply_to":"bf659307_367194e1","updated":"2018-03-28 13:46:46.000000000","message":"Apologies, you\u0027re absolutely right, neither the schema nor the code restricts the character set for RP names.  I will change the method to do just the length restriction when is_provider\u003dTrue.\n\nThanks for pointing this out.","commit_id":"93df5841a1ad7b2f2271b16af4108fcff39092dd"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5b61644e2392a8af2db7395c54451f5b122c558b","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        self.member_of \u003d member_of or []"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def _convert(i):"},{"line_number":42,"context_line":"    # Legal characters are A-Z, 0-9, and _"},{"line_number":43,"context_line":"    # Goofy special case for py3: chr(223).upper() converts to \u0027SS\u0027, which"},{"line_number":44,"context_line":"    # sorts between \u0027A\u0027 and \u0027Z\u0027."},{"line_number":45,"context_line":"    if i \u003d\u003d 223:"},{"line_number":46,"context_line":"        return \u0027_\u0027"},{"line_number":47,"context_line":"    c \u003d chr(i).upper()"},{"line_number":48,"context_line":"    if \u0027A\u0027 \u003c\u003d c \u003c\u003d \u0027Z\u0027 or \u00270\u0027 \u003c\u003d c \u003c\u003d \u00279\u0027 or c \u003d\u003d \u0027_\u0027:"},{"line_number":49,"context_line":"        return c"},{"line_number":50,"context_line":"    return \u0027_\u0027"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"_SLUG_TRANSLATOR \u003d \u0027\u0027.join(_convert(i) for i in range(256))"}],"source_content_type":"text/x-python","patch_set":3,"id":"bf659307_634bbeaf","line":50,"range":{"start_line":41,"start_character":0,"end_line":50,"end_character":14},"in_reply_to":"bf659307_839852c0","updated":"2018-03-28 14:02:38.000000000","message":"Fixed","commit_id":"93df5841a1ad7b2f2271b16af4108fcff39092dd"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"fa68e324c960a054f59af736de0b5ade9d98eb4b","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        self.member_of \u003d member_of or []"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def _convert(i):"},{"line_number":42,"context_line":"    # Legal characters are A-Z, 0-9, and _"},{"line_number":43,"context_line":"    # Goofy special case for py3: chr(223).upper() converts to \u0027SS\u0027, which"},{"line_number":44,"context_line":"    # sorts between \u0027A\u0027 and \u0027Z\u0027."},{"line_number":45,"context_line":"    if i \u003d\u003d 223:"},{"line_number":46,"context_line":"        return \u0027_\u0027"},{"line_number":47,"context_line":"    c \u003d chr(i).upper()"},{"line_number":48,"context_line":"    if \u0027A\u0027 \u003c\u003d c \u003c\u003d \u0027Z\u0027 or \u00270\u0027 \u003c\u003d c \u003c\u003d \u00279\u0027 or c \u003d\u003d \u0027_\u0027:"},{"line_number":49,"context_line":"        return c"},{"line_number":50,"context_line":"    return \u0027_\u0027"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"_SLUG_TRANSLATOR \u003d \u0027\u0027.join(_convert(i) for i in range(256))"}],"source_content_type":"text/x-python","patch_set":3,"id":"bf659307_6f4072a6","line":50,"range":{"start_line":41,"start_character":0,"end_line":50,"end_character":14},"in_reply_to":"bf659307_839852c0","updated":"2018-03-29 01:07:28.000000000","message":"No worries. Thank you very much for the help :)","commit_id":"93df5841a1ad7b2f2271b16af4108fcff39092dd"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"c32c2c83c8f63456031db881dcc57c8e9e65429c","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        self.member_of \u003d member_of or []"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def _convert(c):"},{"line_number":44,"context_line":"    # Legal characters are A-Z, 0-9, and _"},{"line_number":45,"context_line":"    if \u0027A\u0027 \u003c\u003d c \u003c\u003d \u0027Z\u0027 or \u00270\u0027 \u003c\u003d c \u003c\u003d \u00279\u0027:"},{"line_number":46,"context_line":"        return c"}],"source_content_type":"text/x-python","patch_set":6,"id":"bf659307_c89c1fc2","line":43,"updated":"2018-03-28 18:26:13.000000000","message":"Like this much better than the version I saw earlier in the day, but only glancingly.","commit_id":"397a673c825e9677adfc1b72239106d66ef7d69f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"998165659d72af80b6c6d9aad1bf0c2f01969c7c","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        self.member_of \u003d member_of or []"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def _convert(c):"},{"line_number":44,"context_line":"    # Legal characters are A-Z, 0-9, and _"},{"line_number":45,"context_line":"    if \u0027A\u0027 \u003c\u003d c \u003c\u003d \u0027Z\u0027 or \u00270\u0027 \u003c\u003d c \u003c\u003d \u00279\u0027:"},{"line_number":46,"context_line":"        return c"}],"source_content_type":"text/x-python","patch_set":6,"id":"bf659307_17a9ce22","line":43,"in_reply_to":"bf659307_c89c1fc2","updated":"2018-03-28 22:05:23.000000000","message":"Yeah, I was trying to use a translation table before, because it\u0027s (possible, I feel, no proof) more efficient.  But that becomes impractical when mucking with the entire unicode set.","commit_id":"397a673c825e9677adfc1b72239106d66ef7d69f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"c32c2c83c8f63456031db881dcc57c8e9e65429c","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    if \u0027A\u0027 \u003c\u003d c \u003c\u003d \u0027Z\u0027 or \u00270\u0027 \u003c\u003d c \u003c\u003d \u00279\u0027:"},{"line_number":46,"context_line":"        return c"},{"line_number":47,"context_line":"    if \u0027a\u0027 \u003c\u003d c \u003c\u003d \u0027z\u0027:"},{"line_number":48,"context_line":"        return c.upper()"},{"line_number":49,"context_line":"    return \u0027_\u0027"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"bf659307_68ce3383","line":48,"updated":"2018-03-28 18:26:13.000000000","message":"If for some reason you want to make this even shorter, call c.upper first:\n\n   c \u003d c.upper()\n   if \u0027A\u0027 \u003c\u003d c \u003c\u003d \u0027Z\u0027 or \u00270\u0027 \u003c\u003d c \u003c\u003d \u00279\u0027:\n      return c\n   return \u0027_\u0027\n\nWhen you were in chr land things were apparently weird, but as far as I can tell upper() behaves sanely with strings (_ stays _)","commit_id":"397a673c825e9677adfc1b72239106d66ef7d69f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"998165659d72af80b6c6d9aad1bf0c2f01969c7c","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    if \u0027A\u0027 \u003c\u003d c \u003c\u003d \u0027Z\u0027 or \u00270\u0027 \u003c\u003d c \u003c\u003d \u00279\u0027:"},{"line_number":46,"context_line":"        return c"},{"line_number":47,"context_line":"    if \u0027a\u0027 \u003c\u003d c \u003c\u003d \u0027z\u0027:"},{"line_number":48,"context_line":"        return c.upper()"},{"line_number":49,"context_line":"    return \u0027_\u0027"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"bf659307_f7c45af7","line":48,"in_reply_to":"bf659307_68ce3383","updated":"2018-03-28 22:05:23.000000000","message":"I had that originally, but py3 is what I would call broken in this regard:\n\n In [3]: six.unichr(223)\n Out[3]: \u0027ß\u0027\n\n In [4]: six.unichr(223).upper()\n Out[4]: \u0027SS\u0027\n\n In [5]: \u0027A\u0027 \u003c\u003d six.unichr(223).upper() \u003c\u003d \u0027Z\u0027\n Out[5]: True\n\n...and py2 doesn\u0027t do the same thing - i.e. py2 and py3 behave differently.  So I split out the lowercase ones to make it consistent.","commit_id":"397a673c825e9677adfc1b72239106d66ef7d69f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"c32c2c83c8f63456031db881dcc57c8e9e65429c","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":"def slugify(string, truncate_ok\u003dFalse, is_provider\u003dFalse):"},{"line_number":53,"context_line":"    \"\"\"Sanitize an input string such that it\u0027s suitable for use as a resource"},{"line_number":54,"context_line":"    provider, resource class, or trait name to placement."},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    :param string: The input string to be sanitized."},{"line_number":57,"context_line":"    :param truncate_ok: Affects behavior when the slugified string exceeds the"}],"source_content_type":"text/x-python","patch_set":6,"id":"bf659307_c8a2dfae","line":54,"updated":"2018-03-28 18:26:13.000000000","message":"You should perhaps say here what is going to happen. ascii alpha goes upper, numbers preserved, everything else becomes a _\n\nThat is: define \"sanitize\" in more detail.","commit_id":"397a673c825e9677adfc1b72239106d66ef7d69f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"998165659d72af80b6c6d9aad1bf0c2f01969c7c","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":"def slugify(string, truncate_ok\u003dFalse, is_provider\u003dFalse):"},{"line_number":53,"context_line":"    \"\"\"Sanitize an input string such that it\u0027s suitable for use as a resource"},{"line_number":54,"context_line":"    provider, resource class, or trait name to placement."},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    :param string: The input string to be sanitized."},{"line_number":57,"context_line":"    :param truncate_ok: Affects behavior when the slugified string exceeds the"}],"source_content_type":"text/x-python","patch_set":6,"id":"bf659307_f769baf8","line":54,"in_reply_to":"bf659307_c8a2dfae","updated":"2018-03-28 22:05:23.000000000","message":"Yeah, considered that.  Didn\u0027t want to nail it down lest the rules change.  But if they do, the method will change, and the docstring can change with it.  So yeah.","commit_id":"397a673c825e9677adfc1b72239106d66ef7d69f"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"1f2e7b974e5ede32d07eeb6b7573b969fb35ff40","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    \"\"\"Sanitize an input string such that it\u0027s suitable for use as a resource"},{"line_number":54,"context_line":"    provider, resource class, or trait name to placement."},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    Provider names are restricted to 200 characters, but are otherwise"},{"line_number":57,"context_line":"    unaffected."},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    Resource class and trait names are limited to 255 characters, which must be"},{"line_number":60,"context_line":"    uppercase letters A-Z, digits 0-9, or underscore.  Lowercase characters in"}],"source_content_type":"text/x-python","patch_set":7,"id":"bf659307_8d2adce4","line":57,"range":{"start_line":56,"start_character":4,"end_line":57,"end_character":15},"updated":"2018-04-09 18:38:57.000000000","message":"erm, so provider names aren\u0027t slugified but other things are? This seems like poor interface design to me. How about separating the length-check stuff from the slugify transformation stuff?","commit_id":"396ca44cf2135536a4da8079b8e64b55bbee11ab"}],"nova/tests/unit/api/openstack/placement/test_lib.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"c32c2c83c8f63456031db881dcc57c8e9e65429c","unresolved":false,"context_lines":[{"line_number":19,"context_line":"# NOTE(efried): This suite takes about 5s more on my old-ish laptop if you test"},{"line_number":20,"context_line":"# the entire unicode range:"},{"line_number":21,"context_line":"# TEST_CHR_RANGE \u003d 0x10ffff"},{"line_number":22,"context_line":"# Trimming it down for prod purposes:"},{"line_number":23,"context_line":"TEST_CHR_RANGE \u003d 0x1ff"},{"line_number":24,"context_line":"ALL_CHAR_STR \u003d u\u0027\u0027.join(six.unichr(i) for i in range(TEST_CHR_RANGE))"},{"line_number":25,"context_line":"ASCII_MAP \u003d (\u0027________________________________________________\u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"bf659307_48a48fa6","line":22,"updated":"2018-03-28 18:26:13.000000000","message":"Some of the constants in the \u0027string\u0027 stdlib module might be useful, if you don\u0027t want do this longhand.","commit_id":"397a673c825e9677adfc1b72239106d66ef7d69f"}]}
