)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"67ccb4609a379a6b4596cc41c2549f1633214e11","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Also remove a call of random.seed with microsecond as its argument,"},{"line_number":14,"context_line":"which degrades random number quality.  The RNG has been initialized"},{"line_number":15,"context_line":"with os.urandom() with enough bits of randomness."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I9302c501b19aa7bf448d95b8f4bdc724c23ed0fb"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7af24918_340a8f8a","line":15,"updated":"2016-03-04 04:01:29.000000000","message":"isn\u0027t seed() still necessary in case of fork()?","commit_id":"7526146e39ada6dc7174ab1045e12523cb27457a"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"f93196e53e31384745bc6f3e95d71108d9e1d12a","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Also remove a call of random.seed with microsecond as its argument,"},{"line_number":14,"context_line":"which degrades random number quality.  The RNG has been initialized"},{"line_number":15,"context_line":"with os.urandom() with enough bits of randomness."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I9302c501b19aa7bf448d95b8f4bdc724c23ed0fb"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"fa0719c6_e7ee13b3","line":15,"in_reply_to":"7af24918_2a8503ce","updated":"2016-03-23 02:04:14.000000000","message":"have you confirmed our existing usage?","commit_id":"7526146e39ada6dc7174ab1045e12523cb27457a"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"9f264ad293975db9e895a996a06f2b0f2b8ab1ac","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Also remove a call of random.seed with microsecond as its argument,"},{"line_number":14,"context_line":"which degrades random number quality.  The RNG has been initialized"},{"line_number":15,"context_line":"with os.urandom() with enough bits of randomness."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I9302c501b19aa7bf448d95b8f4bdc724c23ed0fb"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7af24918_2a8503ce","line":15,"in_reply_to":"7af24918_340a8f8a","updated":"2016-03-04 07:59:27.000000000","message":"Seeding should be done at fork() time.\nSee oslo_service for example.","commit_id":"7526146e39ada6dc7174ab1045e12523cb27457a"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"617afe848d7365efffbcbd0a45014995a0c3db41","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Also remove a call of random.seed with microsecond as its argument,"},{"line_number":14,"context_line":"which degrades random number quality.  The RNG has been initialized"},{"line_number":15,"context_line":"with os.urandom() with enough bits of randomness."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I9302c501b19aa7bf448d95b8f4bdc724c23ed0fb"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"fa0719c6_5d5eb276","line":15,"in_reply_to":"fa0719c6_e7ee13b3","updated":"2016-03-23 03:51:27.000000000","message":"I found no offending use.","commit_id":"7526146e39ada6dc7174ab1045e12523cb27457a"}],"neutron/common/utils.py":[{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"13880306c67425c2348ad6113e00e4af6c888b46","unresolved":false,"context_lines":[{"line_number":319,"context_line":"def get_random_string(length):"},{"line_number":320,"context_line":"    \"\"\"Get a random hex string of the specified length."},{"line_number":321,"context_line":"    \"\"\""},{"line_number":322,"context_line":"    rndstr \u003d hex(random.getrandbits(length * 4))[2:]"},{"line_number":323,"context_line":"    # Whether there is a trailing \u0027L\u0027 is a py2/3 incompatibility"},{"line_number":324,"context_line":"    rndstr \u003d rndstr.rstrip(\u0027L\u0027)"},{"line_number":325,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7af24918_31958132","line":322,"updated":"2016-03-04 03:20:29.000000000","message":"this can yield a shorter string then expected, can\u0027t this?","commit_id":"7526146e39ada6dc7174ab1045e12523cb27457a"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"b4e6f89caef3f21e8c8e6da5f33aa5ff43b8dfff","unresolved":false,"context_lines":[{"line_number":319,"context_line":"def get_random_string(length):"},{"line_number":320,"context_line":"    \"\"\"Get a random hex string of the specified length."},{"line_number":321,"context_line":"    \"\"\""},{"line_number":322,"context_line":"    rndstr \u003d hex(random.getrandbits(length * 4))[2:]"},{"line_number":323,"context_line":"    # Whether there is a trailing \u0027L\u0027 is a py2/3 incompatibility"},{"line_number":324,"context_line":"    rndstr \u003d rndstr.rstrip(\u0027L\u0027)"},{"line_number":325,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7af24918_d157fd55","line":322,"in_reply_to":"7af24918_31958132","updated":"2016-03-04 03:24:15.000000000","message":"Cases with leading zero bits are handled by zfill() below.\nAny other concern?","commit_id":"7526146e39ada6dc7174ab1045e12523cb27457a"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"f6bf11160e5422a2e67ac691eae925a3f2eab09e","unresolved":false,"context_lines":[{"line_number":319,"context_line":"def get_random_string(length):"},{"line_number":320,"context_line":"    \"\"\"Get a random hex string of the specified length."},{"line_number":321,"context_line":"    \"\"\""},{"line_number":322,"context_line":"    rndstr \u003d hex(random.getrandbits(length * 4))[2:]"},{"line_number":323,"context_line":"    # Whether there is a trailing \u0027L\u0027 is a py2/3 incompatibility"},{"line_number":324,"context_line":"    rndstr \u003d rndstr.rstrip(\u0027L\u0027)"},{"line_number":325,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7af24918_9143b56b","line":322,"in_reply_to":"7af24918_d157fd55","updated":"2016-03-04 03:31:33.000000000","message":"ah, i missed it. thank you for pointing out.","commit_id":"7526146e39ada6dc7174ab1045e12523cb27457a"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"f6bf11160e5422a2e67ac691eae925a3f2eab09e","unresolved":false,"context_lines":[{"line_number":323,"context_line":"    # Whether there is a trailing \u0027L\u0027 is a py2/3 incompatibility"},{"line_number":324,"context_line":"    rndstr \u003d rndstr.rstrip(\u0027L\u0027)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    return rndstr.zfill(length)"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":""},{"line_number":329,"context_line":"def get_dhcp_agent_device_id(network_id, host):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7af24918_b15cf14b","line":326,"updated":"2016-03-04 03:31:33.000000000","message":"i don\u0027t think zfill is a good idea because we can\u0027t know which part of the result the caller will actually use.","commit_id":"7526146e39ada6dc7174ab1045e12523cb27457a"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"b22d32790ad9de55f29a861206e93ea9d292afd2","unresolved":false,"context_lines":[{"line_number":323,"context_line":"    # Whether there is a trailing \u0027L\u0027 is a py2/3 incompatibility"},{"line_number":324,"context_line":"    rndstr \u003d rndstr.rstrip(\u0027L\u0027)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    return rndstr.zfill(length)"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":""},{"line_number":329,"context_line":"def get_dhcp_agent_device_id(network_id, host):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7af24918_f4eb07da","line":326,"in_reply_to":"7af24918_94c9e3ae","updated":"2016-03-04 03:52:38.000000000","message":"i got it.  thank you for explanation.","commit_id":"7526146e39ada6dc7174ab1045e12523cb27457a"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"c1cc1ac1828aaaf973516e50da03086d42e3c2a3","unresolved":false,"context_lines":[{"line_number":323,"context_line":"    # Whether there is a trailing \u0027L\u0027 is a py2/3 incompatibility"},{"line_number":324,"context_line":"    rndstr \u003d rndstr.rstrip(\u0027L\u0027)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    return rndstr.zfill(length)"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":""},{"line_number":329,"context_line":"def get_dhcp_agent_device_id(network_id, host):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7af24918_94c9e3ae","line":326,"in_reply_to":"7af24918_b15cf14b","updated":"2016-03-04 03:42:58.000000000","message":"zfill inserts a zero only when leading 4bits of getrandbits() is zero.  And this gives uniformly distributed random hex string.  What\u0027s the problem if the return value starts with \"0\"?","commit_id":"7526146e39ada6dc7174ab1045e12523cb27457a"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"d15f33b63526310aa310ed70df2b393a59fb6d1d","unresolved":false,"context_lines":[{"line_number":317,"context_line":""},{"line_number":318,"context_line":""},{"line_number":319,"context_line":"def get_random_string(length):"},{"line_number":320,"context_line":"    \"\"\"Get a random hex string of the specified length."},{"line_number":321,"context_line":"    \"\"\""},{"line_number":322,"context_line":"    rndstr \u003d hex(random.getrandbits(length * 4))[2:]"},{"line_number":323,"context_line":"    # Whether there is a trailing \u0027L\u0027 is a py2/3 incompatibility"}],"source_content_type":"text/x-python","patch_set":2,"id":"7af24918_94b8b512","line":320,"updated":"2016-03-04 10:55:16.000000000","message":"It would be nice to document the relation between the length parameter and the number of generated entropy bits.\n\nIt looks like the function generates length*4 bits of entropy\n\nlength is also the length of the output string, right?\n\nIs it important that the output string uses printable ASCII character? Would it work to generate really random bytes?","commit_id":"a390b8fe03124262a1c12d9f268b1ee75cb093f1"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"d8332cdd2668358d8cde5210ee297e1c8ebc0b7a","unresolved":false,"context_lines":[{"line_number":317,"context_line":""},{"line_number":318,"context_line":""},{"line_number":319,"context_line":"def get_random_string(length):"},{"line_number":320,"context_line":"    \"\"\"Get a random hex string of the specified length."},{"line_number":321,"context_line":"    \"\"\""},{"line_number":322,"context_line":"    rndstr \u003d hex(random.getrandbits(length * 4))[2:]"},{"line_number":323,"context_line":"    # Whether there is a trailing \u0027L\u0027 is a py2/3 incompatibility"}],"source_content_type":"text/x-python","patch_set":2,"id":"7af24918_3389b0cb","line":320,"in_reply_to":"7af24918_94b8b512","updated":"2016-03-07 05:51:23.000000000","message":"We need length * 4 bits as one hexadecimal string needs 4bits of entropy.\n\nThe return value is used for generating random device names so on, so it\u0027s better to avoid non-printable characters.\nIt might work with any alphanumeric string, but I\u0027m not going to change that.","commit_id":"a390b8fe03124262a1c12d9f268b1ee75cb093f1"},{"author":{"_account_id":9107,"name":"Victor Stinner","email":"vstinner@redhat.com","username":"haypo"},"change_message_id":"d15f33b63526310aa310ed70df2b393a59fb6d1d","unresolved":false,"context_lines":[{"line_number":323,"context_line":"    # Whether there is a trailing \u0027L\u0027 is a py2/3 incompatibility"},{"line_number":324,"context_line":"    rndstr \u003d rndstr.rstrip(\u0027L\u0027)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    return rndstr.zfill(length)"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":""},{"line_number":329,"context_line":"def get_dhcp_agent_device_id(network_id, host):"}],"source_content_type":"text/x-python","patch_set":2,"id":"7af24918_347ba17c","line":326,"updated":"2016-03-04 10:55:16.000000000","message":"The formatting part can be splified to:\n\nvalue \u003d random.getrandbits(length * 4)\nreturn \"{0:0{1}x}\".format(value, length)\n\nformat example:\n\n\u003e\u003e\u003e \"{0:0{1}x}\".format(0xabcd, 10)\n\u0027000000abcd\u0027\n\nIt works on Python 2 and Python 3.","commit_id":"a390b8fe03124262a1c12d9f268b1ee75cb093f1"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"d8332cdd2668358d8cde5210ee297e1c8ebc0b7a","unresolved":false,"context_lines":[{"line_number":323,"context_line":"    # Whether there is a trailing \u0027L\u0027 is a py2/3 incompatibility"},{"line_number":324,"context_line":"    rndstr \u003d rndstr.rstrip(\u0027L\u0027)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    return rndstr.zfill(length)"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":""},{"line_number":329,"context_line":"def get_dhcp_agent_device_id(network_id, host):"}],"source_content_type":"text/x-python","patch_set":2,"id":"7af24918_93c084e2","line":326,"in_reply_to":"7af24918_347ba17c","updated":"2016-03-07 05:51:23.000000000","message":"Thanks.  I\u0027ll adopt your suggestion.","commit_id":"a390b8fe03124262a1c12d9f268b1ee75cb093f1"}]}
