)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"a2e85bd9642ccf2e4e46620aed54532af6a94aeb","unresolved":false,"context_lines":[{"line_number":13,"context_line":"  {driver: set([host1, host2, ...]), ...}"},{"line_number":14,"context_line":"rather than just a set of hosts."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: Ie327aa7d9207f6f5da1380631dbbc431dfd7e218"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"AAAATn%2F9nLc%3D","line":16,"updated":"2013-12-09 17:27:09.000000000","message":"Needs link to https://blueprints.launchpad.net/ironic/+spec/instance-mapping-by-consistent-hash ?","commit_id":"a346b7bc0893406e34208b71f705f58604853545"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"e131e46dc6f34e6421efe73cd6677695fc2b65d1","unresolved":false,"context_lines":[{"line_number":13,"context_line":"  {driver: set([host1, host2, ...]), ...}"},{"line_number":14,"context_line":"rather than just a set of hosts."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: Ie327aa7d9207f6f5da1380631dbbc431dfd7e218"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"AAAATn%2F9lT0%3D","line":16,"in_reply_to":"AAAATn%2F9nLc%3D","updated":"2013-12-10 00:30:17.000000000","message":"Done","commit_id":"a346b7bc0893406e34208b71f705f58604853545"}],"ironic/common/hash_ring.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"b772956dc89bb73edadfd36aee416b23e5a92c8b","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    def __init__(self, hosts, replicas\u003dCONF.hash_distribution_replicas):"},{"line_number":48,"context_line":"        \"\"\"Create a new hash ring across the specified hosts."},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        :param hosts: list of hosts which will be mapped"},{"line_number":51,"context_line":"        :param replicas: number of hosts to map to each hash partition,"},{"line_number":52,"context_line":"                         or len(hosts), which ever is lesser."},{"line_number":53,"context_line":"                         Default: CONF.hash_distribution_replicas"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F90P4%3D","side":"PARENT","line":50,"updated":"2013-12-05 16:13:37.000000000","message":"We prefer that a list is passed, so we don\u0027t want to explicitly mention here that a singleton host is OK?","commit_id":"212f1063e9c535b708432a1f0ea3711618faeb3a"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"e131e46dc6f34e6421efe73cd6677695fc2b65d1","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    def __init__(self, hosts, replicas\u003dCONF.hash_distribution_replicas):"},{"line_number":48,"context_line":"        \"\"\"Create a new hash ring across the specified hosts."},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        :param hosts: list of hosts which will be mapped"},{"line_number":51,"context_line":"        :param replicas: number of hosts to map to each hash partition,"},{"line_number":52,"context_line":"                         or len(hosts), which ever is lesser."},{"line_number":53,"context_line":"                         Default: CONF.hash_distribution_replicas"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F9lTY%3D","side":"PARENT","line":50,"in_reply_to":"AAAATn%2F90P4%3D","updated":"2013-12-10 00:30:17.000000000","message":"Actually, I added the convert-to-list because a set is being passed in now. I\u0027ll update the doc string to note that it will accept non-list input.","commit_id":"212f1063e9c535b708432a1f0ea3711618faeb3a"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"7e564f661a0141d302e197b43835fa4e4aab30a3","unresolved":false,"context_lines":[{"line_number":54,"context_line":"                         Default: CONF.hash_distribution_replicas"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"        \"\"\""},{"line_number":57,"context_line":"        self.hosts \u003d hosts if isinstance(hosts, list) else list(hosts)"},{"line_number":58,"context_line":"        self.replicas \u003d replicas if replicas \u003c\u003d len(hosts) else len(hosts)"},{"line_number":59,"context_line":"        self.partition_shift \u003d 32 - CONF.hash_partition_exponent"},{"line_number":60,"context_line":"        self.part2host \u003d array.array(\u0027H\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9lJM%3D","line":57,"updated":"2013-12-10 00:59:27.000000000","message":"This won\u0027t do the right thing if hosts is a single hostname.\n\n\u003e\u003e\u003e hosts\u003d\"foo\"\n\u003e\u003e\u003e print hosts if isinstance(hosts, list) else list(hosts)\n[\u0027f\u0027, \u0027o\u0027, \u0027o\u0027]\n\n\nI think your docstring should not say \u0027or a single host name\u0027, but instead just say \u0027An iterable of hostnames to map.\u0027","commit_id":"ce0ec4c95dd788f75462f7479bd7357edca19698"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"59b9e1e8ea0f49bde59a95ab74660e9cc412f260","unresolved":false,"context_lines":[{"line_number":54,"context_line":"                         Default: CONF.hash_distribution_replicas"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"        \"\"\""},{"line_number":57,"context_line":"        self.hosts \u003d hosts if isinstance(hosts, list) else list(hosts)"},{"line_number":58,"context_line":"        self.replicas \u003d replicas if replicas \u003c\u003d len(hosts) else len(hosts)"},{"line_number":59,"context_line":"        self.partition_shift \u003d 32 - CONF.hash_partition_exponent"},{"line_number":60,"context_line":"        self.part2host \u003d array.array(\u0027H\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9k4I%3D","line":57,"in_reply_to":"AAAATn%2F9lJM%3D","updated":"2013-12-10 02:28:19.000000000","message":"Ah! Right.","commit_id":"ce0ec4c95dd788f75462f7479bd7357edca19698"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"17e5d4060b867d960c8548d58fce529008ac22b1","unresolved":false,"context_lines":[{"line_number":53,"context_line":"                         Default: CONF.hash_distribution_replicas"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        \"\"\""},{"line_number":56,"context_line":"        self.hosts \u003d hosts if isinstance(hosts, list) else list(hosts)"},{"line_number":57,"context_line":"        self.replicas \u003d replicas if replicas \u003c\u003d len(hosts) else len(hosts)"},{"line_number":58,"context_line":"        self.partition_shift \u003d 32 - CONF.hash_partition_exponent"},{"line_number":59,"context_line":"        self.part2host \u003d array.array(\u0027H\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATn%2F9ksw%3D","line":56,"updated":"2013-12-10 03:39:17.000000000","message":"Maybe I\u0027m too tired now, but didn\u0027t you want to eg change this from list(hosts) to [hosts]? (comment from lifeless)","commit_id":"c9aa26d555d7b9bd0603971cbbea3fe39db48312"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"13381b42785a593ee22221fc2a00066077f86985","unresolved":false,"context_lines":[{"line_number":53,"context_line":"                         Default: CONF.hash_distribution_replicas"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        \"\"\""},{"line_number":56,"context_line":"        self.hosts \u003d hosts if isinstance(hosts, list) else list(hosts)"},{"line_number":57,"context_line":"        self.replicas \u003d replicas if replicas \u003c\u003d len(hosts) else len(hosts)"},{"line_number":58,"context_line":"        self.partition_shift \u003d 32 - CONF.hash_partition_exponent"},{"line_number":59,"context_line":"        self.part2host \u003d array.array(\u0027H\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATn%2F9h58%3D","line":56,"in_reply_to":"AAAATn%2F9ksw%3D","updated":"2013-12-10 15:02:46.000000000","message":"Sorry, I *was* too tired. This doesn\u0027t support a single host, so it is fine. d\u0027oh!","commit_id":"c9aa26d555d7b9bd0603971cbbea3fe39db48312"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"7ec7f0a07eaed28cf5267dc703ee1be141ebe0d3","unresolved":false,"context_lines":[{"line_number":53,"context_line":"                         Default: CONF.hash_distribution_replicas"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        \"\"\""},{"line_number":56,"context_line":"        self.hosts \u003d hosts if isinstance(hosts, list) else list(hosts)"},{"line_number":57,"context_line":"        self.replicas \u003d replicas if replicas \u003c\u003d len(hosts) else len(hosts)"},{"line_number":58,"context_line":"        self.partition_shift \u003d 32 - CONF.hash_partition_exponent"},{"line_number":59,"context_line":"        self.part2host \u003d array.array(\u0027H\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9F9o%3D","line":56,"updated":"2013-12-16 21:17:32.000000000","message":"list([1,2,3,4])\nis pretty damn cheap:\n\n python -m  timeit -s \"input\u003d[object()]*10000\" \"list(input)\"\n 10000 loops, best of 3: 38.6 usec per loop\n\n38 usecs to copy a 10000 long list. So IMO this should just be:\n\n self.hosts \u003d list(hosts)\n\nas it\u0027s much clearer.","commit_id":"2a8de5a26efa88aefae843bb2e81c5f0a247237d"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"d4c46378c95d4df347cb58f9915168c741effc99","unresolved":false,"context_lines":[{"line_number":53,"context_line":"                         Default: CONF.hash_distribution_replicas"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        \"\"\""},{"line_number":56,"context_line":"        self.hosts \u003d hosts if isinstance(hosts, list) else list(hosts)"},{"line_number":57,"context_line":"        self.replicas \u003d replicas if replicas \u003c\u003d len(hosts) else len(hosts)"},{"line_number":58,"context_line":"        self.partition_shift \u003d 32 - CONF.hash_partition_exponent"},{"line_number":59,"context_line":"        self.part2host \u003d array.array(\u0027H\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9Ae8%3D","line":56,"in_reply_to":"AAAATn%2F9F9o%3D","updated":"2013-12-17 19:30:34.000000000","message":"Done","commit_id":"2a8de5a26efa88aefae843bb2e81c5f0a247237d"}],"ironic/db/api.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"495f712abd4b080d61f076511eab035a81aef3fe","unresolved":false,"context_lines":[{"line_number":336,"context_line":"        \"\"\""},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    @abc.abstractmethod"},{"line_number":339,"context_line":"    def list_active_conductor_drivers(self, interval):"},{"line_number":340,"context_line":"        \"\"\"Retrieve a list of drivers supported by the registered conductors."},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"        :param interval: Time since last check-in of a conductor."}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F90ds%3D","side":"PARENT","line":339,"updated":"2013-12-05 16:10:56.000000000","message":"I was wondering whether it would be clearer to rename this since it isn\u0027t a list being returned. Looking through the rest of this file, it also seems like this may be the odd method out; there are a lot of get_* methods, but this is the only one that is list_*. How about get_active_conductor_drivers? (I\u0027d prefer get_drivers_of_active_conductors but that\u0027s probably too long, and get_drivers doesn\u0027t work cuz there might be drivers not associated with any conductors?)","commit_id":"212f1063e9c535b708432a1f0ea3711618faeb3a"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"e131e46dc6f34e6421efe73cd6677695fc2b65d1","unresolved":false,"context_lines":[{"line_number":336,"context_line":"        \"\"\""},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    @abc.abstractmethod"},{"line_number":339,"context_line":"    def list_active_conductor_drivers(self, interval):"},{"line_number":340,"context_line":"        \"\"\"Retrieve a list of drivers supported by the registered conductors."},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"        :param interval: Time since last check-in of a conductor."}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F9lOU%3D","side":"PARENT","line":339,"in_reply_to":"AAAATn%2F90ds%3D","updated":"2013-12-10 00:30:17.000000000","message":"Fair point. How about get_active_driver_dict?","commit_id":"212f1063e9c535b708432a1f0ea3711618faeb3a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"495f712abd4b080d61f076511eab035a81aef3fe","unresolved":false,"context_lines":[{"line_number":341,"context_line":"        registered and active conductors."},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"        :param interval: Time since last check-in of a conductor."},{"line_number":344,"context_line":"        :returns: A dict mapping driver names to the hosts which support them."},{"line_number":345,"context_line":"                  Eg, {driverA: [host1, host2], driverB: [host3]}"},{"line_number":346,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F90Z8%3D","line":344,"updated":"2013-12-05 16:10:56.000000000","message":"Would it be better to be explicit about eg \"the (set of) hosts\". Otherwise someone might assume it is a list of hosts.\n\nI suppose the example could be changed to eg set(host1, host2)?","commit_id":"a346b7bc0893406e34208b71f705f58604853545"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"e131e46dc6f34e6421efe73cd6677695fc2b65d1","unresolved":false,"context_lines":[{"line_number":341,"context_line":"        registered and active conductors."},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"        :param interval: Time since last check-in of a conductor."},{"line_number":344,"context_line":"        :returns: A dict mapping driver names to the hosts which support them."},{"line_number":345,"context_line":"                  Eg, {driverA: [host1, host2], driverB: [host3]}"},{"line_number":346,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F9lOY%3D","line":344,"in_reply_to":"AAAATn%2F90Z8%3D","updated":"2013-12-10 00:30:17.000000000","message":"Done","commit_id":"a346b7bc0893406e34208b71f705f58604853545"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"17e5d4060b867d960c8548d58fce529008ac22b1","unresolved":false,"context_lines":[{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    @abc.abstractmethod"},{"line_number":339,"context_line":"    def get_active_driver_dict(self, interval):"},{"line_number":340,"context_line":"        \"\"\"Retrieve a lists of drivers supported by the"},{"line_number":341,"context_line":"        registered and active conductors."},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"        :param interval: Time since last check-in of a conductor."}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATn%2F9krk%3D","line":340,"updated":"2013-12-10 03:39:17.000000000","message":"This is better, thx! Although I\u0027d probably remove \u0027a lists of\u0027, or change \u0027lists\u0027 to \u0027list\u0027.","commit_id":"c9aa26d555d7b9bd0603971cbbea3fe39db48312"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"f0499c836014cdbfcb82dd411bd1fe44283b0a8b","unresolved":false,"context_lines":[{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    @abc.abstractmethod"},{"line_number":339,"context_line":"    def get_active_driver_dict(self, interval):"},{"line_number":340,"context_line":"        \"\"\"Retrieve a lists of drivers supported by the"},{"line_number":341,"context_line":"        registered and active conductors."},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"        :param interval: Time since last check-in of a conductor."}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATn%2F9Nos%3D","line":340,"in_reply_to":"AAAATn%2F9krk%3D","updated":"2013-12-13 23:26:04.000000000","message":"Done","commit_id":"c9aa26d555d7b9bd0603971cbbea3fe39db48312"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"17e5d4060b867d960c8548d58fce529008ac22b1","unresolved":false,"context_lines":[{"line_number":343,"context_line":"        :param interval: Time since last check-in of a conductor."},{"line_number":344,"context_line":"        :returns: A dict which maps driver names to the set of hosts"},{"line_number":345,"context_line":"                  which support them. For example:"},{"line_number":346,"context_line":"                    {driverA: set([host1, host2]),"},{"line_number":347,"context_line":"                     driverB: set([host2, host3])}"},{"line_number":348,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATn%2F9krg%3D","line":346,"updated":"2013-12-10 03:39:17.000000000","message":"probably don\u0027t need the \u0027[\u0027 and \u0027]\u0027 surrounding host1 \u0026 host2.","commit_id":"c9aa26d555d7b9bd0603971cbbea3fe39db48312"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"13381b42785a593ee22221fc2a00066077f86985","unresolved":false,"context_lines":[{"line_number":343,"context_line":"        :param interval: Time since last check-in of a conductor."},{"line_number":344,"context_line":"        :returns: A dict which maps driver names to the set of hosts"},{"line_number":345,"context_line":"                  which support them. For example:"},{"line_number":346,"context_line":"                    {driverA: set([host1, host2]),"},{"line_number":347,"context_line":"                     driverB: set([host2, host3])}"},{"line_number":348,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATn%2F9h5Y%3D","line":346,"in_reply_to":"AAAATn%2F9jbY%3D","updated":"2013-12-10 15:02:46.000000000","message":"d\u0027oh again! Thx Lucas, for correcting me!","commit_id":"c9aa26d555d7b9bd0603971cbbea3fe39db48312"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"a6a86c35b20229d0d3727b69108e6f626c7bcfcc","unresolved":false,"context_lines":[{"line_number":343,"context_line":"        :param interval: Time since last check-in of a conductor."},{"line_number":344,"context_line":"        :returns: A dict which maps driver names to the set of hosts"},{"line_number":345,"context_line":"                  which support them. For example:"},{"line_number":346,"context_line":"                    {driverA: set([host1, host2]),"},{"line_number":347,"context_line":"                     driverB: set([host2, host3])}"},{"line_number":348,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAATn%2F9jbY%3D","line":346,"in_reply_to":"AAAATn%2F9krg%3D","updated":"2013-12-10 10:20:43.000000000","message":"Hi ruby,\n\nI think we should keep the brackets. That\u0027s how the set object is represented in python. Also it makes clear that a set() is a list, a list that contains no duplicated item in it.\n\nrepr(a) \u003d\u003e \u0027set([1, 2, 3, 4, 5])\u0027","commit_id":"c9aa26d555d7b9bd0603971cbbea3fe39db48312"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"7ec7f0a07eaed28cf5267dc703ee1be141ebe0d3","unresolved":false,"context_lines":[{"line_number":338,"context_line":"    @abc.abstractmethod"},{"line_number":339,"context_line":"    def get_active_driver_dict(self, interval):"},{"line_number":340,"context_line":"        \"\"\"Retrieve the drivers which are supported by the"},{"line_number":341,"context_line":"        registered and active conductors."},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"        :param interval: Time since last check-in of a conductor."},{"line_number":344,"context_line":"        :returns: A dict which maps driver names to the set of hosts"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9GFk%3D","line":341,"updated":"2013-12-16 21:17:32.000000000","message":"This is invalid per PEP-257 - it needs to be one line.\n\n\"\"\"Get drivers for active registered conductors.\"\"\"","commit_id":"2a8de5a26efa88aefae843bb2e81c5f0a247237d"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"d4c46378c95d4df347cb58f9915168c741effc99","unresolved":false,"context_lines":[{"line_number":338,"context_line":"    @abc.abstractmethod"},{"line_number":339,"context_line":"    def get_active_driver_dict(self, interval):"},{"line_number":340,"context_line":"        \"\"\"Retrieve the drivers which are supported by the"},{"line_number":341,"context_line":"        registered and active conductors."},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"        :param interval: Time since last check-in of a conductor."},{"line_number":344,"context_line":"        :returns: A dict which maps driver names to the set of hosts"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9Af0%3D","line":341,"in_reply_to":"AAAATn%2F9GFk%3D","updated":"2013-12-17 19:30:34.000000000","message":"Eh? it\u0027s a multi-line doc string including :param: list ... but I agree that this line could be more succinct.","commit_id":"2a8de5a26efa88aefae843bb2e81c5f0a247237d"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"15da902cbbba734fd8b016175cfbeb00f4ae8fa5","unresolved":false,"context_lines":[{"line_number":340,"context_line":"        \"\"\"Retrieve the drivers which are supported by the"},{"line_number":341,"context_line":"        registered and active conductors."},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"        :param interval: Time since last check-in of a conductor."},{"line_number":344,"context_line":"        :returns: A dict which maps driver names to the set of hosts"},{"line_number":345,"context_line":"                  which support them. For example:"},{"line_number":346,"context_line":"                    {driverA: set([host1, host2]),"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9JHI%3D","line":343,"updated":"2013-12-16 11:51:36.000000000","message":"I know this docstring wasn\u0027t introduced in this patch but I think it worth saying that we are using seconds here.\n\n\"Time in seconds since last check-in of a conductor\"","commit_id":"2a8de5a26efa88aefae843bb2e81c5f0a247237d"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"d4c46378c95d4df347cb58f9915168c741effc99","unresolved":false,"context_lines":[{"line_number":340,"context_line":"        \"\"\"Retrieve the drivers which are supported by the"},{"line_number":341,"context_line":"        registered and active conductors."},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"        :param interval: Time since last check-in of a conductor."},{"line_number":344,"context_line":"        :returns: A dict which maps driver names to the set of hosts"},{"line_number":345,"context_line":"                  which support them. For example:"},{"line_number":346,"context_line":"                    {driverA: set([host1, host2]),"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9Afw%3D","line":343,"in_reply_to":"AAAATn%2F9JHI%3D","updated":"2013-12-17 19:30:34.000000000","message":"Done","commit_id":"2a8de5a26efa88aefae843bb2e81c5f0a247237d"},{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"499298b4b0495b593362d5eba8465bd84d1aa0ef","unresolved":false,"context_lines":[{"line_number":340,"context_line":"        \"\"\"Retrieve the drivers which are supported by the"},{"line_number":341,"context_line":"        registered and active conductors."},{"line_number":342,"context_line":""},{"line_number":343,"context_line":"        :param interval: Time since last check-in of a conductor."},{"line_number":344,"context_line":"        :returns: A dict which maps driver names to the set of hosts"},{"line_number":345,"context_line":"                  which support them. For example:"},{"line_number":346,"context_line":"                    {driverA: set([host1, host2]),"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9JBw%3D","line":343,"in_reply_to":"AAAATn%2F9JHI%3D","updated":"2013-12-16 12:09:17.000000000","message":"I agree with Lucas. Actually I was going to write the same comment, then decided that implementation is clear enough to not to mention this here. But if it came in mind to more than one person then probably better to have this \u003d)","commit_id":"2a8de5a26efa88aefae843bb2e81c5f0a247237d"}],"ironic/db/sqlalchemy/api.py":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"a3151207e5be075b5d0a9caf0dd4f9b8295443b7","unresolved":false,"context_lines":[{"line_number":543,"context_line":""},{"line_number":544,"context_line":"    def list_active_conductor_drivers(self, interval):"},{"line_number":545,"context_line":"        # TODO(deva): add configurable default \u0027interval\u0027, somewhere higher"},{"line_number":546,"context_line":"        #             up the code. This isn\u0027t a db-specific option."},{"line_number":547,"context_line":"        limit \u003d timeutils.utcnow() - datetime.timedelta(seconds\u003dinterval)"},{"line_number":548,"context_line":"        result \u003d model_query(models.Conductor).\\"},{"line_number":549,"context_line":"                    filter(models.Conductor.updated_at \u003e\u003d limit).\\"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F90KY%3D","side":"PARENT","line":546,"updated":"2013-12-05 16:27:57.000000000","message":"https://bugs.launchpad.net/ironic/+bug/1258207\n\nI\u0027m now thinking if it would make sense to have a db option for such interval, cuz it might be needed on both API and Conductor services","commit_id":"212f1063e9c535b708432a1f0ea3711618faeb3a"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"e131e46dc6f34e6421efe73cd6677695fc2b65d1","unresolved":false,"context_lines":[{"line_number":543,"context_line":""},{"line_number":544,"context_line":"    def list_active_conductor_drivers(self, interval):"},{"line_number":545,"context_line":"        # TODO(deva): add configurable default \u0027interval\u0027, somewhere higher"},{"line_number":546,"context_line":"        #             up the code. This isn\u0027t a db-specific option."},{"line_number":547,"context_line":"        limit \u003d timeutils.utcnow() - datetime.timedelta(seconds\u003dinterval)"},{"line_number":548,"context_line":"        result \u003d model_query(models.Conductor).\\"},{"line_number":549,"context_line":"                    filter(models.Conductor.updated_at \u003e\u003d limit).\\"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F9lRk%3D","side":"PARENT","line":546,"in_reply_to":"AAAATn%2F90KY%3D","updated":"2013-12-10 00:30:17.000000000","message":"It is needed at both layers, but the API can import a config option from the \u0027conductor\u0027 namespace. That bug is fixed :)","commit_id":"212f1063e9c535b708432a1f0ea3711618faeb3a"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"d036da312a9753888ff47d1e17eac3241d6170e3","unresolved":false,"context_lines":[{"line_number":548,"context_line":"                    all()"},{"line_number":549,"context_line":""},{"line_number":550,"context_line":"        d2c \u003d {}"},{"line_number":551,"context_line":"        for row in result:"},{"line_number":552,"context_line":"            for driver in row[\u0027drivers\u0027]:"},{"line_number":553,"context_line":"                if driver not in d2c:"},{"line_number":554,"context_line":"                    d2c[driver] \u003d set([row[\u0027hostname\u0027]])"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F91Vc%3D","line":551,"updated":"2013-12-05 13:15:55.000000000","message":"Although I do not like the complexity of this code, I think it should not make performance issues because there won\u0027t be a lot of conductor nodes and a lot of drivers.","commit_id":"a346b7bc0893406e34208b71f705f58604853545"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"e131e46dc6f34e6421efe73cd6677695fc2b65d1","unresolved":false,"context_lines":[{"line_number":548,"context_line":"                    all()"},{"line_number":549,"context_line":""},{"line_number":550,"context_line":"        d2c \u003d {}"},{"line_number":551,"context_line":"        for row in result:"},{"line_number":552,"context_line":"            for driver in row[\u0027drivers\u0027]:"},{"line_number":553,"context_line":"                if driver not in d2c:"},{"line_number":554,"context_line":"                    d2c[driver] \u003d set([row[\u0027hostname\u0027]])"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F9lRU%3D","line":551,"in_reply_to":"AAAATn%2F91Vc%3D","updated":"2013-12-10 00:30:17.000000000","message":"In a large deployment, there could be many 10\u0027s or even 100 conductors. However, I don\u0027t think that is going to be a performance issue. O(num_conductor * num_driver_per_conductor) should be just O(num_conductor) which is linear time. \n\nAs far as the complexity, I think this is as clear as I could make it, though I realize I didn\u0027t follow EAFP here, so I\u0027ve replace if..else with try..except in the next rev.","commit_id":"a346b7bc0893406e34208b71f705f58604853545"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"7e564f661a0141d302e197b43835fa4e4aab30a3","unresolved":false,"context_lines":[{"line_number":553,"context_line":"                try:"},{"line_number":554,"context_line":"                    d2c[driver].add(row[\u0027hostname\u0027])"},{"line_number":555,"context_line":"                except KeyError:"},{"line_number":556,"context_line":"                    d2c[driver] \u003d set([row[\u0027hostname\u0027]])"},{"line_number":557,"context_line":"        return d2c"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9lIk%3D","line":556,"updated":"2013-12-10 00:59:27.000000000","message":"This can be made much simpler:\n\n d2c \u003d defaultdict(set)\n for driver in row[\u0027drivers\u0027]:\n     d2c[driver].add(row[\u0027hostname\u0027])","commit_id":"ce0ec4c95dd788f75462f7479bd7357edca19698"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"59b9e1e8ea0f49bde59a95ab74660e9cc412f260","unresolved":false,"context_lines":[{"line_number":553,"context_line":"                try:"},{"line_number":554,"context_line":"                    d2c[driver].add(row[\u0027hostname\u0027])"},{"line_number":555,"context_line":"                except KeyError:"},{"line_number":556,"context_line":"                    d2c[driver] \u003d set([row[\u0027hostname\u0027]])"},{"line_number":557,"context_line":"        return d2c"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9k3o%3D","line":556,"in_reply_to":"AAAATn%2F9lIk%3D","updated":"2013-12-10 02:28:19.000000000","message":"Very nice. Didn\u0027t know about defaultdict. Thanks!","commit_id":"ce0ec4c95dd788f75462f7479bd7357edca19698"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"7ec7f0a07eaed28cf5267dc703ee1be141ebe0d3","unresolved":false,"context_lines":[{"line_number":21,"context_line":"import datetime"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"from oslo.config import cfg"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from sqlalchemy.orm.exc import NoResultFound"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"from ironic.common import exception"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9F9Q%3D","line":24,"updated":"2013-12-16 21:17:32.000000000","message":"I realise it\u0027s preexisting, but the blank line here is incorrect","commit_id":"2a8de5a26efa88aefae843bb2e81c5f0a247237d"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"d4c46378c95d4df347cb58f9915168c741effc99","unresolved":false,"context_lines":[{"line_number":21,"context_line":"import datetime"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"from oslo.config import cfg"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"from sqlalchemy.orm.exc import NoResultFound"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"from ironic.common import exception"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9Ae4%3D","line":24,"in_reply_to":"AAAATn%2F9F9Q%3D","updated":"2013-12-17 19:30:34.000000000","message":"Done","commit_id":"2a8de5a26efa88aefae843bb2e81c5f0a247237d"},{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"4230b97adf10caa5462446702af90ff9ef8e5ecc","unresolved":false,"context_lines":[{"line_number":548,"context_line":"                raise exception.ConductorNotFound(conductor\u003dhostname)"},{"line_number":549,"context_line":""},{"line_number":550,"context_line":"    def get_active_driver_dict(self,"},{"line_number":551,"context_line":"            interval\u003dCONF.conductor.heartbeat_timeout):"},{"line_number":552,"context_line":"        limit \u003d timeutils.utcnow() - datetime.timedelta(seconds\u003dinterval)"},{"line_number":553,"context_line":"        result \u003d model_query(models.Conductor).\\"},{"line_number":554,"context_line":"                    filter(models.Conductor.updated_at \u003e\u003d limit).\\"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAATn%2F8%2FV8%3D","line":551,"updated":"2013-12-18 00:36:14.000000000","message":"We discussed this on IRC - my preference would be for\n\n def get_active_driver_dict(self, interval\u003dNone):\n     if interval is None:\n          interval\u003dCONF.conductor.heartbeat_timeout\n      ....\n\nbut it\u0027s a -0 not a -1.","commit_id":"ec54a1dd20501de3f646167415807f1a2a428fd0"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"94da17377de1b2e5cf0cfb58c35649507d79d337","unresolved":false,"context_lines":[{"line_number":548,"context_line":"                raise exception.ConductorNotFound(conductor\u003dhostname)"},{"line_number":549,"context_line":""},{"line_number":550,"context_line":"    def get_active_driver_dict(self,"},{"line_number":551,"context_line":"            interval\u003dCONF.conductor.heartbeat_timeout):"},{"line_number":552,"context_line":"        limit \u003d timeutils.utcnow() - datetime.timedelta(seconds\u003dinterval)"},{"line_number":553,"context_line":"        result \u003d model_query(models.Conductor).\\"},{"line_number":554,"context_line":"                    filter(models.Conductor.updated_at \u003e\u003d limit).\\"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAATn%2F892I%3D","line":551,"in_reply_to":"AAAATn%2F8%2FT0%3D","updated":"2013-12-18 10:12:04.000000000","message":"+1","commit_id":"ec54a1dd20501de3f646167415807f1a2a428fd0"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"0a09a235d8a2ef11babf744cf523989f626bd75b","unresolved":false,"context_lines":[{"line_number":548,"context_line":"                raise exception.ConductorNotFound(conductor\u003dhostname)"},{"line_number":549,"context_line":""},{"line_number":550,"context_line":"    def get_active_driver_dict(self,"},{"line_number":551,"context_line":"            interval\u003dCONF.conductor.heartbeat_timeout):"},{"line_number":552,"context_line":"        limit \u003d timeutils.utcnow() - datetime.timedelta(seconds\u003dinterval)"},{"line_number":553,"context_line":"        result \u003d model_query(models.Conductor).\\"},{"line_number":554,"context_line":"                    filter(models.Conductor.updated_at \u003e\u003d limit).\\"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAATn%2F8%2FT0%3D","line":551,"in_reply_to":"AAAATn%2F8%2FV8%3D","updated":"2013-12-18 00:50:27.000000000","message":"Upon further investigation, I believe this only works because db/sqlalchemy/api is imported late -- by ironic/openstack/common/db/api: DBAPI.__get_backend()\n\nSo, I\u0027ll switch it. There\u0027s precedent, but not much, and I don\u0027t like magic when there\u0027s a trivial alternative.\n\nCheers!","commit_id":"ec54a1dd20501de3f646167415807f1a2a428fd0"}],"ironic/tests/db/test_conductor.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"495f712abd4b080d61f076511eab035a81aef3fe","unresolved":false,"context_lines":[{"line_number":140,"context_line":"        self._create_test_cdr(id\u003d2, hostname\u003dh2, drivers\u003d[d1, d2])"},{"line_number":141,"context_line":"        self._create_test_cdr(id\u003d3, hostname\u003dh3, drivers\u003d[d2])"},{"line_number":142,"context_line":"        result \u003d self.dbapi.list_active_conductor_drivers(interval\u003d1)"},{"line_number":143,"context_line":"        self.assertEqual(expected, result)"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":"    def test_list_active_conductor_drivers_with_old_conductor(self):"},{"line_number":146,"context_line":"        past \u003d datetime.datetime(2000, 1, 1, 0, 0)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F90U0%3D","line":143,"updated":"2013-12-05 16:10:56.000000000","message":"This question is outside the scope of your changes but I was just wondering, is it OK to have two conductors on the same host?","commit_id":"a346b7bc0893406e34208b71f705f58604853545"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"46a21f2515ae5a6055a0ee457100470fcd0f8c6d","unresolved":false,"context_lines":[{"line_number":140,"context_line":"        self._create_test_cdr(id\u003d2, hostname\u003dh2, drivers\u003d[d1, d2])"},{"line_number":141,"context_line":"        self._create_test_cdr(id\u003d3, hostname\u003dh3, drivers\u003d[d2])"},{"line_number":142,"context_line":"        result \u003d self.dbapi.list_active_conductor_drivers(interval\u003d1)"},{"line_number":143,"context_line":"        self.assertEqual(expected, result)"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":"    def test_list_active_conductor_drivers_with_old_conductor(self):"},{"line_number":146,"context_line":"        past \u003d datetime.datetime(2000, 1, 1, 0, 0)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F9zy4%3D","line":143,"in_reply_to":"AAAATn%2F90U0%3D","updated":"2013-12-05 17:19:48.000000000","message":"No need to answer. I was just looking at the ConductorManager code and it only allows max of one per host.","commit_id":"a346b7bc0893406e34208b71f705f58604853545"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"e131e46dc6f34e6421efe73cd6677695fc2b65d1","unresolved":false,"context_lines":[{"line_number":140,"context_line":"        self._create_test_cdr(id\u003d2, hostname\u003dh2, drivers\u003d[d1, d2])"},{"line_number":141,"context_line":"        self._create_test_cdr(id\u003d3, hostname\u003dh3, drivers\u003d[d2])"},{"line_number":142,"context_line":"        result \u003d self.dbapi.list_active_conductor_drivers(interval\u003d1)"},{"line_number":143,"context_line":"        self.assertEqual(expected, result)"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":"    def test_list_active_conductor_drivers_with_old_conductor(self):"},{"line_number":146,"context_line":"        past \u003d datetime.datetime(2000, 1, 1, 0, 0)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F9lQQ%3D","line":143,"in_reply_to":"AAAATn%2F9zy4%3D","updated":"2013-12-10 00:30:17.000000000","message":"correct.","commit_id":"a346b7bc0893406e34208b71f705f58604853545"},{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"88c50d75530e75c301ae0001976b40332009aa56","unresolved":false,"context_lines":[{"line_number":160,"context_line":""},{"line_number":161,"context_line":"        # verify that old-host does not show up in current list"},{"line_number":162,"context_line":"        expected \u003d {d: set([h2]), d2: set([h2])}"},{"line_number":163,"context_line":"        result \u003d self.dbapi.get_active_driver_dict(interval\u003d60)"},{"line_number":164,"context_line":"        self.assertEqual(expected, result)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        # change the interval, and verify that old-host appears"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9KDE%3D","line":163,"updated":"2013-12-16 07:49:36.000000000","message":"A small suggestion - maybe to use\n        minute \u003d 60\n        .get_active_driver_dict(interval\u003dminute)","commit_id":"2a8de5a26efa88aefae843bb2e81c5f0a247237d"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"d4c46378c95d4df347cb58f9915168c741effc99","unresolved":false,"context_lines":[{"line_number":160,"context_line":""},{"line_number":161,"context_line":"        # verify that old-host does not show up in current list"},{"line_number":162,"context_line":"        expected \u003d {d: set([h2]), d2: set([h2])}"},{"line_number":163,"context_line":"        result \u003d self.dbapi.get_active_driver_dict(interval\u003d60)"},{"line_number":164,"context_line":"        self.assertEqual(expected, result)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        # change the interval, and verify that old-host appears"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9AYw%3D","line":163,"in_reply_to":"AAAATn%2F9KDE%3D","updated":"2013-12-17 19:30:34.000000000","message":"Done","commit_id":"2a8de5a26efa88aefae843bb2e81c5f0a247237d"},{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"88c50d75530e75c301ae0001976b40332009aa56","unresolved":false,"context_lines":[{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        # change the interval, and verify that old-host appears"},{"line_number":167,"context_line":"        expected \u003d {d: set([h1, h2]), d1: set([h1]), d2: set([h2])}"},{"line_number":168,"context_line":"        result \u003d self.dbapi.get_active_driver_dict(interval\u003d7200)"},{"line_number":169,"context_line":"        self.assertEqual(expected, result)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9KDk%3D","line":168,"updated":"2013-12-16 07:49:36.000000000","message":"And here we would have minute * 60 * 2 instead of 7200. With such notation it may be easier to understand that it\u0027s two hours","commit_id":"2a8de5a26efa88aefae843bb2e81c5f0a247237d"}]}
