)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4245b9f0ef9db0d511339fef98ba5c1cce290b8b","unresolved":false,"context_lines":[{"line_number":11,"context_line":"Added comparison of hypervisor version from the compute-node and image"},{"line_number":12,"context_line":"metadata in the image properties filter."},{"line_number":13,"context_line":"Partially Implements blueprint xen-support-for-hypervisor-versions"},{"line_number":14,"context_line":"Will make cell scheduler changes in another commit."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I6fbf232adf9ac78ebb8ac2985739f163f4517d14"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"AAAAP3%2F%2Ft2k%3D","line":14,"updated":"2013-07-12 14:48:38.000000000","message":"I think this has DocImpact","commit_id":"cf0e98d2455b73d2e2d611044d68714479e08c20"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"de5abd1b336d86510518068dcf2b9a93a6e3f8c9","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Aarti Kriplani \u003caarti.kriplani@RACKSPACE.COM\u003e"},{"line_number":5,"context_line":"CommitDate: 2013-07-15 11:08:26 +0530"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"xenapi:support for multiple xen versions"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This is to prevent instances with newer tools from being provisioned"},{"line_number":10,"context_line":"on older hypervisors."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"AAAAP3%2F%2Fjrc%3D","line":7,"updated":"2013-07-16 15:54:50.000000000","message":"This no longer has anything to do with XenAPI, please update","commit_id":"b6c57e269a7fb688658ac9161b4ae4b25bb1fd11"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"0cbcbb3c3c1052ba970961daef2c1a202bf308f9","unresolved":false,"context_lines":[{"line_number":9,"context_line":"This is to prevent instances with newer tools from being provisioned"},{"line_number":10,"context_line":"on older hypervisors."},{"line_number":11,"context_line":"Added comparison of hypervisor version from the compute-node and image"},{"line_number":12,"context_line":"metadata in the image properties filter."},{"line_number":13,"context_line":"Partially Implements blueprint xen-support-for-hypervisor-versions"},{"line_number":14,"context_line":"Cell scheduler changes coming up in another commit."},{"line_number":15,"context_line":"DocImpact"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"AAAAQn%2F%2F%2BSE%3D","line":12,"updated":"2013-07-18 09:47:04.000000000","message":"Agreed with Joe here, would be good to mention the name of the image property. Also need to cover what the valid values are for the property.\n\nYou might find it easier just to describe how it gets used here, and how the scheduler makes its decisions.","commit_id":"d29697f23f512ce142f16ec8c648176335cd4c65"}],"nova/exception.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"913aec286e892361cfc4aabe09abf0baac709be8","unresolved":false,"context_lines":[{"line_number":383,"context_line":"    msg_fmt \u003d _(\"The supplied hypervisor type of is invalid.\")"},{"line_number":384,"context_line":""},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"class InvalidHypervisorVersion(Invalid):"},{"line_number":387,"context_line":"    msg_fmt \u003d _(\"The supplied hypervisor version is invalid.\")"},{"line_number":388,"context_line":""},{"line_number":389,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAQn%2F%2FbY8%3D","line":386,"updated":"2013-07-31 11:09:15.000000000","message":"Not 100% sure if thats the correct base class in this case, its not returned by the API, so maybe just use the base exception.","commit_id":"a82bf5762470ab597a203adb157df7013d31a26e"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"aa25db034209bd936f627e41bc3fed84b154f61f","unresolved":false,"context_lines":[{"line_number":1329,"context_line":"    msg_fmt \u003d _(\"Instance group %(group_uuid)s has no policy %(policy)s.\")"},{"line_number":1330,"context_line":""},{"line_number":1331,"context_line":""},{"line_number":1332,"context_line":"class InvalidHypervisorVersion(Exception):"},{"line_number":1333,"context_line":"    msg_fmt \u003d _(\"The supplied hypervisor version is invalid.\")"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAQn%2F%2FWsA%3D","line":1332,"updated":"2013-08-01 19:14:34.000000000","message":"Should inherit from NovaException.","commit_id":"d0e8486c0906c2a78b3c8e62f9947b66d8201a0b"},{"author":{"_account_id":6992,"name":"Kaushik Chandrashekar","email":"kaushik.chandrashekar@rackspace.com","username":"kaushikc"},"change_message_id":"c9055f9e528f8564ac489521fe90d1c8349809ad","unresolved":false,"context_lines":[{"line_number":1329,"context_line":"    msg_fmt \u003d _(\"Instance group %(group_uuid)s has no policy %(policy)s.\")"},{"line_number":1330,"context_line":""},{"line_number":1331,"context_line":""},{"line_number":1332,"context_line":"class InvalidHypervisorVersion(Exception):"},{"line_number":1333,"context_line":"    msg_fmt \u003d _(\"The supplied hypervisor version is invalid.\")"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAASn%2F%2F%2Bj0%3D","line":1332,"in_reply_to":"AAAAQn%2F%2FWsA%3D","updated":"2013-08-28 05:02:43.000000000","message":"Done","commit_id":"d0e8486c0906c2a78b3c8e62f9947b66d8201a0b"}],"nova/scheduler/filters/image_props_filter.py":[{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"0428fb39e9bbdd07692e393da3812c803279ee0a","unresolved":false,"context_lines":[{"line_number":62,"context_line":"                    \u0027hypervisor_version\u0027 in image_props and"},{"line_number":63,"context_line":"                    image_props[\u0027hypervisor_version\u0027]):"},{"line_number":64,"context_line":"                return True"},{"line_number":65,"context_line":"            if hypervisor_version \u003e\u003d int(image_props[\u0027hypervisor_version\u0027]):"},{"line_number":66,"context_line":"                return True"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        for supp_inst in supp_instances:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAP3%2F%2F190%3D","line":65,"updated":"2013-07-10 15:38:50.000000000","message":"It would be nice if this allowed more flexible filtering.  Rather than hardcoding a greater than check, perhaps allow it to be specified in the image_props.  I.e. \"\u003c6.2\" or \"\u003e6.0,\u003c\u003d6.2\".","commit_id":"42c127c92d12e75980bcc3441c4fef361718d3ed"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"fc6323089b9d6c12b7df8d83130d3594763935a5","unresolved":false,"context_lines":[{"line_number":62,"context_line":"                    \u0027hypervisor_version\u0027 in image_props and"},{"line_number":63,"context_line":"                    image_props[\u0027hypervisor_version\u0027]):"},{"line_number":64,"context_line":"                return True"},{"line_number":65,"context_line":"            if hypervisor_version \u003e\u003d int(image_props[\u0027hypervisor_version\u0027]):"},{"line_number":66,"context_line":"                return True"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        for supp_inst in supp_instances:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAP3%2F%2Fxq8%3D","line":65,"in_reply_to":"AAAAP3%2F%2F190%3D","updated":"2013-07-11 16:31:18.000000000","message":"What about mapping hypervisor versions map to a list of supported tools versions.\n\nBut then we have a config that lists support tools versions for each hypervisor version?\nhypervisor_version_to_image_version_compat\u003d6.0\u003d6.0;6.1\u003d6.1;6.2\u003d\u003e6.1","commit_id":"42c127c92d12e75980bcc3441c4fef361718d3ed"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"0428fb39e9bbdd07692e393da3812c803279ee0a","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        image_props \u003d spec.get(\u0027image\u0027, {}).get(\u0027properties\u0027, {})"},{"line_number":99,"context_line":"        capabilities \u003d host_state.capabilities"},{"line_number":100,"context_line":"        hypervisor_version \u003d None"},{"line_number":101,"context_line":"        if hasattr(host_state, \u0027hypervisor_version\u0027):"},{"line_number":102,"context_line":"            hypervisor_version \u003d host_state.hypervisor_version"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        if not self._instance_supported(capabilities, image_props,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAP3%2F%2F19U%3D","line":101,"updated":"2013-07-10 15:38:50.000000000","message":"Because the host_state objects are created in the scheduler you should be able to rely on this being here.  If it was passed over RPC it would be different, but as far as I can tell this isn\u0027t.","commit_id":"42c127c92d12e75980bcc3441c4fef361718d3ed"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"fc6323089b9d6c12b7df8d83130d3594763935a5","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        image_props \u003d spec.get(\u0027image\u0027, {}).get(\u0027properties\u0027, {})"},{"line_number":99,"context_line":"        capabilities \u003d host_state.capabilities"},{"line_number":100,"context_line":"        hypervisor_version \u003d None"},{"line_number":101,"context_line":"        if hasattr(host_state, \u0027hypervisor_version\u0027):"},{"line_number":102,"context_line":"            hypervisor_version \u003d host_state.hypervisor_version"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        if not self._instance_supported(capabilities, image_props,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAP3%2F%2FxsA%3D","line":101,"in_reply_to":"AAAAP3%2F%2F19U%3D","updated":"2013-07-11 16:31:18.000000000","message":"+1 not sure you need this now.","commit_id":"42c127c92d12e75980bcc3441c4fef361718d3ed"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4245b9f0ef9db0d511339fef98ba5c1cce290b8b","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":15,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":16,"context_line":"#    under the License."},{"line_number":17,"context_line":"from distutils.versionpredicate import VersionPredicate"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from nova.openstack.common import log as logging"},{"line_number":20,"context_line":"from nova.scheduler import filters"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAP3%2F%2Ft5c%3D","line":17,"updated":"2013-07-12 14:48:38.000000000","message":"should import the module not the object:\nhttps://github.com/openstack-dev/hacking/blob/master/HACKING.rst","commit_id":"cf0e98d2455b73d2e2d611044d68714479e08c20"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"c35d7e3e365c4320db7ccdb1bd9cc43fc1417a0a","unresolved":false,"context_lines":[{"line_number":52,"context_line":"                        \"by the compute node\"), {\u0027image_props\u0027: image_props})"},{"line_number":53,"context_line":"            return False"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        def _convert_int_to_ver_str(version):"},{"line_number":56,"context_line":"            major \u003d version // 1000000"},{"line_number":57,"context_line":"            minor \u003d (version - major * 1000000) // 1000"},{"line_number":58,"context_line":"            patch \u003d (version - major * 1000000 - minor * 1000)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAP3%2F%2FkaU%3D","line":55,"updated":"2013-07-16 13:51:51.000000000","message":"This should go into utils with the method that converts versions to int form.","commit_id":"b6c57e269a7fb688658ac9161b4ae4b25bb1fd11"},{"author":{"_account_id":7094,"name":"Aarti Kriplani","email":"aartimk@thoughtworks.com","username":"aarti.kriplani"},"change_message_id":"a0530c2ed71615d5d1104a6329a068de0d7583fe","unresolved":false,"context_lines":[{"line_number":52,"context_line":"                        \"by the compute node\"), {\u0027image_props\u0027: image_props})"},{"line_number":53,"context_line":"            return False"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        def _convert_int_to_ver_str(version):"},{"line_number":56,"context_line":"            major \u003d version // 1000000"},{"line_number":57,"context_line":"            minor \u003d (version - major * 1000000) // 1000"},{"line_number":58,"context_line":"            patch \u003d (version - major * 1000000 - minor * 1000)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAP3%2F%2Fgf8%3D","line":55,"in_reply_to":"AAAAP3%2F%2FjsM%3D","updated":"2013-07-17 09:26:40.000000000","message":"@John: This is not a cut-paste. the one from libvirt driver is already in utils as \u0027convert_version_to_int\u0027. This is the reverse of it.\nWill move it to utils.","commit_id":"b6c57e269a7fb688658ac9161b4ae4b25bb1fd11"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2252a3c3b8654f36955866d2d80775fe26f1a477","unresolved":false,"context_lines":[{"line_number":52,"context_line":"                        \"by the compute node\"), {\u0027image_props\u0027: image_props})"},{"line_number":53,"context_line":"            return False"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        def _convert_int_to_ver_str(version):"},{"line_number":56,"context_line":"            major \u003d version // 1000000"},{"line_number":57,"context_line":"            minor \u003d (version - major * 1000000) // 1000"},{"line_number":58,"context_line":"            patch \u003d (version - major * 1000000 - minor * 1000)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAP3%2F%2FjsM%3D","line":55,"in_reply_to":"AAAAP3%2F%2FkaU%3D","updated":"2013-07-16 15:54:05.000000000","message":"+1 this is a cut and paste from libvirt driver, we should share the code somewhere.","commit_id":"b6c57e269a7fb688658ac9161b4ae4b25bb1fd11"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"c35d7e3e365c4320db7ccdb1bd9cc43fc1417a0a","unresolved":false,"context_lines":[{"line_number":65,"context_line":"            return True"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        def _compare_product_version(hypervisor_version, image_props):"},{"line_number":68,"context_line":"            if not (hypervisor_version and"},{"line_number":69,"context_line":"                    \u0027hypervisor_version_requires\u0027 in image_props and"},{"line_number":70,"context_line":"                    image_props[\u0027hypervisor_version_requires\u0027]):"},{"line_number":71,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAP3%2F%2FkYY%3D","line":68,"updated":"2013-07-16 13:51:51.000000000","message":"This can be a bit cleaner.\n\n    version_required \u003d image_props.get(\u0027hypervisor_version_requires\u0027)\n    if not (hypervisor_version and version_required):\n        return True","commit_id":"b6c57e269a7fb688658ac9161b4ae4b25bb1fd11"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"c35d7e3e365c4320db7ccdb1bd9cc43fc1417a0a","unresolved":false,"context_lines":[{"line_number":81,"context_line":"                                                 image_props):"},{"line_number":82,"context_line":"                    LOG.debug(_(\"Instance properties %(image_props)s \""},{"line_number":83,"context_line":"                    \"are satisfied by compute host capabilities \""},{"line_number":84,"context_line":"                    \"%(capabilities)s and \""},{"line_number":85,"context_line":"                    \"hypervisor version \""},{"line_number":86,"context_line":"                    \"%(hypervisor_version)s\"),"},{"line_number":87,"context_line":"                    {\u0027image_props\u0027: image_props,"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAP3%2F%2FkXY%3D","line":84,"updated":"2013-07-16 13:51:51.000000000","message":"change and to or, since hypervisor_version may not be provided or required.","commit_id":"b6c57e269a7fb688658ac9161b4ae4b25bb1fd11"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"c35d7e3e365c4320db7ccdb1bd9cc43fc1417a0a","unresolved":false,"context_lines":[{"line_number":91,"context_line":""},{"line_number":92,"context_line":"        LOG.debug(_(\"Instance contains properties %(image_props)s \""},{"line_number":93,"context_line":"                    \"that are not provided by the compute node \""},{"line_number":94,"context_line":"                    \"capabilities %(capabilities)s and \""},{"line_number":95,"context_line":"                    \"hypervisor version %(hypervisor_version)s\"),"},{"line_number":96,"context_line":"                  {\u0027image_props\u0027: image_props,"},{"line_number":97,"context_line":"                   \u0027capabilities\u0027: capabilities,"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAP3%2F%2FkXM%3D","line":94,"updated":"2013-07-16 13:51:51.000000000","message":"Same here s/and/or/","commit_id":"b6c57e269a7fb688658ac9161b4ae4b25bb1fd11"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"618946a01bfce0e626fb7bf2f2781d84fcf4f6f7","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            img_prop_predicate \u003d versionpredicate.VersionPredicate("},{"line_number":71,"context_line":"                \u0027image_prop (%s)\u0027 % image_props[\u0027hypervisor_version_requires\u0027])"},{"line_number":72,"context_line":"            hyper_ver_str \u003d utils.convert_version_to_str(hypervisor_version)"},{"line_number":73,"context_line":"            if img_prop_predicate.satisfied_by(hyper_ver_str):"},{"line_number":74,"context_line":"                return True"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"        for supp_inst in supp_instances:"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAQn%2F%2F6AA%3D","line":73,"updated":"2013-07-19 13:27:55.000000000","message":"Just return here, rather than have an if statement.  This method currently returns None for a failed comparison, but satisfied_by returns a bool in both cases.","commit_id":"645e70cba8137ef89abc688924d001e25e9dbc77"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"52aaecf798aedddd419f4d65b5da18e370f0fc31","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                return True"},{"line_number":70,"context_line":"            img_prop_predicate \u003d versionpredicate.VersionPredicate("},{"line_number":71,"context_line":"                \u0027image_prop (%s)\u0027 % image_props[\u0027hypervisor_version_requires\u0027])"},{"line_number":72,"context_line":"            hyper_ver_str \u003d utils.convert_version_to_str(hypervisor_version)"},{"line_number":73,"context_line":"            return img_prop_predicate.satisfied_by(hyper_ver_str)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"        for supp_inst in supp_instances:"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAQn%2F%2F1KU%3D","line":72,"updated":"2013-07-22 15:01:50.000000000","message":"I just dug around and found that while this will work for xen and libvirt, it won\u0027t work for vmware and potentially others.  On vmware, hypervisor_version is going to be a string with major.minor version.\n\nWhile it would be nice to acheive consistency between the hypervisors I think that\u0027s outside the scope of this.  So you probably want to wrap this with a try/except or have some other check so that a failure to convert the version will log an error and not filter the host.","commit_id":"01406442579569c5d0b77103521efe5d831cd8fc"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"3284f47a87fde11c8f4dd410c9fdf022f61e7ec2","unresolved":false,"context_lines":[{"line_number":64,"context_line":"            return True"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        def _supported_version_format(version):"},{"line_number":67,"context_line":"            return type(version) \u003d\u003d int and len(str(version)) in [7, 8, 9]"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"        def _compare_product_version(hypervisor_version, image_props):"},{"line_number":70,"context_line":"            version_required \u003d image_props.get(\u0027hypervisor_version_requires\u0027)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAQn%2F%2Fea8%3D","line":67,"updated":"2013-07-30 15:52:15.000000000","message":"I don\u0027t think this is the right approach.  \n\nFirst of all, it fails silently.  This could end up being a source of confusion when VMWare users specify hypervisor_version_requires\u003d\u00272012\u0027, or whatever the version is, and it just doesn\u0027t work.\n\nSecondly, it indicates that your utility methods are lacking because they can only handle 3 part version numbers.  It\u0027s fine if that\u0027s all they\u0027re meant to handle for now, but if so then they should check their input and raise an exception if they can\u0027t handle it.  Then you should catch the exception below, log it and return appropriately.","commit_id":"0eb5ae51bda4bd4175fc4e0eec150d1691c1b8ba"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"913aec286e892361cfc4aabe09abf0baac709be8","unresolved":false,"context_lines":[{"line_number":73,"context_line":"                \u0027image_prop (%s)\u0027 % image_props[\u0027hypervisor_version_requires\u0027])"},{"line_number":74,"context_line":"            try:"},{"line_number":75,"context_line":"                hyper_ver_str \u003d utils.convert_version_to_str(hyper_version)"},{"line_number":76,"context_line":"                return img_prop_predicate.satisfied_by(hyper_ver_str)"},{"line_number":77,"context_line":"            except exception.InvalidHypervisorVersion:"},{"line_number":78,"context_line":"                return False"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAQn%2F%2FbZ4%3D","line":76,"updated":"2013-07-31 11:09:15.000000000","message":"Try should not cover this method I guess? What does this raise if the predicate is invalid?","commit_id":"a82bf5762470ab597a203adb157df7013d31a26e"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"913aec286e892361cfc4aabe09abf0baac709be8","unresolved":false,"context_lines":[{"line_number":75,"context_line":"                hyper_ver_str \u003d utils.convert_version_to_str(hyper_version)"},{"line_number":76,"context_line":"                return img_prop_predicate.satisfied_by(hyper_ver_str)"},{"line_number":77,"context_line":"            except exception.InvalidHypervisorVersion:"},{"line_number":78,"context_line":"                return False"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        for supp_inst in supp_instances:"},{"line_number":81,"context_line":"            if _compare_props(checked_img_props, supp_inst):"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAQn%2F%2FbZU%3D","line":78,"updated":"2013-07-31 11:09:15.000000000","message":"We should have a warn in the log about this I think.","commit_id":"a82bf5762470ab597a203adb157df7013d31a26e"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"3150710e1050df8feb238d7dce2d644a424384fe","unresolved":false,"context_lines":[{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        def _compare_product_version(hyper_version, image_props):"},{"line_number":69,"context_line":"            version_required \u003d image_props.get(\u0027hypervisor_version_requires\u0027)"},{"line_number":70,"context_line":"            if not (hyper_version and version_required):"},{"line_number":71,"context_line":"                return True"},{"line_number":72,"context_line":"            img_prop_predicate \u003d versionpredicate.VersionPredicate("},{"line_number":73,"context_line":"                \u0027image_prop (%s)\u0027 % image_props[\u0027hypervisor_version_requires\u0027])"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAATH%2F%2Frag%3D","line":70,"updated":"2013-10-11 10:47:06.000000000","message":"for speed reasons, can we add the not hyper_version check at the top?","commit_id":"5bf308099f2fb468a8943b7b3967ad45f5d370d6"},{"author":{"_account_id":7532,"name":"Aditi Raveesh","email":"aditi.raveesh@gmail.com","username":"aditiraveesh"},"change_message_id":"dcfb75be153ec0e88c9ae7def32a2dfa855b0369","unresolved":false,"context_lines":[{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        def _compare_product_version(hyper_version, image_props):"},{"line_number":69,"context_line":"            version_required \u003d image_props.get(\u0027hypervisor_version_requires\u0027)"},{"line_number":70,"context_line":"            if not (hyper_version and version_required):"},{"line_number":71,"context_line":"                return True"},{"line_number":72,"context_line":"            img_prop_predicate \u003d versionpredicate.VersionPredicate("},{"line_number":73,"context_line":"                \u0027image_prop (%s)\u0027 % image_props[\u0027hypervisor_version_requires\u0027])"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAATH%2F%2FgS8%3D","line":70,"in_reply_to":"AAAATH%2F%2Frag%3D","updated":"2013-10-15 10:16:28.000000000","message":"Done","commit_id":"5bf308099f2fb468a8943b7b3967ad45f5d370d6"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"3150710e1050df8feb238d7dce2d644a424384fe","unresolved":false,"context_lines":[{"line_number":74,"context_line":"            hyper_ver_str \u003d utils.convert_version_to_str(hyper_version)"},{"line_number":75,"context_line":"            return img_prop_predicate.satisfied_by(hyper_ver_str)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        for supp_inst in supp_instances:"},{"line_number":78,"context_line":"            if _compare_props(checked_img_props, supp_inst):"},{"line_number":79,"context_line":"                if _compare_product_version(hypervisor_version,"},{"line_number":80,"context_line":"                                                 image_props):"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAATH%2F%2FraI%3D","line":77,"updated":"2013-10-11 10:47:06.000000000","message":"A quick debug trace of the args here might make the later debug messages a lot simpler.","commit_id":"5bf308099f2fb468a8943b7b3967ad45f5d370d6"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"178bd6d3337d17647a66eaa3516f86328664264a","unresolved":false,"context_lines":[{"line_number":74,"context_line":"            hyper_ver_str \u003d utils.convert_version_to_str(hyper_version)"},{"line_number":75,"context_line":"            return img_prop_predicate.satisfied_by(hyper_ver_str)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        for supp_inst in supp_instances:"},{"line_number":78,"context_line":"            if _compare_props(checked_img_props, supp_inst):"},{"line_number":79,"context_line":"                if _compare_product_version(hypervisor_version,"},{"line_number":80,"context_line":"                                                 image_props):"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAATH%2F%2Fa3Y%3D","line":77,"in_reply_to":"AAAATH%2F%2FgS4%3D","updated":"2013-10-16 13:01:17.000000000","message":"Sure, but just thinking about simplifying the code.","commit_id":"5bf308099f2fb468a8943b7b3967ad45f5d370d6"},{"author":{"_account_id":7532,"name":"Aditi Raveesh","email":"aditi.raveesh@gmail.com","username":"aditiraveesh"},"change_message_id":"dcfb75be153ec0e88c9ae7def32a2dfa855b0369","unresolved":false,"context_lines":[{"line_number":74,"context_line":"            hyper_ver_str \u003d utils.convert_version_to_str(hyper_version)"},{"line_number":75,"context_line":"            return img_prop_predicate.satisfied_by(hyper_ver_str)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        for supp_inst in supp_instances:"},{"line_number":78,"context_line":"            if _compare_props(checked_img_props, supp_inst):"},{"line_number":79,"context_line":"                if _compare_product_version(hypervisor_version,"},{"line_number":80,"context_line":"                                                 image_props):"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAATH%2F%2FgS4%3D","line":77,"in_reply_to":"AAAATH%2F%2FraI%3D","updated":"2013-10-15 10:16:28.000000000","message":"Adding a log here would cause one line to be logged for each of supp_instances. When the check passes, or fails at the end, we have logging. Wouldn\u0027t that be enough information to debug?","commit_id":"5bf308099f2fb468a8943b7b3967ad45f5d370d6"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"3150710e1050df8feb238d7dce2d644a424384fe","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                    \u0027hypervisor_version\u0027: hypervisor_version})"},{"line_number":89,"context_line":"                    return True"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        LOG.debug(_(\"Instance contains properties %(image_props)s \""},{"line_number":92,"context_line":"                    \"that are not provided by the compute node \""},{"line_number":93,"context_line":"                    \"supported_instances %(supp_instances)s or \""},{"line_number":94,"context_line":"                    \"hypervisor version %(hypervisor_version)s do not match\"),"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAATH%2F%2FraQ%3D","line":91,"updated":"2013-10-11 10:47:06.000000000","message":"I think it might be better to distinguish between the two cases, by adding the appropriate else clauses.","commit_id":"5bf308099f2fb468a8943b7b3967ad45f5d370d6"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"178bd6d3337d17647a66eaa3516f86328664264a","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                    \u0027hypervisor_version\u0027: hypervisor_version})"},{"line_number":89,"context_line":"                    return True"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        LOG.debug(_(\"Instance contains properties %(image_props)s \""},{"line_number":92,"context_line":"                    \"that are not provided by the compute node \""},{"line_number":93,"context_line":"                    \"supported_instances %(supp_instances)s or \""},{"line_number":94,"context_line":"                    \"hypervisor version %(hypervisor_version)s do not match\"),"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAATH%2F%2Fa3I%3D","line":91,"in_reply_to":"AAAATH%2F%2FgSo%3D","updated":"2013-10-16 13:01:17.000000000","message":"I am thinking it would be good if we can tell the difference between the two possible reasons why it failed.","commit_id":"5bf308099f2fb468a8943b7b3967ad45f5d370d6"},{"author":{"_account_id":7532,"name":"Aditi Raveesh","email":"aditi.raveesh@gmail.com","username":"aditiraveesh"},"change_message_id":"dcfb75be153ec0e88c9ae7def32a2dfa855b0369","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                    \u0027hypervisor_version\u0027: hypervisor_version})"},{"line_number":89,"context_line":"                    return True"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        LOG.debug(_(\"Instance contains properties %(image_props)s \""},{"line_number":92,"context_line":"                    \"that are not provided by the compute node \""},{"line_number":93,"context_line":"                    \"supported_instances %(supp_instances)s or \""},{"line_number":94,"context_line":"                    \"hypervisor version %(hypervisor_version)s do not match\"),"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAATH%2F%2FgSo%3D","line":91,"in_reply_to":"AAAATH%2F%2FraQ%3D","updated":"2013-10-15 10:16:28.000000000","message":"Adding this would mean one line of logging for each of supp_instances which fails the check. If not, at the end of the loop, we wouldn\u0027t know for which reason the check failed for each of the supported instances.","commit_id":"5bf308099f2fb468a8943b7b3967ad45f5d370d6"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2fd54f9c2db22a9de9e3e2c7da3871ae4ba6dc87","unresolved":false,"context_lines":[{"line_number":60,"context_line":"            return False"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        version_required \u003d image_props.get(\u0027hypervisor_version_requires\u0027)"},{"line_number":63,"context_line":"        ignore_hyper_version \u003d not(hypervisor_version and version_required)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        def _compare_props(props, other_props):"},{"line_number":66,"context_line":"            for i in props:"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAATH%2F%2Fa10%3D","line":63,"updated":"2013-10-16 13:11:50.000000000","message":"I would be tempted to move this closer to where it is used on line 79, looks a bit odd being here.","commit_id":"143e224821d7d4ffecd2bb494a07b91435cef944"},{"author":{"_account_id":7532,"name":"Aditi Raveesh","email":"aditi.raveesh@gmail.com","username":"aditiraveesh"},"change_message_id":"04d7f533727a482a6583a6aba8fb048489279542","unresolved":false,"context_lines":[{"line_number":60,"context_line":"            return False"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        version_required \u003d image_props.get(\u0027hypervisor_version_requires\u0027)"},{"line_number":63,"context_line":"        ignore_hyper_version \u003d not(hypervisor_version and version_required)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        def _compare_props(props, other_props):"},{"line_number":66,"context_line":"            for i in props:"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAATH%2F%2FZ3I%3D","line":63,"in_reply_to":"AAAATH%2F%2Fa10%3D","updated":"2013-10-16 16:14:39.000000000","message":"Done","commit_id":"143e224821d7d4ffecd2bb494a07b91435cef944"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2fd54f9c2db22a9de9e3e2c7da3871ae4ba6dc87","unresolved":false,"context_lines":[{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        def _compare_product_version(hyper_version, image_props):"},{"line_number":72,"context_line":"            img_prop_predicate \u003d versionpredicate.VersionPredicate("},{"line_number":73,"context_line":"                \u0027image_prop (%s)\u0027 % image_props[\u0027hypervisor_version_requires\u0027])"},{"line_number":74,"context_line":"            hyper_ver_str \u003d utils.convert_version_to_str(hyper_version)"},{"line_number":75,"context_line":"            return img_prop_predicate.satisfied_by(hyper_ver_str)"},{"line_number":76,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAATH%2F%2Fa0s%3D","line":73,"updated":"2013-10-16 13:11:50.000000000","message":"If you move line 79 in here, then you can obviously use the value from version_required in here, to save having that key used in too many places.","commit_id":"143e224821d7d4ffecd2bb494a07b91435cef944"},{"author":{"_account_id":7532,"name":"Aditi Raveesh","email":"aditi.raveesh@gmail.com","username":"aditiraveesh"},"change_message_id":"04d7f533727a482a6583a6aba8fb048489279542","unresolved":false,"context_lines":[{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        def _compare_product_version(hyper_version, image_props):"},{"line_number":72,"context_line":"            img_prop_predicate \u003d versionpredicate.VersionPredicate("},{"line_number":73,"context_line":"                \u0027image_prop (%s)\u0027 % image_props[\u0027hypervisor_version_requires\u0027])"},{"line_number":74,"context_line":"            hyper_ver_str \u003d utils.convert_version_to_str(hyper_version)"},{"line_number":75,"context_line":"            return img_prop_predicate.satisfied_by(hyper_ver_str)"},{"line_number":76,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAATH%2F%2FZ3E%3D","line":73,"in_reply_to":"AAAATH%2F%2Fa0s%3D","updated":"2013-10-16 16:14:39.000000000","message":"Done","commit_id":"143e224821d7d4ffecd2bb494a07b91435cef944"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2fd54f9c2db22a9de9e3e2c7da3871ae4ba6dc87","unresolved":false,"context_lines":[{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        for supp_inst in supp_instances:"},{"line_number":78,"context_line":"            if _compare_props(checked_img_props, supp_inst):"},{"line_number":79,"context_line":"                if ignore_hyper_version:"},{"line_number":80,"context_line":"                    LOG.debug(_(\"Instance properties %(image_props)s \""},{"line_number":81,"context_line":"                                \"are satisfied by compute host \""},{"line_number":82,"context_line":"                                \"supported instances \""}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAATH%2F%2Fa08%3D","line":79,"updated":"2013-10-16 13:11:50.000000000","message":"I would be tempted to move this check into the _compare_produce_version function, I think it would be easier to read.","commit_id":"143e224821d7d4ffecd2bb494a07b91435cef944"},{"author":{"_account_id":7532,"name":"Aditi Raveesh","email":"aditi.raveesh@gmail.com","username":"aditiraveesh"},"change_message_id":"04d7f533727a482a6583a6aba8fb048489279542","unresolved":false,"context_lines":[{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        for supp_inst in supp_instances:"},{"line_number":78,"context_line":"            if _compare_props(checked_img_props, supp_inst):"},{"line_number":79,"context_line":"                if ignore_hyper_version:"},{"line_number":80,"context_line":"                    LOG.debug(_(\"Instance properties %(image_props)s \""},{"line_number":81,"context_line":"                                \"are satisfied by compute host \""},{"line_number":82,"context_line":"                                \"supported instances \""}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAATH%2F%2FZ3A%3D","line":79,"in_reply_to":"AAAATH%2F%2Fa08%3D","updated":"2013-10-16 16:14:39.000000000","message":"Done","commit_id":"143e224821d7d4ffecd2bb494a07b91435cef944"}],"nova/scheduler/host_manager.py":[{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"0428fb39e9bbdd07692e393da3812c803279ee0a","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        self.num_instances_by_project \u003d {}"},{"line_number":124,"context_line":"        self.num_instances_by_os_type \u003d {}"},{"line_number":125,"context_line":"        self.num_io_ops \u003d 0"},{"line_number":126,"context_line":"        self.hypervisor_version \u003d 0"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"        # Resource oversubscription values for the compute host:"},{"line_number":129,"context_line":"        self.limits \u003d {}"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAP3%2F%2F10w%3D","line":126,"updated":"2013-07-10 15:38:50.000000000","message":"I could be overlooking something, but it seems that self.hypervisor_version isn\u0027t needed.  The filter pull self.capabilities which is updated with the hypervisor_version already as far as I can tell.","commit_id":"42c127c92d12e75980bcc3441c4fef361718d3ed"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"fc6323089b9d6c12b7df8d83130d3594763935a5","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        self.num_instances_by_project \u003d {}"},{"line_number":124,"context_line":"        self.num_instances_by_os_type \u003d {}"},{"line_number":125,"context_line":"        self.num_io_ops \u003d 0"},{"line_number":126,"context_line":"        self.hypervisor_version \u003d 0"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"        # Resource oversubscription values for the compute host:"},{"line_number":129,"context_line":"        self.limits \u003d {}"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAP3%2F%2Fxqo%3D","line":126,"in_reply_to":"AAAAP3%2F%2F10w%3D","updated":"2013-07-11 16:31:18.000000000","message":"+1","commit_id":"42c127c92d12e75980bcc3441c4fef361718d3ed"}],"nova/tests/scheduler/filters/test_image_props_filter.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"4245b9f0ef9db0d511339fef98ba5c1cce290b8b","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        img_props \u003d {\u0027properties\u0027: {\u0027_architecture\u0027: \u0027x86_64\u0027,"},{"line_number":45,"context_line":"                                    \u0027hypervisor_type\u0027: \u0027kvm\u0027,"},{"line_number":46,"context_line":"                                    \u0027vm_mode\u0027: \u0027hvm\u0027,"},{"line_number":47,"context_line":"                                    \u0027hypervisor_version_requires\u0027: \u0027\u003e\u003d6.0\u0027}}"},{"line_number":48,"context_line":"        filter_properties \u003d {\u0027request_spec\u0027: {\u0027image\u0027: img_props}}"},{"line_number":49,"context_line":"        capabilities \u003d {\u0027enabled\u0027: True,"},{"line_number":50,"context_line":"                            \u0027supported_instances\u0027: ["}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAP3%2F%2Ft2o%3D","line":47,"updated":"2013-07-12 14:48:38.000000000","message":"Might be good to test a range of predicates","commit_id":"cf0e98d2455b73d2e2d611044d68714479e08c20"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"c35d7e3e365c4320db7ccdb1bd9cc43fc1417a0a","unresolved":false,"context_lines":[{"line_number":52,"context_line":"                                (\u0027x86_64\u0027, \u0027kvm\u0027, \u0027hvm\u0027)]}"},{"line_number":53,"context_line":"        host \u003d fakes.FakeHostState(\u0027host1\u0027, \u0027node1\u0027,"},{"line_number":54,"context_line":"                {\u0027capabilities\u0027: capabilities,"},{"line_number":55,"context_line":"                 \u0027hypervisor_version\u0027: 6000000})"},{"line_number":56,"context_line":"        self.assertTrue(filt_cls.host_passes(host, filter_properties))"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def test_image_properties_filter_fails_different_inst_props(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAP3%2F%2FkVM%3D","line":55,"updated":"2013-07-16 13:51:51.000000000","message":"You should use the utility method here.  It\u0027s not clear that 6000000 \u003d\u003d 6.0 in this context.  Same for all below.","commit_id":"b6c57e269a7fb688658ac9161b4ae4b25bb1fd11"},{"author":{"_account_id":7094,"name":"Aarti Kriplani","email":"aartimk@thoughtworks.com","username":"aarti.kriplani"},"change_message_id":"a0530c2ed71615d5d1104a6329a068de0d7583fe","unresolved":false,"context_lines":[{"line_number":52,"context_line":"                                (\u0027x86_64\u0027, \u0027kvm\u0027, \u0027hvm\u0027)]}"},{"line_number":53,"context_line":"        host \u003d fakes.FakeHostState(\u0027host1\u0027, \u0027node1\u0027,"},{"line_number":54,"context_line":"                {\u0027capabilities\u0027: capabilities,"},{"line_number":55,"context_line":"                 \u0027hypervisor_version\u0027: 6000000})"},{"line_number":56,"context_line":"        self.assertTrue(filt_cls.host_passes(host, filter_properties))"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def test_image_properties_filter_fails_different_inst_props(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAP3%2F%2FgL0%3D","line":55,"in_reply_to":"AAAAP3%2F%2FkVM%3D","updated":"2013-07-17 09:26:40.000000000","message":"Initially I did think of doing that but its using code in test. Moreover, tests would be dependent on the implementation of the conversion methods. But now I realize, we use the utils methods more like a library both in code and tests. So I\u0027ve done the change.","commit_id":"b6c57e269a7fb688658ac9161b4ae4b25bb1fd11"}],"nova/tests/scheduler/test_host_manager.py":[{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"c35d7e3e365c4320db7ccdb1bd9cc43fc1417a0a","unresolved":false,"context_lines":[{"line_number":437,"context_line":"        ]"},{"line_number":438,"context_line":"        compute \u003d dict(stats\u003dstats, memory_mb\u003d0, free_disk_gb\u003d0, local_gb\u003d0,"},{"line_number":439,"context_line":"                       local_gb_used\u003d0, free_ram_mb\u003d0, vcpus\u003d0, vcpus_used\u003d0,"},{"line_number":440,"context_line":"                       updated_at\u003dNone, hypervisor_version\u003d6000000)"},{"line_number":441,"context_line":""},{"line_number":442,"context_line":"        host \u003d host_manager.HostState(\"fakehost\", \"fakenode\")"},{"line_number":443,"context_line":"        host.update_from_compute_node(compute)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAP3%2F%2FkU0%3D","line":440,"updated":"2013-07-16 13:51:51.000000000","message":"Create version with utility method please.","commit_id":"b6c57e269a7fb688658ac9161b4ae4b25bb1fd11"}],"nova/tests/test_utils.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"3150710e1050df8feb238d7dce2d644a424384fe","unresolved":false,"context_lines":[{"line_number":934,"context_line":"    def test_convert_version_to_int(self):"},{"line_number":935,"context_line":"        self.assertEqual(utils.convert_version_to_int(\u00276.2.0\u0027), 6002000)"},{"line_number":936,"context_line":"        self.assertEqual(utils.convert_version_to_int((6, 4, 3)), 6004003)"},{"line_number":937,"context_line":"        self.assertEqual(utils.convert_version_to_int((5, )), 5)"},{"line_number":938,"context_line":""},{"line_number":939,"context_line":"    def test_convert_version_to_string(self):"},{"line_number":940,"context_line":"        self.assertEqual(utils.convert_version_to_str(6007000), \u00276.7.0\u0027)"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAATH%2F%2Fras%3D","line":937,"updated":"2013-10-11 10:47:06.000000000","message":"would be good to see how it deals with invalid values","commit_id":"5bf308099f2fb468a8943b7b3967ad45f5d370d6"},{"author":{"_account_id":7532,"name":"Aditi Raveesh","email":"aditi.raveesh@gmail.com","username":"aditiraveesh"},"change_message_id":"dcfb75be153ec0e88c9ae7def32a2dfa855b0369","unresolved":false,"context_lines":[{"line_number":934,"context_line":"    def test_convert_version_to_int(self):"},{"line_number":935,"context_line":"        self.assertEqual(utils.convert_version_to_int(\u00276.2.0\u0027), 6002000)"},{"line_number":936,"context_line":"        self.assertEqual(utils.convert_version_to_int((6, 4, 3)), 6004003)"},{"line_number":937,"context_line":"        self.assertEqual(utils.convert_version_to_int((5, )), 5)"},{"line_number":938,"context_line":""},{"line_number":939,"context_line":"    def test_convert_version_to_string(self):"},{"line_number":940,"context_line":"        self.assertEqual(utils.convert_version_to_str(6007000), \u00276.7.0\u0027)"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAATH%2F%2FgSg%3D","line":937,"in_reply_to":"AAAATH%2F%2Fras%3D","updated":"2013-10-15 10:16:28.000000000","message":"Added exception handling too.","commit_id":"5bf308099f2fb468a8943b7b3967ad45f5d370d6"}],"nova/utils.py":[{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"aa25db034209bd936f627e41bc3fed84b154f61f","unresolved":false,"context_lines":[{"line_number":1169,"context_line":""},{"line_number":1170,"context_line":"def convert_version_to_str(version_int):"},{"line_number":1171,"context_line":"    if not len(str(version_int)) in [7, 8, 9]:"},{"line_number":1172,"context_line":"        raise exception.InvalidHypervisorVersion()"},{"line_number":1173,"context_line":"    major \u003d version_int // 1000000"},{"line_number":1174,"context_line":"    minor \u003d (version_int - major * 1000000) // 1000"},{"line_number":1175,"context_line":"    patch \u003d (version_int - major * 1000000 - minor * 1000)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAQn%2F%2FWpQ%3D","line":1172,"updated":"2013-08-01 19:14:34.000000000","message":"A method in nova/utils.py should throw a hypervisor exception.","commit_id":"d0e8486c0906c2a78b3c8e62f9947b66d8201a0b"},{"author":{"_account_id":6992,"name":"Kaushik Chandrashekar","email":"kaushik.chandrashekar@rackspace.com","username":"kaushikc"},"change_message_id":"c9055f9e528f8564ac489521fe90d1c8349809ad","unresolved":false,"context_lines":[{"line_number":1169,"context_line":""},{"line_number":1170,"context_line":"def convert_version_to_str(version_int):"},{"line_number":1171,"context_line":"    if not len(str(version_int)) in [7, 8, 9]:"},{"line_number":1172,"context_line":"        raise exception.InvalidHypervisorVersion()"},{"line_number":1173,"context_line":"    major \u003d version_int // 1000000"},{"line_number":1174,"context_line":"    minor \u003d (version_int - major * 1000000) // 1000"},{"line_number":1175,"context_line":"    patch \u003d (version_int - major * 1000000 - minor * 1000)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAASn%2F%2F6Kw%3D","line":1172,"in_reply_to":"AAAAQn%2F%2FWpQ%3D","updated":"2013-08-28 05:02:43.000000000","message":"Done","commit_id":"d0e8486c0906c2a78b3c8e62f9947b66d8201a0b"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"51a24c7174bf67e2656d7be955a466bbe38cc756","unresolved":false,"context_lines":[{"line_number":1026,"context_line":"    return val.lower() \u003d\u003d \u0027none\u0027"},{"line_number":1027,"context_line":""},{"line_number":1028,"context_line":""},{"line_number":1029,"context_line":"def convert_version_to_int(version):"},{"line_number":1030,"context_line":"    try:"},{"line_number":1031,"context_line":"        if type(version) \u003d\u003d str:"},{"line_number":1032,"context_line":"            version \u003d convert_version_to_tuple(version)"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAATH%2F%2FIwc%3D","line":1029,"updated":"2013-10-22 16:52:18.000000000","message":"I don\u0027t think I like this. While this will likely work for all reasonable values there is there is the possibility for an unreasonable value. Someone could have a hypothetical version... say: 1.6.0_51 ... while nobody has yet released a hypervisor with a version number like this, I don\u0027t think we should be doing things that will require us to keep revisiting this issue should someone be stupid and not do things just the way we want them to. I also don\u0027t think its reasonable for us to say, \"you didn\u0027t use version numbers the way we want so you\u0027re out of OpenStack\"\n\nWhy can\u0027t we just use strings as versions in the database?\n\nAdmittedly this is all hypothetical, but if you just use a string for versions then you never have to revisit this issue again for the rest of human history.","commit_id":"a52259ea2dda742d528723d58f20b3b225f1eac5"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"66c68afb912ba1c6f90d2211aa6df5e73e481027","unresolved":false,"context_lines":[{"line_number":1026,"context_line":"    return val.lower() \u003d\u003d \u0027none\u0027"},{"line_number":1027,"context_line":""},{"line_number":1028,"context_line":""},{"line_number":1029,"context_line":"def convert_version_to_int(version):"},{"line_number":1030,"context_line":"    try:"},{"line_number":1031,"context_line":"        if type(version) \u003d\u003d str:"},{"line_number":1032,"context_line":"            version \u003d convert_version_to_tuple(version)"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAATn%2F%2F8ec%3D","line":1029,"in_reply_to":"AAAATH%2F%2FIsg%3D","updated":"2013-10-24 19:45:59.000000000","message":"Manual mappings \u0026 custom comparators\n\nIn extreme cases, there would have to be a manual mapping listing every known version name in a list (as a string) and defining each version names\u0027 ordinal position in the list of versions.\n\nIn less extreme cases vectors of number comparisons would allow for unusual version numbers (such as 1.99999.1 is before 2.0) since you would convert each positional number into a single integer value and compare each integer in a standard alphabet-like compare.\n\nFor example 1.99999.1 versus 2.0 is 1 versus 2 ... 2.0 is bigger, while 1.99999.1 versus 1.9.1 is 1 versus 1 followed by 99999 versus 9, 99999 is bigger so 1.99999.1 is bigger.","commit_id":"a52259ea2dda742d528723d58f20b3b225f1eac5"},{"author":{"_account_id":7532,"name":"Aditi Raveesh","email":"aditi.raveesh@gmail.com","username":"aditiraveesh"},"change_message_id":"6ac2cba3995dde9803791dff071f4effdad12be5","unresolved":false,"context_lines":[{"line_number":1026,"context_line":"    return val.lower() \u003d\u003d \u0027none\u0027"},{"line_number":1027,"context_line":""},{"line_number":1028,"context_line":""},{"line_number":1029,"context_line":"def convert_version_to_int(version):"},{"line_number":1030,"context_line":"    try:"},{"line_number":1031,"context_line":"        if type(version) \u003d\u003d str:"},{"line_number":1032,"context_line":"            version \u003d convert_version_to_tuple(version)"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAATH%2F%2FIsg%3D","line":1029,"in_reply_to":"AAAATH%2F%2FIwc%3D","updated":"2013-10-22 17:05:45.000000000","message":"I agree that storing the hypervisor_version as a string in the db would be a better approach. The blueprint for it has already been created.(https://blueprints.launchpad.net/nova/+spec/save-hypervisor-version-as-string)\n\nCurrently, this method will be used to validate the hypervisor_version only if it is the correct format, else it is not failed. For eg. version 6.1.2 will be \u003e 6.0, but using 6.1a will still not fail if we don\u0027t require the version to be matched.\n\nStoring versions as strings will still not solve the problem of them not being comparable. For eg. version 1.6_5 can be saved in the db, but will still fail any kind of version matching.\n\nThoughts?","commit_id":"a52259ea2dda742d528723d58f20b3b225f1eac5"}],"nova/virt/xenapi/driver.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"fc6323089b9d6c12b7df8d83130d3594763935a5","unresolved":false,"context_lines":[{"line_number":388,"context_line":"        :returns: dictionary describing resources"},{"line_number":389,"context_line":""},{"line_number":390,"context_line":"        \"\"\""},{"line_number":391,"context_line":"        def _munge_version(ver):"},{"line_number":392,"context_line":"            ver_tuple \u003d [int(x) for x in ver.split(\u0027.\u0027)]"},{"line_number":393,"context_line":"            return ver_tuple[0] * 1000000 + ver_tuple[1] * 1000 + ver_tuple[2]"},{"line_number":394,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAP3%2F%2Fxp0%3D","line":391,"updated":"2013-07-11 16:31:18.000000000","message":"can we call this _convert_to_libvirt_version or something like that?\n\ncan we move this into a common util rather than cut an paste from the libvirt code?","commit_id":"42c127c92d12e75980bcc3441c4fef361718d3ed"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"fc6323089b9d6c12b7df8d83130d3594763935a5","unresolved":false,"context_lines":[{"line_number":401,"context_line":"        free_ram_mb \u003d host_stats[\u0027host_memory_free_computed\u0027] / (1024 * 1024)"},{"line_number":402,"context_line":"        total_disk_gb \u003d host_stats[\u0027disk_total\u0027] / (1024 * 1024 * 1024)"},{"line_number":403,"context_line":"        used_disk_gb \u003d host_stats[\u0027disk_used\u0027] / (1024 * 1024 * 1024)"},{"line_number":404,"context_line":"        hypervisor_version \u003d _munge_version(host_stats[\u0027host_product_version\u0027])"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"        dic \u003d {\u0027vcpus\u0027: 0,"},{"line_number":407,"context_line":"               \u0027memory_mb\u0027: total_ram_mb,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAP3%2F%2FxqA%3D","line":404,"updated":"2013-07-11 16:31:18.000000000","message":"we already have this in the session","commit_id":"42c127c92d12e75980bcc3441c4fef361718d3ed"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"fc6323089b9d6c12b7df8d83130d3594763935a5","unresolved":false,"context_lines":[{"line_number":639,"context_line":"                                          \"(is the Dom0 disk full?)\"))"},{"line_number":640,"context_line":"        url \u003d self._create_first_session(url, user, pw, exception)"},{"line_number":641,"context_line":"        self._populate_session_pool(url, user, pw, exception)"},{"line_number":642,"context_line":"        self.host_uuid \u003d self._get_host_uuid()"},{"line_number":643,"context_line":"        self.product_version, self.product_brand \u003d \\"},{"line_number":644,"context_line":"            self._get_product_version_and_brand()"},{"line_number":645,"context_line":"        self._virtapi \u003d virtapi"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAP3%2F%2FxqI%3D","line":642,"updated":"2013-07-11 16:31:18.000000000","message":"Here we go...","commit_id":"42c127c92d12e75980bcc3441c4fef361718d3ed"}],"plugins/xenserver/xenapi/etc/xapi.d/plugins/xenhost":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"fc6323089b9d6c12b7df8d83130d3594763935a5","unresolved":false,"context_lines":[{"line_number":380,"context_line":"        for svln in sv.split(\"; \"):"},{"line_number":381,"context_line":"            svk, svv \u003d strip_kv(svln)"},{"line_number":382,"context_line":"            osv[svk] \u003d svv"},{"line_number":383,"context_line":"    out[\"host_product_version\"] \u003d osv[\"product_version\"]"},{"line_number":384,"context_line":"    cpuinf \u003d dct.get(\"cpu_info\", \"\")"},{"line_number":385,"context_line":"    out[\"host_cpu_info\"] \u003d ocp \u003d {}"},{"line_number":386,"context_line":"    if cpuinf:"}],"source_content_type":"application/octet-stream","patch_set":5,"id":"AAAAP3%2F%2FxqY%3D","line":383,"updated":"2013-07-11 16:31:18.000000000","message":"don\u0027t need this, we already have it.","commit_id":"42c127c92d12e75980bcc3441c4fef361718d3ed"}]}
