)]}'
{"roles/collect-logs/library/ara_graphite.py":[{"author":{"_account_id":9061,"name":"David Moreau Simard","email":"moi@dmsimard.com","username":"dmsimard"},"change_message_id":"3a2c600a40c24dfddb9e064f747346a26ce29827","unresolved":false,"context_lines":[{"line_number":15,"context_line":"DOCUMENTATION \u003d \u0027\u0027\u0027"},{"line_number":16,"context_line":"---"},{"line_number":17,"context_line":"module: ara_graphite"},{"line_number":18,"context_line":"version_added: \"1.0\""},{"line_number":19,"context_line":"short_description: Send ARA stats to graphite"},{"line_number":20,"context_line":"description:"},{"line_number":21,"context_line":"    - Python ansible module to send ARA stats to graphite"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_b4bc5106","line":18,"range":{"start_line":18,"start_character":0,"end_line":18,"end_character":20},"updated":"2017-07-05 15:54:00.000000000","message":"This would be the version_added in the context of ARA, you can put something like 0.14 -- I don\u0027t think this would land in a dot release under the current 0.13 stream.","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"c2aa51d74fff1cc6d98967647678a7c91fc6b399","unresolved":false,"context_lines":[{"line_number":15,"context_line":"DOCUMENTATION \u003d \u0027\u0027\u0027"},{"line_number":16,"context_line":"---"},{"line_number":17,"context_line":"module: ara_graphite"},{"line_number":18,"context_line":"version_added: \"1.0\""},{"line_number":19,"context_line":"short_description: Send ARA stats to graphite"},{"line_number":20,"context_line":"description:"},{"line_number":21,"context_line":"    - Python ansible module to send ARA stats to graphite"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_2663b41c","line":18,"range":{"start_line":18,"start_character":0,"end_line":18,"end_character":20},"in_reply_to":"3f1d235d_b4bc5106","updated":"2017-07-12 06:13:49.000000000","message":"OK, let\u0027s change it when it will be part of ARA","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":9061,"name":"David Moreau Simard","email":"moi@dmsimard.com","username":"dmsimard"},"change_message_id":"3a2c600a40c24dfddb9e064f747346a26ce29827","unresolved":false,"context_lines":[{"line_number":23,"context_line":"  graphite_host:"},{"line_number":24,"context_line":"    description:"},{"line_number":25,"context_line":"      - The hostname of the Graphite server with optional port:"},{"line_number":26,"context_line":"        graphite.triple.com:2004. The default port is 2003"},{"line_number":27,"context_line":"    required: True"},{"line_number":28,"context_line":"  ara_mapping:"},{"line_number":29,"context_line":"    description:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_94e03528","line":26,"range":{"start_line":26,"start_character":8,"end_line":26,"end_character":32},"updated":"2017-07-05 15:54:00.000000000","message":"A generic domain would be better in terms of documentation","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"c2aa51d74fff1cc6d98967647678a7c91fc6b399","unresolved":false,"context_lines":[{"line_number":23,"context_line":"  graphite_host:"},{"line_number":24,"context_line":"    description:"},{"line_number":25,"context_line":"      - The hostname of the Graphite server with optional port:"},{"line_number":26,"context_line":"        graphite.triple.com:2004. The default port is 2003"},{"line_number":27,"context_line":"    required: True"},{"line_number":28,"context_line":"  ara_mapping:"},{"line_number":29,"context_line":"    description:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_e66c9c09","line":26,"range":{"start_line":26,"start_character":8,"end_line":26,"end_character":32},"in_reply_to":"3f1d235d_94e03528","updated":"2017-07-12 06:13:49.000000000","message":"Done","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":9061,"name":"David Moreau Simard","email":"moi@dmsimard.com","username":"dmsimard"},"change_message_id":"3a2c600a40c24dfddb9e064f747346a26ce29827","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    required: True"},{"line_number":36,"context_line":"\u0027\u0027\u0027"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"EXAMPLES \u003d \u0027\u0027\u0027"},{"line_number":39,"context_line":"- ara_grpahite:"},{"line_number":40,"context_line":"    graphite_host: 10.2.2.2"},{"line_number":41,"context_line":"    ara_data: \"{{ ara_task_output.stdout }}\""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_145c25eb","line":38,"updated":"2017-07-05 15:54:00.000000000","message":"I think I would add the task that registers the task list inside the example","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"c2aa51d74fff1cc6d98967647678a7c91fc6b399","unresolved":false,"context_lines":[{"line_number":35,"context_line":"    required: True"},{"line_number":36,"context_line":"\u0027\u0027\u0027"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"EXAMPLES \u003d \u0027\u0027\u0027"},{"line_number":39,"context_line":"- ara_grpahite:"},{"line_number":40,"context_line":"    graphite_host: 10.2.2.2"},{"line_number":41,"context_line":"    ara_data: \"{{ ara_task_output.stdout }}\""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_a676a4d7","line":38,"in_reply_to":"3f1d235d_145c25eb","updated":"2017-07-12 06:13:49.000000000","message":"Done","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":9061,"name":"David Moreau Simard","email":"moi@dmsimard.com","username":"dmsimard"},"change_message_id":"3a2c600a40c24dfddb9e064f747346a26ce29827","unresolved":false,"context_lines":[{"line_number":36,"context_line":"\u0027\u0027\u0027"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"EXAMPLES \u003d \u0027\u0027\u0027"},{"line_number":39,"context_line":"- ara_grpahite:"},{"line_number":40,"context_line":"    graphite_host: 10.2.2.2"},{"line_number":41,"context_line":"    ara_data: \"{{ ara_task_output.stdout }}\""},{"line_number":42,"context_line":"    ara_mapping:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_038ab1bd","line":39,"range":{"start_line":39,"start_character":6,"end_line":39,"end_character":14},"updated":"2017-07-05 15:54:00.000000000","message":"typo","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"c2aa51d74fff1cc6d98967647678a7c91fc6b399","unresolved":false,"context_lines":[{"line_number":36,"context_line":"\u0027\u0027\u0027"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"EXAMPLES \u003d \u0027\u0027\u0027"},{"line_number":39,"context_line":"- ara_grpahite:"},{"line_number":40,"context_line":"    graphite_host: 10.2.2.2"},{"line_number":41,"context_line":"    ara_data: \"{{ ara_task_output.stdout }}\""},{"line_number":42,"context_line":"    ara_mapping:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_e645bc71","line":39,"range":{"start_line":39,"start_character":6,"end_line":39,"end_character":14},"in_reply_to":"3f1d235d_038ab1bd","updated":"2017-07-12 06:13:49.000000000","message":"Done","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":9061,"name":"David Moreau Simard","email":"moi@dmsimard.com","username":"dmsimard"},"change_message_id":"3a2c600a40c24dfddb9e064f747346a26ce29827","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    graphite_host: 10.2.2.2"},{"line_number":41,"context_line":"    ara_data: \"{{ ara_task_output.stdout }}\""},{"line_number":42,"context_line":"    ara_mapping:"},{"line_number":43,"context_line":"        - \"overcloud-deploy : Deploy the overcloud\": overcloud.deploy.seconds"},{"line_number":44,"context_line":"\u0027\u0027\u0027"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"import datetime"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_946715b8","line":43,"range":{"start_line":43,"start_character":10,"end_line":43,"end_character":77},"updated":"2017-07-05 15:54:00.000000000","message":"I\u0027d rather use a generic mapping example","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"c2aa51d74fff1cc6d98967647678a7c91fc6b399","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    graphite_host: 10.2.2.2"},{"line_number":41,"context_line":"    ara_data: \"{{ ara_task_output.stdout }}\""},{"line_number":42,"context_line":"    ara_mapping:"},{"line_number":43,"context_line":"        - \"overcloud-deploy : Deploy the overcloud\": overcloud.deploy.seconds"},{"line_number":44,"context_line":"\u0027\u0027\u0027"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"import datetime"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_a65fc43f","line":43,"range":{"start_line":43,"start_character":10,"end_line":43,"end_character":77},"in_reply_to":"3f1d235d_946715b8","updated":"2017-07-12 06:13:49.000000000","message":"Done","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":9061,"name":"David Moreau Simard","email":"moi@dmsimard.com","username":"dmsimard"},"change_message_id":"3a2c600a40c24dfddb9e064f747346a26ce29827","unresolved":false,"context_lines":[{"line_number":49,"context_line":"import socket"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"def stamp(x):"},{"line_number":53,"context_line":"    return datetime.datetime.strptime(x, \"%Y-%m-%d %H:%M:%S\").strftime(\u0027%s\u0027)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_7af583ec","line":52,"updated":"2017-07-05 15:54:00.000000000","message":"Can you add docstrings for the functions so we know what they do ?","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"c2aa51d74fff1cc6d98967647678a7c91fc6b399","unresolved":false,"context_lines":[{"line_number":49,"context_line":"import socket"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"def stamp(x):"},{"line_number":53,"context_line":"    return datetime.datetime.strptime(x, \"%Y-%m-%d %H:%M:%S\").strftime(\u0027%s\u0027)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_0150a209","line":52,"in_reply_to":"3f1d235d_7af583ec","updated":"2017-07-12 06:13:49.000000000","message":"Done","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":9061,"name":"David Moreau Simard","email":"moi@dmsimard.com","username":"dmsimard"},"change_message_id":"3a2c600a40c24dfddb9e064f747346a26ce29827","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"def translate(mapping, json_data):"},{"line_number":63,"context_line":"    data_to_send \u003d []"},{"line_number":64,"context_line":"    data \u003d ast.literal_eval(json_data)"},{"line_number":65,"context_line":"    for task in data:"},{"line_number":66,"context_line":"        if task[\u0027Name\u0027] in mapping:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_94edd5b8","line":63,"range":{"start_line":63,"start_character":4,"end_line":63,"end_character":21},"updated":"2017-07-05 15:54:00.000000000","message":"There\u0027s data_to_send and then data2send, not really a fan of either variable names.\nWe can use a generic term like \"items \u003d []\" here, perhaps ?","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"c2aa51d74fff1cc6d98967647678a7c91fc6b399","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"def translate(mapping, json_data):"},{"line_number":63,"context_line":"    data_to_send \u003d []"},{"line_number":64,"context_line":"    data \u003d ast.literal_eval(json_data)"},{"line_number":65,"context_line":"    for task in data:"},{"line_number":66,"context_line":"        if task[\u0027Name\u0027] in mapping:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_e156c606","line":63,"range":{"start_line":63,"start_character":4,"end_line":63,"end_character":21},"in_reply_to":"3f1d235d_94edd5b8","updated":"2017-07-12 06:13:49.000000000","message":"Done","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":9061,"name":"David Moreau Simard","email":"moi@dmsimard.com","username":"dmsimard"},"change_message_id":"3a2c600a40c24dfddb9e064f747346a26ce29827","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"def translate(mapping, json_data):"},{"line_number":63,"context_line":"    data_to_send \u003d []"},{"line_number":64,"context_line":"    data \u003d ast.literal_eval(json_data)"},{"line_number":65,"context_line":"    for task in data:"},{"line_number":66,"context_line":"        if task[\u0027Name\u0027] in mapping:"},{"line_number":67,"context_line":"            timestamp, duration \u003d stamp(task[\u0027Time Start\u0027]), task_length("}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_54317d59","line":64,"range":{"start_line":64,"start_character":4,"end_line":64,"end_character":38},"updated":"2017-07-05 15:54:00.000000000","message":"Does json.loads not work ? Why an eval ?","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"be4ec32b8dc794243dd970e886fbd5d7be3ca969","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"def translate(mapping, json_data):"},{"line_number":63,"context_line":"    data_to_send \u003d []"},{"line_number":64,"context_line":"    data \u003d ast.literal_eval(json_data)"},{"line_number":65,"context_line":"    for task in data:"},{"line_number":66,"context_line":"        if task[\u0027Name\u0027] in mapping:"},{"line_number":67,"context_line":"            timestamp, duration \u003d stamp(task[\u0027Time Start\u0027]), task_length("}],"source_content_type":"text/x-python","patch_set":2,"id":"1f1a1f67_06c368ef","line":64,"range":{"start_line":64,"start_character":4,"end_line":64,"end_character":38},"in_reply_to":"1f1a1f67_65e108ff","updated":"2017-07-13 04:25:46.000000000","message":"data that you get in output is string, not list. It could be theoretically converted to list with \"to_json\" jinja filter, but it won\u0027t work with lists, only dicts.\n\n\u003e\u003e\u003e output \u003d \u0027\u0027\u0027[\n...   {\n...     \"Name\": \"setup\", \n...     \"Duration\": \"0:00:00\", \n...     \"Time Start\": \"2017-06-11 15:04:30\", \n...     \"Action\": \"setup\", \n...     \"Path\": null, \n...     \"Line\": null, \n...     \"ID\": \"685377ca-23a5-4293-a03e-87aac08f747f\"\n...   }, \n... ]\u0027\u0027\u0027\n\u003e\u003e\u003e json.loads(output)\nTraceback (most recent call last):\n  File \"\u003cpyshell#69\u003e\", line 1, in \u003cmodule\u003e\n    json.loads(output)\n  File \"/usr/lib64/python2.7/json/__init__.py\", line 338, in loads\n    return _default_decoder.decode(s)\n  File \"/usr/lib64/python2.7/json/decoder.py\", line 366, in decode\n    obj, end \u003d self.raw_decode(s, idx\u003d_w(s, 0).end())\n  File \"/usr/lib64/python2.7/json/decoder.py\", line 384, in raw_decode\n    raise ValueError(\"No JSON object could be decoded\")\nValueError: No JSON object could be decoded\n\u003e\u003e\u003e json.loads(json.dumps(output))\n4: u\u0027[\\n  {\\n    \"Name\": \"setup\", \\n    \"Duration\": \"0:00:00\", \\n    \"Time Start\": \"2017-06-11 15:04:30\", \\n    \"Action\": \"setup\", \\n    \"Path\": null, \\n    \"Line\": null, \\n    \"ID\": \"685377ca-23a5-4293-a03e-87aac08f747f\"\\n  }, \\n]\u0027\n\u003e\u003e\u003e json.loads(json.loads(json.dumps(output)))\nTraceback (most recent call last):\n  File \"\u003cpyshell#71\u003e\", line 1, in \u003cmodule\u003e\n    json.loads(json.loads(json.dumps(output)))\n  File \"/usr/lib64/python2.7/json/__init__.py\", line 338, in loads\n    return _default_decoder.decode(s)\n  File \"/usr/lib64/python2.7/json/decoder.py\", line 366, in decode\n    obj, end \u003d self.raw_decode(s, idx\u003d_w(s, 0).end())\n  File \"/usr/lib64/python2.7/json/decoder.py\", line 384, in raw_decode\n    raise ValueError(\"No JSON object could be decoded\")\nValueError: No JSON object could be decoded\n\u003e\u003e\u003e","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"c2aa51d74fff1cc6d98967647678a7c91fc6b399","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"def translate(mapping, json_data):"},{"line_number":63,"context_line":"    data_to_send \u003d []"},{"line_number":64,"context_line":"    data \u003d ast.literal_eval(json_data)"},{"line_number":65,"context_line":"    for task in data:"},{"line_number":66,"context_line":"        if task[\u0027Name\u0027] in mapping:"},{"line_number":67,"context_line":"            timestamp, duration \u003d stamp(task[\u0027Time Start\u0027]), task_length("}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_81503260","line":64,"range":{"start_line":64,"start_character":4,"end_line":64,"end_character":38},"in_reply_to":"3f1d235d_54317d59","updated":"2017-07-12 06:13:49.000000000","message":"yes, as I wrote in channel - task list is \"list\", and json expects for a dictionary.","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":9061,"name":"David Moreau Simard","email":"moi@dmsimard.com","username":"dmsimard"},"change_message_id":"dfac691e592e22b5d4a087c586ff38a8da95b5a9","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"def translate(mapping, json_data):"},{"line_number":63,"context_line":"    data_to_send \u003d []"},{"line_number":64,"context_line":"    data \u003d ast.literal_eval(json_data)"},{"line_number":65,"context_line":"    for task in data:"},{"line_number":66,"context_line":"        if task[\u0027Name\u0027] in mapping:"},{"line_number":67,"context_line":"            timestamp, duration \u003d stamp(task[\u0027Time Start\u0027]), task_length("}],"source_content_type":"text/x-python","patch_set":2,"id":"1f1a1f67_65e108ff","line":64,"range":{"start_line":64,"start_character":4,"end_line":64,"end_character":38},"in_reply_to":"3f1d235d_81503260","updated":"2017-07-12 15:10:13.000000000","message":"A list is a proper JSON format, you just need to convert it to a string first with json.dumps:\n\n    $ python\n    Python 2.7.13 (default, Jun 26 2017, 10:20:05) \n    [GCC 7.1.1 20170622 (Red Hat 7.1.1-3)] on linux2\n    Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n    \u003e\u003e\u003e import json\n    \u003e\u003e\u003e data \u003d [\u0027one\u0027, \u0027two\u0027]\n    \u003e\u003e\u003e dict \u003d json.loads(data)\n    Traceback (most recent call last):\n    File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n    File \"/usr/lib64/python2.7/json/__init__.py\", line 339, in loads\n        return _default_decoder.decode(s)\n    File \"/usr/lib64/python2.7/json/decoder.py\", line 364, in decode\n        obj, end \u003d self.raw_decode(s, idx\u003d_w(s, 0).end())\n    TypeError: expected string or buffer\n    \u003e\u003e\u003e dict \u003d json.loads(json.dumps(data))\n    \u003e\u003e\u003e dict\n    [u\u0027one\u0027, u\u0027two\u0027]","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":9061,"name":"David Moreau Simard","email":"moi@dmsimard.com","username":"dmsimard"},"change_message_id":"3a2c600a40c24dfddb9e064f747346a26ce29827","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"def send(data, gr_host, prefix):"},{"line_number":74,"context_line":"    port \u003d int(gr_host.split(\":\")[1]) if \":\" in gr_host else 2003"},{"line_number":75,"context_line":"    host \u003d gr_host.split(\":\")[0]"},{"line_number":76,"context_line":"    s \u003d socket.socket(socket.AF_INET, socket.SOCK_STREAM)"},{"line_number":77,"context_line":"    s.settimeout(3.0)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_94015509","line":74,"range":{"start_line":74,"start_character":4,"end_line":74,"end_character":65},"updated":"2017-07-05 15:54:00.000000000","message":"I feel like that the default should be handled in the function declaration or in the module bootstrap, not *inside* the function that uses it.\n\nFor example:\n[...]\n    def send(data, prefix, host, port):\n    ... or\n    def send(data, prefix, host, port\u003d2003):\n[...]\n\n[...]\n    module \u003d AnsibleModule(\n        argument_spec\u003ddict(\n            graphite_host\u003ddict(required\u003dTrue, type\u003d\u0027str\u0027),\n            graphite_port\u003ddict(required\u003dFalse, type\u003d\u0027int\u0027, default\u003d\u00272003\u0027),\n[...]\n\n[...]\n    response \u003d send(data, prefix, host, port)\n[...]","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"c2aa51d74fff1cc6d98967647678a7c91fc6b399","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"def send(data, gr_host, prefix):"},{"line_number":74,"context_line":"    port \u003d int(gr_host.split(\":\")[1]) if \":\" in gr_host else 2003"},{"line_number":75,"context_line":"    host \u003d gr_host.split(\":\")[0]"},{"line_number":76,"context_line":"    s \u003d socket.socket(socket.AF_INET, socket.SOCK_STREAM)"},{"line_number":77,"context_line":"    s.settimeout(3.0)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_a121ee4f","line":74,"range":{"start_line":74,"start_character":4,"end_line":74,"end_character":65},"in_reply_to":"3f1d235d_94015509","updated":"2017-07-12 06:13:49.000000000","message":"Done","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":9061,"name":"David Moreau Simard","email":"moi@dmsimard.com","username":"dmsimard"},"change_message_id":"3a2c600a40c24dfddb9e064f747346a26ce29827","unresolved":false,"context_lines":[{"line_number":74,"context_line":"    port \u003d int(gr_host.split(\":\")[1]) if \":\" in gr_host else 2003"},{"line_number":75,"context_line":"    host \u003d gr_host.split(\":\")[0]"},{"line_number":76,"context_line":"    s \u003d socket.socket(socket.AF_INET, socket.SOCK_STREAM)"},{"line_number":77,"context_line":"    s.settimeout(3.0)"},{"line_number":78,"context_line":"    try:"},{"line_number":79,"context_line":"        s.connect((host, port))"},{"line_number":80,"context_line":"    except (socket.timeout, socket.error):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_fa44f348","line":77,"range":{"start_line":77,"start_character":17,"end_line":77,"end_character":20},"updated":"2017-07-05 15:54:00.000000000","message":"Timeout should probably made configurable and default to 3.0 (inside the function params)","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"c2aa51d74fff1cc6d98967647678a7c91fc6b399","unresolved":false,"context_lines":[{"line_number":74,"context_line":"    port \u003d int(gr_host.split(\":\")[1]) if \":\" in gr_host else 2003"},{"line_number":75,"context_line":"    host \u003d gr_host.split(\":\")[0]"},{"line_number":76,"context_line":"    s \u003d socket.socket(socket.AF_INET, socket.SOCK_STREAM)"},{"line_number":77,"context_line":"    s.settimeout(3.0)"},{"line_number":78,"context_line":"    try:"},{"line_number":79,"context_line":"        s.connect((host, port))"},{"line_number":80,"context_line":"    except (socket.timeout, socket.error):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_61f076ca","line":77,"range":{"start_line":77,"start_character":17,"end_line":77,"end_character":20},"in_reply_to":"3f1d235d_fa44f348","updated":"2017-07-12 06:13:49.000000000","message":"It\u0027s just not to hang a lot of time, its actual value should be a little more than zero, so I\u0027d like to have it non-configurable.","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":9061,"name":"David Moreau Simard","email":"moi@dmsimard.com","username":"dmsimard"},"change_message_id":"3a2c600a40c24dfddb9e064f747346a26ce29827","unresolved":false,"context_lines":[{"line_number":93,"context_line":"            \u0027changed\u0027: False,"},{"line_number":94,"context_line":"            \u0027failed\u0027: True,"},{"line_number":95,"context_line":"            \u0027graphite_host\u0027: gr_host,"},{"line_number":96,"context_line":"            \u0027msg\u0027: \"Can\u0027t connect to Graphite\""},{"line_number":97,"context_line":"        }"},{"line_number":98,"context_line":"    return {"},{"line_number":99,"context_line":"        \u0027changed\u0027: True,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_7aa7c30c","line":96,"range":{"start_line":96,"start_character":19,"end_line":96,"end_character":46},"updated":"2017-07-05 15:54:00.000000000","message":"Can we add any valuable input here ? Can we rope in the exception message raised by the try/except ?","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"c2aa51d74fff1cc6d98967647678a7c91fc6b399","unresolved":false,"context_lines":[{"line_number":93,"context_line":"            \u0027changed\u0027: False,"},{"line_number":94,"context_line":"            \u0027failed\u0027: True,"},{"line_number":95,"context_line":"            \u0027graphite_host\u0027: gr_host,"},{"line_number":96,"context_line":"            \u0027msg\u0027: \"Can\u0027t connect to Graphite\""},{"line_number":97,"context_line":"        }"},{"line_number":98,"context_line":"    return {"},{"line_number":99,"context_line":"        \u0027changed\u0027: True,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_e134864c","line":96,"range":{"start_line":96,"start_character":19,"end_line":96,"end_character":46},"in_reply_to":"3f1d235d_7aa7c30c","updated":"2017-07-12 06:13:49.000000000","message":"I\u0027m not sure it\u0027s required, but ok..","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":9061,"name":"David Moreau Simard","email":"moi@dmsimard.com","username":"dmsimard"},"change_message_id":"3a2c600a40c24dfddb9e064f747346a26ce29827","unresolved":false,"context_lines":[{"line_number":98,"context_line":"    return {"},{"line_number":99,"context_line":"        \u0027changed\u0027: True,"},{"line_number":100,"context_line":"        \u0027graphite_host\u0027: gr_host,"},{"line_number":101,"context_line":"        \u0027sent_data\u0027: data2send,"},{"line_number":102,"context_line":"    }"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_3a96eb94","line":101,"range":{"start_line":101,"start_character":21,"end_line":101,"end_character":30},"updated":"2017-07-05 15:54:00.000000000","message":"This is probably huge ? I\u0027m not sure we want to include it in the return output.","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"c2aa51d74fff1cc6d98967647678a7c91fc6b399","unresolved":false,"context_lines":[{"line_number":98,"context_line":"    return {"},{"line_number":99,"context_line":"        \u0027changed\u0027: True,"},{"line_number":100,"context_line":"        \u0027graphite_host\u0027: gr_host,"},{"line_number":101,"context_line":"        \u0027sent_data\u0027: data2send,"},{"line_number":102,"context_line":"    }"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_011782a5","line":101,"range":{"start_line":101,"start_character":21,"end_line":101,"end_character":30},"in_reply_to":"3f1d235d_3a96eb94","updated":"2017-07-12 06:13:49.000000000","message":"Not really, for example we track only 5-6 tasks. It\u0027ll be also not simple to write long mappings.. But I\u0027m open to suggestions, maybe to print only task names or graphite paths?","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":9061,"name":"David Moreau Simard","email":"moi@dmsimard.com","username":"dmsimard"},"change_message_id":"3a2c600a40c24dfddb9e064f747346a26ce29827","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        \u0027sent_data\u0027: data2send,"},{"line_number":102,"context_line":"    }"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"def main():"},{"line_number":106,"context_line":"    module \u003d AnsibleModule("},{"line_number":107,"context_line":"        argument_spec\u003ddict("}],"source_content_type":"text/x-python","patch_set":2,"id":"3f1d235d_d47b4d25","line":104,"updated":"2017-07-05 15:54:00.000000000","message":"(Unrelated but for context) in terms of drivers, all of the above would represent the driver I was talking about and then the Ansible module (or Ansible callback) would import and use the driver.","commit_id":"fc56fd11eddf871d65dd81e159c31c6a0a5a0e5b"},{"author":{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},"change_message_id":"0d9852956e6a1adedb04efbcaf3100353e606351","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/usr/bin/env python"},{"line_number":2,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":3,"context_line":"# you may not use this file except in compliance with the License."},{"line_number":4,"context_line":"# You may obtain a copy of the License at"}],"source_content_type":"text/x-python","patch_set":12,"id":"1f485f77_e9bb88e2","line":1,"updated":"2017-11-12 15:55:06.000000000","message":"This seems like something that should be in ARA not quickstart","commit_id":"20e7f3fa36c3e5c53e8ff76b9bdc07e0a4068995"},{"author":{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},"change_message_id":"ba76a0479f62a245573bd94eae22ed05522b79f5","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/usr/bin/env python"},{"line_number":2,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":3,"context_line":"# you may not use this file except in compliance with the License."},{"line_number":4,"context_line":"# You may obtain a copy of the License at"}],"source_content_type":"text/x-python","patch_set":12,"id":"1f485f77_b5a10349","line":1,"in_reply_to":"1f485f77_526b0584","updated":"2017-11-15 19:08:19.000000000","message":"I\u0027m just talking about the delivery of the file. I appreciate the desire to collect metrics but I\u0027d rather see we do it right the first time as we already have enough tech-debt.","commit_id":"20e7f3fa36c3e5c53e8ff76b9bdc07e0a4068995"},{"author":{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},"change_message_id":"e5023fb7a4897995edea2c8f892f7d9b23b08580","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/usr/bin/env python"},{"line_number":2,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":3,"context_line":"# you may not use this file except in compliance with the License."},{"line_number":4,"context_line":"# You may obtain a copy of the License at"}],"source_content_type":"text/x-python","patch_set":12,"id":"1f485f77_df0c9eed","line":1,"in_reply_to":"1f485f77_9c751467","updated":"2017-11-15 17:53:52.000000000","message":"In the mean time why can\u0027t it go in some sort of contrib/ folder in ARA? I really don\u0027t think this belongs here at all","commit_id":"20e7f3fa36c3e5c53e8ff76b9bdc07e0a4068995"},{"author":{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},"change_message_id":"00850950e840f1f106fbb9d70dea5a2675a9e950","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/usr/bin/env python"},{"line_number":2,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":3,"context_line":"# you may not use this file except in compliance with the License."},{"line_number":4,"context_line":"# You may obtain a copy of the License at"}],"source_content_type":"text/x-python","patch_set":12,"id":"1f485f77_a5caf04a","line":1,"in_reply_to":"1f485f77_a1230556","updated":"2017-11-15 22:11:23.000000000","message":"Not run it from ARA, ARA provides the library that this playbook would leverage. I chatted with sdoran about this concept and in theory if it was dropped into /usr/share/ansible/plugins/\u003cplugin type\u003e it in theory might work. So installing this as an ara-ansible-plugin or something. Basically with it living here in oooq-extras, no one outside of quickstart can leverage this functionality without copy-pasting it into their own roles. This is a problem with the structure of oooq-extras so rather than deal with all of that, I was wondering if there was a better way to organize just this part.  I\u0027m not -1 on this necessarily, but I am asking if there\u0027s a better way to organize this such that others can benefit from this work.  Additionally if ARA changes their json output, we aren\u0027t immediately broken by it because they would be able to change it at the same time.  This code really seems to be more tightly coupled to ARA than anything quickstart related.","commit_id":"20e7f3fa36c3e5c53e8ff76b9bdc07e0a4068995"},{"author":{"_account_id":9061,"name":"David Moreau Simard","email":"moi@dmsimard.com","username":"dmsimard"},"change_message_id":"7db114056d80bd44e0113b1f609f90d906bdc3f6","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/usr/bin/env python"},{"line_number":2,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":3,"context_line":"# you may not use this file except in compliance with the License."},{"line_number":4,"context_line":"# You may obtain a copy of the License at"}],"source_content_type":"text/x-python","patch_set":12,"id":"ff82abbf_98c75b46","line":1,"in_reply_to":"1f485f77_a5caf04a","updated":"2017-11-23 15:46:38.000000000","message":"It\u0027s a fairly common practice to carry extra modules or plugins in-tree, Ansible allows for that automatically out the box and it\u0027s a great feature.\n\nOpenshift-Ansible has an interesting and clever approach for this. They have a role, which is basically empty, but contains all their custom plugins and modules [1].\n\nWhen they require these modules in other roles, they include the role as a dependency [2] and they are automatically able to use anything from that role.\nWe chose the same approach for sharing a module between multiple roles in Zuul v3 [3].\n\nNow, about ARA and graphite...\nI think the problem here is that the master branch of ARA is frozen except for bug fixes while the next *major* version is being worked on, 1.0.\n\nOne of the primary goals of 1.0 is to have a common \"driver\" interface for exporting data out of ARA. This is something that would make writing a \"driver\" for exporting to graphite easy and I would be happy to receive a patch like that.\n\n1.0 won\u0027t be ready for a while still, certainly not before the holidays. There is a feature/1.0 branch [4] that is not broken at all, each commit is unit and integration tested, but there is no guaranteed stability so I don\u0027t really encourage you to use it.\n\nAn eventual implementation of graphite export in ARA wouldn\u0027t be in the shape of a module like this. I think carrying this in-tree is a compromise and not a permanent solution.\nThat said, the compatibility in the current stable release of ARA (0.15.x) is guaranteed. If there is an issue, perhaps introduced by a new version of Ansible, for example, then we\u0027ll fix it.\n\n[1]: https://github.com/openshift/openshift-ansible/tree/master/roles/lib_openshift\n[2]: https://github.com/openshift/openshift-ansible/blob/d2853aeb1c5afc67d0cc27a91c093f1e737e654a/roles/openshift_hosted/meta/main.yml#L16\n[3]: https://github.com/openstack-infra/project-config/tree/master/roles/submit-log-processor-jobs\n[4]: https://github.com/openstack/ara/tree/feature/1.0","commit_id":"20e7f3fa36c3e5c53e8ff76b9bdc07e0a4068995"},{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"43c74958f374fc34aa72acf8e97fb728779db377","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/usr/bin/env python"},{"line_number":2,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":3,"context_line":"# you may not use this file except in compliance with the License."},{"line_number":4,"context_line":"# You may obtain a copy of the License at"}],"source_content_type":"text/x-python","patch_set":12,"id":"1f485f77_a1230556","line":1,"in_reply_to":"1f485f77_b5a10349","updated":"2017-11-15 21:24:00.000000000","message":"Delivery of this file (ara_graphite.py)? But this is ansible module, how do you want it to run from ara? Sorry, I\u0027m confused.","commit_id":"20e7f3fa36c3e5c53e8ff76b9bdc07e0a4068995"},{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"9aae3af5cffa4c9b302ad2e6fc9ac8173b73591f","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/usr/bin/env python"},{"line_number":2,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":3,"context_line":"# you may not use this file except in compliance with the License."},{"line_number":4,"context_line":"# You may obtain a copy of the License at"}],"source_content_type":"text/x-python","patch_set":12,"id":"1f485f77_526b0584","line":1,"in_reply_to":"1f485f77_df0c9eed","updated":"2017-11-15 18:22:47.000000000","message":"I think it\u0027s much more than adding folder to ara. It\u0027s better to start collecting metrics ASAP, we don\u0027t have them at all now. When it will be possible to integrate it in ara, we can remove this of course. But for now let\u0027s use the ready solution.","commit_id":"20e7f3fa36c3e5c53e8ff76b9bdc07e0a4068995"},{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"dff804ec3f3c5cf542d93bda1aea7631d44a0651","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/usr/bin/env python"},{"line_number":2,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":3,"context_line":"# you may not use this file except in compliance with the License."},{"line_number":4,"context_line":"# You may obtain a copy of the License at"}],"source_content_type":"text/x-python","patch_set":12,"id":"1f485f77_9c751467","line":1,"in_reply_to":"1f485f77_e9bb88e2","updated":"2017-11-15 17:19:19.000000000","message":"Yeah, we talked about it with @dmsimard, and in some point we\u0027ll move it to ARA when it will support plugins.","commit_id":"20e7f3fa36c3e5c53e8ff76b9bdc07e0a4068995"},{"author":{"_account_id":14985,"name":"Alex Schultz","email":"aschultz@next-development.com","username":"mwhahaha"},"change_message_id":"989341241d322fa7f49f9d2a67c35bb735dedf84","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#!/usr/bin/env python"},{"line_number":2,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":3,"context_line":"# you may not use this file except in compliance with the License."},{"line_number":4,"context_line":"# You may obtain a copy of the License at"}],"source_content_type":"text/x-python","patch_set":12,"id":"ff82abbf_6be36ada","line":1,"in_reply_to":"ff82abbf_98c75b46","updated":"2017-11-27 15:56:41.000000000","message":"Right after we had this discussion and the empty role thing was essentially what was recommended for ways of distributing this. The problem is that because oooq-extras does not dynamically pull in other roles this is being included here. Since the interfaces that this is relying on are coming from ARA it seems like this should be an ansible module under the ARA umbrella and not under oooq-extras.  Another interesting rub is that this needs to be installed prior to the execution of the ansible playbooks which is why this needs to live here. I\u0027d personally like to see this moved under the ARA ownership or replaced by functionality in ARA and removed from oooq.  We\u0027re working around lack of ownership and ansible quirks by including this here and I don\u0027t agree that in the long term it should continue to live here.  That being said, it\u0027d be nice to get these numbers ASAP so we should document this techdebt with a bug and move on.","commit_id":"20e7f3fa36c3e5c53e8ff76b9bdc07e0a4068995"}]}
