)]}'
{"ironic/drivers/modules/port_bitmap.py":[{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"865eee0460a81837bcb23e08a6041bcc9562de66","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from ironic.db import api as dbapi"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class PortBitmap(object):"},{"line_number":24,"context_line":"    \"\"\"Setup a port bitmap for allocation/de-allocation.\"\"\""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    # Keep track of the ports that have been allocated/de-allocated"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_d531f0ed","line":23,"updated":"2015-12-23 08:45:37.000000000","message":"It\u0027s only for console port or?","commit_id":"1346df9dbaed177e2a68eec6da746ca9cd1dad96"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"196b2071bfda51395e07663c24a2dc1d1f13685c","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from ironic.db import api as dbapi"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class PortBitmap(object):"},{"line_number":24,"context_line":"    \"\"\"Setup a port bitmap for allocation/de-allocation.\"\"\""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    # Keep track of the ports that have been allocated/de-allocated"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_7e74999b","line":23,"in_reply_to":"1a7b0d38_d531f0ed","updated":"2015-12-23 09:43:44.000000000","message":"currently it\u0027s only for console ports, but I don\u0027t want to restrict it, so named this as PortBitmap in case of reused in the future.","commit_id":"1346df9dbaed177e2a68eec6da746ca9cd1dad96"},{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"865eee0460a81837bcb23e08a6041bcc9562de66","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    # Keep track of the ports that have been allocated/de-allocated"},{"line_number":27,"context_line":"    # uses a bitmap to do this"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def __init__(self, min_port\u003d6900, max_port\u003d65535):"},{"line_number":30,"context_line":"        self.min_port \u003d min_port"},{"line_number":31,"context_line":"        self.max_port \u003d max_port"},{"line_number":32,"context_line":"        self.dbapi \u003d dbapi.get_instance()"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_b206ba1e","line":29,"updated":"2015-12-23 08:45:37.000000000","message":"It\u0027s a such big range, there is a potential conflict with other kind of ports. Do you have any ideas to prevent this?","commit_id":"1346df9dbaed177e2a68eec6da746ca9cd1dad96"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"196b2071bfda51395e07663c24a2dc1d1f13685c","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    # Keep track of the ports that have been allocated/de-allocated"},{"line_number":27,"context_line":"    # uses a bitmap to do this"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def __init__(self, min_port\u003d6900, max_port\u003d65535):"},{"line_number":30,"context_line":"        self.min_port \u003d min_port"},{"line_number":31,"context_line":"        self.max_port \u003d max_port"},{"line_number":32,"context_line":"        self.dbapi \u003d dbapi.get_instance()"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_43122a64","line":29,"in_reply_to":"1a7b0d38_b206ba1e","updated":"2015-12-23 09:43:44.000000000","message":"I plan to add two configs, then users can specify their own ports range to avoid conflict with other services in their system, do you have better suggestions Tan?","commit_id":"1346df9dbaed177e2a68eec6da746ca9cd1dad96"},{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"865eee0460a81837bcb23e08a6041bcc9562de66","unresolved":false,"context_lines":[{"line_number":38,"context_line":"                         )"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def get_next_port(self, port_num\u003dNone):"},{"line_number":41,"context_line":"        \"\"\"Try to get a specific port if requested or get the next port.\"\"\""},{"line_number":42,"context_line":"        min_port_search \u003d port_num or self.min_port"},{"line_number":43,"context_line":"        max_port_search \u003d (port_num + 1) if port_num else self.max_port"},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_d21d86be","line":41,"updated":"2015-12-23 08:45:37.000000000","message":"Better to add another function like get_port_by_num?","commit_id":"1346df9dbaed177e2a68eec6da746ca9cd1dad96"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"196b2071bfda51395e07663c24a2dc1d1f13685c","unresolved":false,"context_lines":[{"line_number":38,"context_line":"                         )"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def get_next_port(self, port_num\u003dNone):"},{"line_number":41,"context_line":"        \"\"\"Try to get a specific port if requested or get the next port.\"\"\""},{"line_number":42,"context_line":"        min_port_search \u003d port_num or self.min_port"},{"line_number":43,"context_line":"        max_port_search \u003d (port_num + 1) if port_num else self.max_port"},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_c3c85a77","line":41,"in_reply_to":"1a7b0d38_d21d86be","updated":"2015-12-23 09:43:44.000000000","message":"I don\u0027t think so, a same interface to get port seems better.","commit_id":"1346df9dbaed177e2a68eec6da746ca9cd1dad96"},{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"865eee0460a81837bcb23e08a6041bcc9562de66","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        max_port_search \u003d (port_num + 1) if port_num else self.max_port"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        for port in moves.range(min_port_search, max_port_search):"},{"line_number":46,"context_line":"            if port not in self.ports:"},{"line_number":47,"context_line":"                self.ports.add(port)"},{"line_number":48,"context_line":"                return port"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_15cc5888","line":46,"updated":"2015-12-23 08:45:37.000000000","message":"what happened if you didn\u0027t get your specific port?","commit_id":"1346df9dbaed177e2a68eec6da746ca9cd1dad96"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"196b2071bfda51395e07663c24a2dc1d1f13685c","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        max_port_search \u003d (port_num + 1) if port_num else self.max_port"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        for port in moves.range(min_port_search, max_port_search):"},{"line_number":46,"context_line":"            if port not in self.ports:"},{"line_number":47,"context_line":"                self.ports.add(port)"},{"line_number":48,"context_line":"                return port"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1a7b0d38_034c2241","line":46,"in_reply_to":"1a7b0d38_15cc5888","updated":"2015-12-23 09:43:44.000000000","message":"if you specify a port num, this function will just return the port and add it to it\u0027s ports set to mark the port has been used, if you don\u0027t specify the port, it will get a unused port from the ports range and add it to the ports set.","commit_id":"1346df9dbaed177e2a68eec6da746ca9cd1dad96"},{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"3784f8635a9177cb383b56863cd1bd4bd2be7821","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    # Keep track of the ports that have been allocated/de-allocated"},{"line_number":27,"context_line":"    # uses a bitmap to do this"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def __init__(self, min_port\u003d6900, max_port\u003d65535):"},{"line_number":30,"context_line":"        self.min_port \u003d min_port"},{"line_number":31,"context_line":"        self.max_port \u003d max_port"},{"line_number":32,"context_line":"        self.dbapi \u003d dbapi.get_instance()"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a7b0d38_0e6b7eb8","line":29,"updated":"2015-12-28 07:14:44.000000000","message":"1. personally, I doubt the necessary to allow user configure the port range, do they really care about the port number? 2. How many instances will a conductor manage? I didn\u0027t test it but I guess it should be less than one hundred. And how many instances will be accessed simultaneous? So I would suggest you could pick a reasonable range is good enough.","commit_id":"382043a37474b7cc4eed269f7721ca19b4e9a059"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"8cfeaf748c26edf15090b50ad739c35a698daff3","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    # Keep track of the ports that have been allocated/de-allocated"},{"line_number":27,"context_line":"    # uses a bitmap to do this"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def __init__(self, min_port\u003d6900, max_port\u003d65535):"},{"line_number":30,"context_line":"        self.min_port \u003d min_port"},{"line_number":31,"context_line":"        self.max_port \u003d max_port"},{"line_number":32,"context_line":"        self.dbapi \u003d dbapi.get_instance()"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa69d971_3d07d21d","line":29,"in_reply_to":"1a7b0d38_0e6b7eb8","updated":"2016-01-04 06:26:31.000000000","message":"thanks Tan, but I still think it\u0027s a good choice to give users the ability to set this port range, if they don\u0027t care about the port number, they can use the default range. and I don\u0027t want to assume a reasonable range for all user\u0027s environments.","commit_id":"382043a37474b7cc4eed269f7721ca19b4e9a059"},{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"3784f8635a9177cb383b56863cd1bd4bd2be7821","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    def get_next_port(self, port_num\u003dNone):"},{"line_number":37,"context_line":"        \"\"\"Try to get a specific port if requested or get the next port.\"\"\""},{"line_number":38,"context_line":"        min_port_search \u003d port_num or self.min_port"},{"line_number":39,"context_line":"        max_port_search \u003d (port_num + 1) if port_num else self.max_port"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        for port in moves.range(min_port_search, max_port_search):"},{"line_number":42,"context_line":"            if port not in self.ports:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a7b0d38_7386abdc","line":39,"updated":"2015-12-28 07:14:44.000000000","message":"in your logical, max_port_search should also equal to \u0027self.max_port+1\u0027 otherwise you will never get the max_port","commit_id":"382043a37474b7cc4eed269f7721ca19b4e9a059"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"8cfeaf748c26edf15090b50ad739c35a698daff3","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    def get_next_port(self, port_num\u003dNone):"},{"line_number":37,"context_line":"        \"\"\"Try to get a specific port if requested or get the next port.\"\"\""},{"line_number":38,"context_line":"        min_port_search \u003d port_num or self.min_port"},{"line_number":39,"context_line":"        max_port_search \u003d (port_num + 1) if port_num else self.max_port"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"        for port in moves.range(min_port_search, max_port_search):"},{"line_number":42,"context_line":"            if port not in self.ports:"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa69d971_3dab521f","line":39,"in_reply_to":"1a7b0d38_7386abdc","updated":"2016-01-04 06:26:31.000000000","message":"thanks Tan, will address in the next patch set.","commit_id":"382043a37474b7cc4eed269f7721ca19b4e9a059"},{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"3784f8635a9177cb383b56863cd1bd4bd2be7821","unresolved":false,"context_lines":[{"line_number":43,"context_line":"                self.ports.add(port)"},{"line_number":44,"context_line":"                return port"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        # Return -1 if there\u0027s no port available."},{"line_number":47,"context_line":"        return -1"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def release_port(self, port_num):"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a7b0d38_73b30bea","line":46,"updated":"2015-12-28 07:14:44.000000000","message":"nit:add a log here or somewhere should be helpful for debug","commit_id":"382043a37474b7cc4eed269f7721ca19b4e9a059"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"8cfeaf748c26edf15090b50ad739c35a698daff3","unresolved":false,"context_lines":[{"line_number":43,"context_line":"                self.ports.add(port)"},{"line_number":44,"context_line":"                return port"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        # Return -1 if there\u0027s no port available."},{"line_number":47,"context_line":"        return -1"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def release_port(self, port_num):"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa69d971_472193fa","line":46,"in_reply_to":"1a7b0d38_73b30bea","updated":"2016-01-04 06:26:31.000000000","message":"Thanks, I plan to not add the log here, but at the function who got a -1 from get_next_port()","commit_id":"382043a37474b7cc4eed269f7721ca19b4e9a059"},{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"16d4c9592963ad773b67f40efa378bddab27834a","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"opts \u003d ["},{"line_number":29,"context_line":"    cfg.StrOpt(\u0027console_port_range\u0027,"},{"line_number":30,"context_line":"               default\u003d\u00276900:7900\u0027,"},{"line_number":31,"context_line":"               help\u003d_(\u0027The range of the available console ports.\u0027)),"},{"line_number":32,"context_line":"]"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_f5ff7863","line":30,"updated":"2016-01-07 03:38:53.000000000","message":"why not default\u003dDEFAULT_PORT_RANGE","commit_id":"6e13a6b17159e320859da321459a9a9e5ac7ce2e"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"c0648a4ede956764cb5f68201df89161e0690349","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"opts \u003d ["},{"line_number":29,"context_line":"    cfg.StrOpt(\u0027console_port_range\u0027,"},{"line_number":30,"context_line":"               default\u003d\u00276900:7900\u0027,"},{"line_number":31,"context_line":"               help\u003d_(\u0027The range of the available console ports.\u0027)),"},{"line_number":32,"context_line":"]"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_662e7c8d","line":30,"in_reply_to":"fa69d971_f5ff7863","updated":"2016-01-07 04:48:08.000000000","message":"Done","commit_id":"6e13a6b17159e320859da321459a9a9e5ac7ce2e"},{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"16d4c9592963ad773b67f40efa378bddab27834a","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    def get_next_port(self, port_num\u003dNone):"},{"line_number":54,"context_line":"        \"\"\"Try to get a specific port if requested or get the next port.\"\"\""},{"line_number":55,"context_line":"        min_port_search \u003d port_num or self.min_port"},{"line_number":56,"context_line":"        max_port_search \u003d (port_num + 1) if port_num else (self.max_port + 1)"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        for port in moves.range(min_port_search, max_port_search):"},{"line_number":59,"context_line":"            if port not in self.ports:"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_b50a6024","line":56,"updated":"2016-01-07 03:38:53.000000000","message":"nit: max_port_search \u003d (port_num if port_num else self.max_port) + 1","commit_id":"6e13a6b17159e320859da321459a9a9e5ac7ce2e"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"c0648a4ede956764cb5f68201df89161e0690349","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    def get_next_port(self, port_num\u003dNone):"},{"line_number":54,"context_line":"        \"\"\"Try to get a specific port if requested or get the next port.\"\"\""},{"line_number":55,"context_line":"        min_port_search \u003d port_num or self.min_port"},{"line_number":56,"context_line":"        max_port_search \u003d (port_num + 1) if port_num else (self.max_port + 1)"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        for port in moves.range(min_port_search, max_port_search):"},{"line_number":59,"context_line":"            if port not in self.ports:"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_463338f6","line":56,"in_reply_to":"fa69d971_b50a6024","updated":"2016-01-07 04:48:08.000000000","message":"Done","commit_id":"6e13a6b17159e320859da321459a9a9e5ac7ce2e"},{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"16d4c9592963ad773b67f40efa378bddab27834a","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        max_port_search \u003d (port_num + 1) if port_num else (self.max_port + 1)"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        for port in moves.range(min_port_search, max_port_search):"},{"line_number":59,"context_line":"            if port not in self.ports:"},{"line_number":60,"context_line":"                self.ports.add(port)"},{"line_number":61,"context_line":"                if not _verify_port(self.host, port):"},{"line_number":62,"context_line":"                    continue"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_60a744a7","line":59,"updated":"2016-01-07 03:38:53.000000000","message":"should verify the port before adds to the port","commit_id":"6e13a6b17159e320859da321459a9a9e5ac7ce2e"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"c0648a4ede956764cb5f68201df89161e0690349","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        max_port_search \u003d (port_num + 1) if port_num else (self.max_port + 1)"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        for port in moves.range(min_port_search, max_port_search):"},{"line_number":59,"context_line":"            if port not in self.ports:"},{"line_number":60,"context_line":"                self.ports.add(port)"},{"line_number":61,"context_line":"                if not _verify_port(self.host, port):"},{"line_number":62,"context_line":"                    continue"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_0629c089","line":59,"in_reply_to":"fa69d971_60a744a7","updated":"2016-01-07 04:48:08.000000000","message":"hi Tan, the port should be added first here, as whether veriy_port succeed or not, the port is used.","commit_id":"6e13a6b17159e320859da321459a9a9e5ac7ce2e"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"acfdc426bb34c084d7df85ee05a8e18fee55426c","unresolved":false,"context_lines":[{"line_number":39,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"class PortBitmap(object):"},{"line_number":43,"context_line":"    \"\"\"Setup a port bitmap for allocation/de-allocation.\"\"\""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    # Keep track of the ports that have been allocated/de-allocated"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_e30f9b2c","line":42,"updated":"2016-01-16 15:39:15.000000000","message":"As this is written, each instance of PortBitmap will be independent. If I were to create more than one instance, they would not coordinate the allocation of ports, leading to conflicts what ever code used it. And eventually, leading to entries in the \u0027ports\u0027 bitmap that never get released. \n\nI think this class should use a singleton for the \u0027ports\u0027 bitmap.","commit_id":"9382a85bbb45616fc04c82ab6d8e933f3e4f03da"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"ac24b3b873838e90875925f3601d828a0a8fc026","unresolved":false,"context_lines":[{"line_number":39,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"class PortBitmap(object):"},{"line_number":43,"context_line":"    \"\"\"Setup a port bitmap for allocation/de-allocation.\"\"\""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    # Keep track of the ports that have been allocated/de-allocated"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_5cc18f7f","line":42,"in_reply_to":"da6ed579_e30f9b2c","updated":"2016-01-18 09:09:11.000000000","message":"thanks Devananda, will change to use singleton in the next patch set.","commit_id":"9382a85bbb45616fc04c82ab6d8e933f3e4f03da"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"acfdc426bb34c084d7df85ee05a8e18fee55426c","unresolved":false,"context_lines":[{"line_number":72,"context_line":"            self.ports.remove(port_num)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"def _verify_port(host, port):"},{"line_number":76,"context_line":"    s \u003d socket.socket()"},{"line_number":77,"context_line":"    try:"},{"line_number":78,"context_line":"        s.bind((host, port))"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_831c9f6b","line":75,"updated":"2016-01-16 15:39:15.000000000","message":"this is racy -- what happens if multiple greenthreads are asking for ports in parallel? it is possible that both callers will succeed in binding (and releasing) the same port.","commit_id":"9382a85bbb45616fc04c82ab6d8e933f3e4f03da"}],"ironic/tests/unit/drivers/modules/test_port_bitmap.py":[{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"acfdc426bb34c084d7df85ee05a8e18fee55426c","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        for i in moves.range(0, 12):"},{"line_number":57,"context_line":"            port \u003d self.ports.get_next_port()"},{"line_number":58,"context_line":"        self.assertEqual(-1, port)"},{"line_number":59,"context_line":"        port \u003d self.ports.get_next_port(8888)"},{"line_number":60,"context_line":"        self.assertEqual(8888, port)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    @mock.patch.object(port_bitmap, \u0027_verify_port\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_a319a37b","line":59,"updated":"2016-01-16 15:39:15.000000000","message":"this is odd -- you\u0027ve defined the range above as \"0:10\" and validated that asking for more than 11 ports yields an error. Great.\n\nNow you ask for a specific port outside that range and assert that it works?\n- That should be a different unit test\n- Asking for a port outside the configured range should fail.","commit_id":"9382a85bbb45616fc04c82ab6d8e933f3e4f03da"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"ac24b3b873838e90875925f3601d828a0a8fc026","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        for i in moves.range(0, 12):"},{"line_number":57,"context_line":"            port \u003d self.ports.get_next_port()"},{"line_number":58,"context_line":"        self.assertEqual(-1, port)"},{"line_number":59,"context_line":"        port \u003d self.ports.get_next_port(8888)"},{"line_number":60,"context_line":"        self.assertEqual(8888, port)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    @mock.patch.object(port_bitmap, \u0027_verify_port\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_bc81ab4f","line":59,"in_reply_to":"da6ed579_a319a37b","updated":"2016-01-18 09:09:11.000000000","message":"thanks Devananda, as it is written, the configured port range is for auto allocation, but if a console port is specified in node\u0027s driver_info, we don\u0027t check whether it outside the range. if you disagree with the current design, I can update the spec https://review.openstack.org/#/c/249876/ , and it\u0027s appreciate if you can help to look at that as well.","commit_id":"9382a85bbb45616fc04c82ab6d8e933f3e4f03da"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"acfdc426bb34c084d7df85ee05a8e18fee55426c","unresolved":false,"context_lines":[{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        self.ports.release_port(port)"},{"line_number":69,"context_line":"        port \u003d self.ports.get_next_port()"},{"line_number":70,"context_line":"        self.assertEqual(0, port)"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_432547ac","line":70,"updated":"2016-01-16 15:39:15.000000000","message":"Missing test case for releasing a port which hasn\u0027t been allocated.\n\nMissing test case for asking for a port by number that has already been allocated.\n\nMissing test case for asking for a port outside of the allowable range.","commit_id":"9382a85bbb45616fc04c82ab6d8e933f3e4f03da"}]}
