)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"d5bb995620638edf2dae3fb9445f58f36dc5b79b","unresolved":false,"context_lines":[{"line_number":45,"context_line":""},{"line_number":46,"context_line":"* Constructing a WSGI environ that has all the necessary bits to allow"},{"line_number":47,"context_line":"  calling the methods in the handlers directly (as python commands)."},{"line_number":48,"context_line":"  This would duplicate a fair bit of the middleware and seems error prone,"},{"line_number":49,"context_line":"  because it\u0027s hard to discern what parts of the environ need to be"},{"line_number":50,"context_line":"  filled. It\u0027s also weird for data input: we need to use a BytesIO to"},{"line_number":51,"context_line":"  pass in data on PUTs and POSTs."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f7c97a3_511ebc74","line":48,"range":{"start_line":48,"start_character":72,"end_line":48,"end_character":74},"updated":"2018-06-06 12:46:05.000000000","message":"oops","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"156fc3ac6dd079b59455453f407cca52105d9486","unresolved":false,"context_lines":[{"line_number":55,"context_line":"  adapter that we can swap into keystoneauth1\u0027s client creation."},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"* Using either the WSGI environ or wsgi-intercept models but wrap it"},{"line_number":58,"context_line":"  with a pythonic library that exposes a \"pretty\" interface to callers."},{"line_number":59,"context_line":"  Something like:"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"      placement.direct.allocations.update(consumer_uuid, {data})"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f7c97a3_529c7a5a","line":58,"updated":"2018-06-06 14:26:37.000000000","message":"This has the benefit that we can add the pretty interface incrementally top the wsgi-intercept your propose now when we see the need of it.","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"d5bb995620638edf2dae3fb9445f58f36dc5b79b","unresolved":false,"context_lines":[{"line_number":68,"context_line":"     json manipulation and validation and microversion handling, and"},{"line_number":69,"context_line":"     marshal data appropriately for the python lib)"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"I\u0027ve chosen the simplest thing as a starting point because it gives us"},{"line_number":72,"context_line":"something to talk over and could solve the immediate problem. If we were"},{"line_number":73,"context_line":"to eventually pursue the 4th option, I would hope that we had some"},{"line_number":74,"context_line":"significant discussion before doing so as I think it is a) harder than"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f7c97a3_8c0af71d","line":71,"range":{"start_line":71,"start_character":12,"end_line":71,"end_character":30},"updated":"2018-06-06 12:46:05.000000000","message":"Simple is better, IMO. Of the alternatives you mention, none seem as straightforward as this.","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0f3913a96f75791d88c99fa8188d34fbd475d065","unresolved":false,"context_lines":[{"line_number":69,"context_line":"     marshal data appropriately for the python lib)"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"I\u0027ve chosen the simplest thing as a starting point because it gives us"},{"line_number":72,"context_line":"something to talk over and could solve the immediate problem. If we were"},{"line_number":73,"context_line":"to eventually pursue the 4th option, I would hope that we had some"},{"line_number":74,"context_line":"significant discussion before doing so as I think it is a) harder than"},{"line_number":75,"context_line":"it might seem at first glance, b) likely to lead to many asking \"why"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f7c97a3_d00df335","line":72,"range":{"start_line":72,"start_character":33,"end_line":72,"end_character":60},"updated":"2018-06-06 00:49:42.000000000","message":"For those that weren\u0027t on the call that prompted this, I don\u0027t see anything in the commit message that explains (at a high level is good enough) what \"the problem\" is. I think it\u0027s basically, we need to provide a hook for offline migrations of nested resource providers during fast-forward upgrades.","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"5f9ea28c9afb9800073d6b2680c5a6111f1f9c79","unresolved":false,"context_lines":[{"line_number":69,"context_line":"     marshal data appropriately for the python lib)"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"I\u0027ve chosen the simplest thing as a starting point because it gives us"},{"line_number":72,"context_line":"something to talk over and could solve the immediate problem. If we were"},{"line_number":73,"context_line":"to eventually pursue the 4th option, I would hope that we had some"},{"line_number":74,"context_line":"significant discussion before doing so as I think it is a) harder than"},{"line_number":75,"context_line":"it might seem at first glance, b) likely to lead to many asking \"why"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f7c97a3_b07b9727","line":72,"range":{"start_line":72,"start_character":33,"end_line":72,"end_character":60},"in_reply_to":"5f7c97a3_d00df335","updated":"2018-06-06 01:05:58.000000000","message":"Yeah, totally. There was enough discussion in IRC when I mooted the idea that I decided to push out this rushed thing (that summarized some of that discussion but sadly not the earlier discussion) to get it under some eyes that might say \"dear god, no\" if that\u0027s how it went.","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3086f3c83e55d7774773f0574bcf28e6c0061379","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Provide a direct interface to placement"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This is a method of using wsgi-intercept to provide a context"},{"line_number":10,"context_line":"manager that allows talking to placement over requests, but without"},{"line_number":11,"context_line":"a network. It is a quick and dirty way to talk to and make changes"},{"line_number":12,"context_line":"in the placement database where the only network traffic is with the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5f7c97a3_08550ec2","line":9,"updated":"2018-06-11 16:34:46.000000000","message":"This is an excellent commit message, much of which I think may be appropriate to include in the spec.  Or would that be too much detail?","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"aba40802b973ead23b41356d3a8c91e484fe8eee","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Provide a direct interface to placement"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This is a method of using wsgi-intercept to provide a context"},{"line_number":10,"context_line":"manager that allows talking to placement over requests, but without"},{"line_number":11,"context_line":"a network. It is a quick and dirty way to talk to and make changes"},{"line_number":12,"context_line":"in the placement database where the only network traffic is with the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5f7c97a3_abfad4b6","line":9,"in_reply_to":"5f7c97a3_08550ec2","updated":"2018-06-11 16:54:04.000000000","message":"I can never decide on that. I tend to think that with the passage of time commit messages are the more durable artifact, but not really sure.\n\nUnfortunately since we are inconsistent with both commit message and specs (with regard to how much implementation detail we include) nobody is able to lear a habit.\n\nShort answer: dunno","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a3bdc3dc771012b820d092c02a07960272867c09","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Provide a direct interface to placement"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This is a method of using wsgi-intercept to provide a context"},{"line_number":10,"context_line":"manager that allows talking to placement over requests, but without"},{"line_number":11,"context_line":"a network. It is a quick and dirty way to talk to and make changes"},{"line_number":12,"context_line":"in the placement database where the only network traffic is with the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5f7c97a3_7cc00451","line":9,"in_reply_to":"5f7c97a3_abfad4b6","updated":"2018-06-11 19:09:12.000000000","message":"I wasn\u0027t for a minute suggesting that you trim this commit message.  Just pondering the value of copy/pasting some of it into the spec.","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3086f3c83e55d7774773f0574bcf28e6c0061379","unresolved":false,"context_lines":[{"line_number":43,"context_line":"  connection string, then you are good to go. That\u0027s what we want,"},{"line_number":44,"context_line":"  right?"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"  There\u0027s a flag in the code to make it so you can declare that you"},{"line_number":47,"context_line":"  want keystone in the loop."},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"* CONF construction being left up to the caller is on purpose"},{"line_number":50,"context_line":"  because right now placement itself is not super flexible in this"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5f7c97a3_35a5c703","line":47,"range":{"start_line":46,"start_character":2,"end_line":47,"end_character":28},"updated":"2018-06-11 16:34:46.000000000","message":"If you set that flag, is it still a \"no auth\" client?\n\n[Later] Can you point out said flag?  I\u0027m missing it.","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"aba40802b973ead23b41356d3a8c91e484fe8eee","unresolved":false,"context_lines":[{"line_number":43,"context_line":"  connection string, then you are good to go. That\u0027s what we want,"},{"line_number":44,"context_line":"  right?"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"  There\u0027s a flag in the code to make it so you can declare that you"},{"line_number":47,"context_line":"  want keystone in the loop."},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"* CONF construction being left up to the caller is on purpose"},{"line_number":50,"context_line":"  because right now placement itself is not super flexible in this"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5f7c97a3_4bbb00e4","line":47,"range":{"start_line":46,"start_character":2,"end_line":47,"end_character":28},"in_reply_to":"5f7c97a3_35a5c703","updated":"2018-06-11 16:54:04.000000000","message":"I removed it (because it doesn\u0027t work with the new architecture) but forgot to update the commit message.","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3086f3c83e55d7774773f0574bcf28e6c0061379","unresolved":false,"context_lines":[{"line_number":55,"context_line":"As indicated by the FIXME in direct.py (and to lesser extent the one in"},{"line_number":56,"context_line":"test_report_client), there\u0027s some overlap between what should be \"nova\""},{"line_number":57,"context_line":"and what should be \"placement\" about how this is done, with regard to"},{"line_number":58,"context_line":"the use a subclass of the ReportClient within PlacementDirect. For this"},{"line_number":59,"context_line":"go round, I\u0027ve met the immediate needs of nova. In the future, when we"},{"line_number":60,"context_line":"want PlacementDirect to not have a dependency on nova we\u0027ll want to do"},{"line_number":61,"context_line":"things differently, perhaps by subclassing a simplified PlacementDirect."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5f7c97a3_d56b331c","line":58,"range":{"start_line":58,"start_character":4,"end_line":58,"end_character":9},"updated":"2018-06-11 16:34:46.000000000","message":"use of a","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3086f3c83e55d7774773f0574bcf28e6c0061379","unresolved":false,"context_lines":[{"line_number":59,"context_line":"go round, I\u0027ve met the immediate needs of nova. In the future, when we"},{"line_number":60,"context_line":"want PlacementDirect to not have a dependency on nova we\u0027ll want to do"},{"line_number":61,"context_line":"things differently, perhaps by subclassing a simplified PlacementDirect."},{"line_number":62,"context_line":"Input on this encouraged."},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"This is not (by a long shot) the only way to do this. Other options"},{"line_number":65,"context_line":"include:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5f7c97a3_08c74e9a","line":62,"range":{"start_line":62,"start_character":0,"end_line":62,"end_character":25},"updated":"2018-06-11 16:34:46.000000000","message":"I was trying to suggest originally that this thing to be an Adapter subclass.  That would stand alone (be non-nova-specific) post extraction.  Then when nova wants to use it, it can wrap a report client around that Adapter, which could be enabled at [1] by:\n\n L247: def __init__(self, adapter\u003dNone):\n           self._adapter \u003d adapter\n\n L263: client \u003d self._adapter or utils.get_ksa_adapter(\u0027placement\u0027)\n\n[1] https://github.com/openstack/nova/blob/ef6b4f43f467dfad2fd0fe99d9dec3fc93a9ffed/nova/scheduler/client/report.py#L247-L263","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"aba40802b973ead23b41356d3a8c91e484fe8eee","unresolved":false,"context_lines":[{"line_number":59,"context_line":"go round, I\u0027ve met the immediate needs of nova. In the future, when we"},{"line_number":60,"context_line":"want PlacementDirect to not have a dependency on nova we\u0027ll want to do"},{"line_number":61,"context_line":"things differently, perhaps by subclassing a simplified PlacementDirect."},{"line_number":62,"context_line":"Input on this encouraged."},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"This is not (by a long shot) the only way to do this. Other options"},{"line_number":65,"context_line":"include:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5f7c97a3_cb7cf021","line":62,"range":{"start_line":62,"start_character":0,"end_line":62,"end_character":25},"in_reply_to":"5f7c97a3_08c74e9a","updated":"2018-06-11 16:54:04.000000000","message":"I thought about that but couldn\u0027t see how to do it in a simple way with the way that ReportClient and its _client aren\u0027t the same thing and my brain wasn\u0027t untangling things at the time and I latched on to the existing NoAuthReportClient as \"oh, this does all the immediate stuff\".\n\nI figured I\u0027d go with this and see where that got us. If you\u0027ve got a more in-depth example of an Adapter, as you\u0027re imagining it, lying around that you can point me to, I can explore that.","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a3bdc3dc771012b820d092c02a07960272867c09","unresolved":false,"context_lines":[{"line_number":59,"context_line":"go round, I\u0027ve met the immediate needs of nova. In the future, when we"},{"line_number":60,"context_line":"want PlacementDirect to not have a dependency on nova we\u0027ll want to do"},{"line_number":61,"context_line":"things differently, perhaps by subclassing a simplified PlacementDirect."},{"line_number":62,"context_line":"Input on this encouraged."},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"This is not (by a long shot) the only way to do this. Other options"},{"line_number":65,"context_line":"include:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"5f7c97a3_dcca784d","line":62,"range":{"start_line":62,"start_character":0,"end_line":62,"end_character":25},"in_reply_to":"5f7c97a3_cb7cf021","updated":"2018-06-11 19:09:12.000000000","message":"Ima play around with it and post my findings in a fup if I can get it to work.","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"24c86900820decd01513dbf3657925b1dab8f264","unresolved":false,"context_lines":[{"line_number":88,"context_line":"     for json manipulation and validation and microversion handling,"},{"line_number":89,"context_line":"     and marshal data appropriately for the python lib)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"I\u0027ve chosen the simplest thing as a starting point because it gives"},{"line_number":92,"context_line":"us something to talk over and could solve the immediate problem. If"},{"line_number":93,"context_line":"we were to eventually pursue the 4th option, I would hope that we"},{"line_number":94,"context_line":"had some significant discussion before doing so as I think it is a)"},{"line_number":95,"context_line":"harder than it might seem at first glance, b) likely to lead to many"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5f7c97a3_c554cb24","line":92,"range":{"start_line":91,"start_character":0,"end_line":92,"end_character":64},"updated":"2018-06-12 12:18:02.000000000","message":"+1","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d81b496bd6f5aad4cf89ecc132724c6efb865108","unresolved":false,"context_lines":[{"line_number":36,"context_line":"test_direct for minimal examples that ought to give an idea of what"},{"line_number":37,"context_line":"real callers could expect)."},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"To make things friendly in the nova context and ease creation of fast"},{"line_number":40,"context_line":"forward upgrade tools, SchedulerReportClient is tweaked to take an"},{"line_number":41,"context_line":"optional adapter kwarg on construction. If specified, this is used"},{"line_number":42,"context_line":"instead of creating one with get_ksa_adapter(), using settings from"},{"line_number":43,"context_line":"[placement] conf."},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"Doing things in this way draws a clear line between the placement parts"},{"line_number":46,"context_line":"and the nova parts while keeping the nova parts straightforward."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"NoAuthReportClient is replaced with a base test class,"},{"line_number":49,"context_line":"test_report_client.SchedulerReportClientTestBase. This provides an"},{"line_number":50,"context_line":"_interceptor() context manager which is a wrapper around"},{"line_number":51,"context_line":"PlacementDirect, but instead of producing an Adapter, it produces a"},{"line_number":52,"context_line":"SchedulerReportClient (which has been passed the Adapter provided by"},{"line_number":53,"context_line":"PlacementDirect). test_resource_tracker and test_report_client are"},{"line_number":54,"context_line":"updated accordingly."},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"Caveats to be aware of:"},{"line_number":57,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"5f7c97a3_37248b60","line":54,"range":{"start_line":39,"start_character":0,"end_line":54,"end_character":20},"updated":"2018-06-15 02:36:23.000000000","message":"I didn\u0027t really make the connection on why this was needed in this change - or why it\u0027s not a separate patch, since it really just seems like it\u0027s for reducing code duplication in those functional tests. Which is fine, it just isn\u0027t obvious why it was done in the same patch, but maybe I\u0027m missing something bigger.","commit_id":"43cc59abe2ac087f3447ef1a294041684545d1e4"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"ac4359b28ed9ec291cbc6763abefd9d63b01f54d","unresolved":false,"context_lines":[{"line_number":36,"context_line":"test_direct for minimal examples that ought to give an idea of what"},{"line_number":37,"context_line":"real callers could expect)."},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"To make things friendly in the nova context and ease creation of fast"},{"line_number":40,"context_line":"forward upgrade tools, SchedulerReportClient is tweaked to take an"},{"line_number":41,"context_line":"optional adapter kwarg on construction. If specified, this is used"},{"line_number":42,"context_line":"instead of creating one with get_ksa_adapter(), using settings from"},{"line_number":43,"context_line":"[placement] conf."},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"Doing things in this way draws a clear line between the placement parts"},{"line_number":46,"context_line":"and the nova parts while keeping the nova parts straightforward."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"NoAuthReportClient is replaced with a base test class,"},{"line_number":49,"context_line":"test_report_client.SchedulerReportClientTestBase. This provides an"},{"line_number":50,"context_line":"_interceptor() context manager which is a wrapper around"},{"line_number":51,"context_line":"PlacementDirect, but instead of producing an Adapter, it produces a"},{"line_number":52,"context_line":"SchedulerReportClient (which has been passed the Adapter provided by"},{"line_number":53,"context_line":"PlacementDirect). test_resource_tracker and test_report_client are"},{"line_number":54,"context_line":"updated accordingly."},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"Caveats to be aware of:"},{"line_number":57,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"5f7c97a3_b79c12c0","line":54,"range":{"start_line":39,"start_character":0,"end_line":54,"end_character":20},"in_reply_to":"5f7c97a3_37248b60","updated":"2018-06-15 10:29:46.000000000","message":"For sake of history: I started it because it was a useful way to prove that PlacementDirect was working (i tend to do a sort of hybrid TDD), while developing it and also to find the boundary between nova and placement.\n\nAnd then I reckon Eric followed along because I had set the tone.","commit_id":"43cc59abe2ac087f3447ef1a294041684545d1e4"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5b4d042d081be0b9ed8d36a9427b9a44f70c3b36","unresolved":false,"context_lines":[{"line_number":36,"context_line":"test_direct for minimal examples that ought to give an idea of what"},{"line_number":37,"context_line":"real callers could expect)."},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"To make things friendly in the nova context and ease creation of fast"},{"line_number":40,"context_line":"forward upgrade tools, SchedulerReportClient is tweaked to take an"},{"line_number":41,"context_line":"optional adapter kwarg on construction. If specified, this is used"},{"line_number":42,"context_line":"instead of creating one with get_ksa_adapter(), using settings from"},{"line_number":43,"context_line":"[placement] conf."},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"Doing things in this way draws a clear line between the placement parts"},{"line_number":46,"context_line":"and the nova parts while keeping the nova parts straightforward."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"NoAuthReportClient is replaced with a base test class,"},{"line_number":49,"context_line":"test_report_client.SchedulerReportClientTestBase. This provides an"},{"line_number":50,"context_line":"_interceptor() context manager which is a wrapper around"},{"line_number":51,"context_line":"PlacementDirect, but instead of producing an Adapter, it produces a"},{"line_number":52,"context_line":"SchedulerReportClient (which has been passed the Adapter provided by"},{"line_number":53,"context_line":"PlacementDirect). test_resource_tracker and test_report_client are"},{"line_number":54,"context_line":"updated accordingly."},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"Caveats to be aware of:"},{"line_number":57,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"5f7c97a3_4c472c20","line":54,"range":{"start_line":39,"start_character":0,"end_line":54,"end_character":20},"in_reply_to":"5f7c97a3_b79c12c0","updated":"2018-06-15 14:02:11.000000000","message":"The SchedulerReportClient change is required for the FFU script to be able to use the flow described in the spec.  The test mods are to exercise that usage path.  Agree it could have gone in a separate patch, but it\u0027s definitely not just for test dedup.","commit_id":"43cc59abe2ac087f3447ef1a294041684545d1e4"}],"nova/api/openstack/placement/direct.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0f3913a96f75791d88c99fa8188d34fbd475d065","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from nova.api.openstack.placement import deploy"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class PlacementDirect(interceptor.RequestsInterceptor):"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def __init__(self, conf, keystone\u003dFalse):"},{"line_number":32,"context_line":"        if not keystone:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_70e41f3d","line":29,"updated":"2018-06-06 00:49:42.000000000","message":"Probably want a docstring on this to explain what variables are returned from the entry to the context manager and the conf/keystone args on init.","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"5f9ea28c9afb9800073d6b2680c5a6111f1f9c79","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from nova.api.openstack.placement import deploy"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class PlacementDirect(interceptor.RequestsInterceptor):"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def __init__(self, conf, keystone\u003dFalse):"},{"line_number":32,"context_line":"        if not keystone:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_50bb23c3","line":29,"in_reply_to":"5f7c97a3_70e41f3d","updated":"2018-06-06 01:05:58.000000000","message":"Yeah, of course, I intend there to be a fairly extensive docstring of \"how to use this thing\" once it is some form of real.","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0f3913a96f75791d88c99fa8188d34fbd475d065","unresolved":false,"context_lines":[{"line_number":29,"context_line":"class PlacementDirect(interceptor.RequestsInterceptor):"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def __init__(self, conf, keystone\u003dFalse):"},{"line_number":32,"context_line":"        if not keystone:"},{"line_number":33,"context_line":"            conf.api.auth_strategy \u003d \u0027noauth2\u0027"},{"line_number":34,"context_line":"        app \u003d lambda: deploy.loadapp(conf)"},{"line_number":35,"context_line":"        self.url \u003d \u0027http://%s/placement\u0027 % str(uuid.uuid4())"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_30d0e753","line":32,"updated":"2018-06-06 00:49:42.000000000","message":"If keystone\u003dTrue, then...?","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"5f9ea28c9afb9800073d6b2680c5a6111f1f9c79","unresolved":false,"context_lines":[{"line_number":29,"context_line":"class PlacementDirect(interceptor.RequestsInterceptor):"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def __init__(self, conf, keystone\u003dFalse):"},{"line_number":32,"context_line":"        if not keystone:"},{"line_number":33,"context_line":"            conf.api.auth_strategy \u003d \u0027noauth2\u0027"},{"line_number":34,"context_line":"        app \u003d lambda: deploy.loadapp(conf)"},{"line_number":35,"context_line":"        self.url \u003d \u0027http://%s/placement\u0027 % str(uuid.uuid4())"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_d09df357","line":32,"in_reply_to":"5f7c97a3_30d0e753","updated":"2018-06-06 01:05:58.000000000","message":"If keystone middleware is configured in CONF and keystone is up, you\u0027re going to end up failing auth (as things are currently) written.\n\nThis is here to demonstrate that we could (if that\u0027s what people wanted for some reason) figure out how to integrate keystone into this.\n\nMy preference would be to not have it all, if we go with this style of doing things.","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d860c4b16c9dbdffd2562f9d17bbbc3d7be0036f","unresolved":false,"context_lines":[{"line_number":33,"context_line":"            conf.api.auth_strategy \u003d \u0027noauth2\u0027"},{"line_number":34,"context_line":"        app \u003d lambda: deploy.loadapp(conf)"},{"line_number":35,"context_line":"        self.url \u003d \u0027http://%s/placement\u0027 % str(uuid.uuid4())"},{"line_number":36,"context_line":"        session \u003d requests.Session()"},{"line_number":37,"context_line":"        session.headers.update({"},{"line_number":38,"context_line":"                \u0027accept\u0027: \u0027application/json\u0027,"},{"line_number":39,"context_line":"                \u0027content-type\u0027: \u0027application/json\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_e985985a","line":36,"range":{"start_line":36,"start_character":8,"end_line":36,"end_character":36},"updated":"2018-06-06 15:16:33.000000000","message":"So I\u0027m wondering if we can actually pass this session into ksa.Adapter() and have that (the Adapter) be our point of contact rather than the raw session.  That gives us some benefits, including microversion handling (both default and per-call) without us having to hack into the headers manually.","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"2fb10ff53a0a09eddaa3c9819f5d94b041d457b0","unresolved":false,"context_lines":[{"line_number":33,"context_line":"            conf.api.auth_strategy \u003d \u0027noauth2\u0027"},{"line_number":34,"context_line":"        app \u003d lambda: deploy.loadapp(conf)"},{"line_number":35,"context_line":"        self.url \u003d \u0027http://%s/placement\u0027 % str(uuid.uuid4())"},{"line_number":36,"context_line":"        session \u003d requests.Session()"},{"line_number":37,"context_line":"        session.headers.update({"},{"line_number":38,"context_line":"                \u0027accept\u0027: \u0027application/json\u0027,"},{"line_number":39,"context_line":"                \u0027content-type\u0027: \u0027application/json\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_8b32d30e","line":36,"range":{"start_line":36,"start_character":8,"end_line":36,"end_character":36},"in_reply_to":"5f7c97a3_70f3a9a0","updated":"2018-06-06 20:21:08.000000000","message":"Well, I could be totally wrong about this, but the nefarious FFU script could actually spin up a SchedulerReportClient because that\u0027s where the vast majority of the necessary logic will already live.  If we could spin up a SchedulerReportClient with a drop-in replacement for the adapter coming out of _create_client(), we wouldn\u0027t have to duplicate any of that logic against a (maddeningly only slightly) different interface to placement.","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"dcfa5a88614323e0e0cad934a1ce2ca67c03d4ea","unresolved":false,"context_lines":[{"line_number":33,"context_line":"            conf.api.auth_strategy \u003d \u0027noauth2\u0027"},{"line_number":34,"context_line":"        app \u003d lambda: deploy.loadapp(conf)"},{"line_number":35,"context_line":"        self.url \u003d \u0027http://%s/placement\u0027 % str(uuid.uuid4())"},{"line_number":36,"context_line":"        session \u003d requests.Session()"},{"line_number":37,"context_line":"        session.headers.update({"},{"line_number":38,"context_line":"                \u0027accept\u0027: \u0027application/json\u0027,"},{"line_number":39,"context_line":"                \u0027content-type\u0027: \u0027application/json\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_70f3a9a0","line":36,"range":{"start_line":36,"start_character":8,"end_line":36,"end_character":36},"in_reply_to":"5f7c97a3_e985985a","updated":"2018-06-06 19:04:49.000000000","message":"I suspect we could do that and it would probably be fine, but going into this I was undecided about how \"helpful\" we want this thing to be. In its most basic form (as it is now) the caller can make all the decisions about how it wants to do things and it is pretty clear that doing this stuff at all is way far out in left field. At least initially, left fields is where it seems like this stuff ought to be.\n\nIncluding being explicit about manipulating headers.\n\nI\u0027m happy to be dissuaded on multiple layers:\n\n* keep things as they are, but default to no microversion (thus earliest)\n* go more deluxe in some fashion","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0f3913a96f75791d88c99fa8188d34fbd475d065","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        self.url \u003d \u0027http://%s/placement\u0027 % str(uuid.uuid4())"},{"line_number":36,"context_line":"        session \u003d requests.Session()"},{"line_number":37,"context_line":"        session.headers.update({"},{"line_number":38,"context_line":"                \u0027accept\u0027: \u0027application/json\u0027,"},{"line_number":39,"context_line":"                \u0027content-type\u0027: \u0027application/json\u0027,"},{"line_number":40,"context_line":"                \u0027openstack-api-version\u0027: \u0027placement latest\u0027,"},{"line_number":41,"context_line":"        })"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_5050030b","line":38,"range":{"start_line":38,"start_character":8,"end_line":38,"end_character":16},"updated":"2018-06-06 00:49:42.000000000","message":"sweet baby jesus that\u0027s a lot of indent","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"d5bb995620638edf2dae3fb9445f58f36dc5b79b","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        self.url \u003d \u0027http://%s/placement\u0027 % str(uuid.uuid4())"},{"line_number":36,"context_line":"        session \u003d requests.Session()"},{"line_number":37,"context_line":"        session.headers.update({"},{"line_number":38,"context_line":"                \u0027accept\u0027: \u0027application/json\u0027,"},{"line_number":39,"context_line":"                \u0027content-type\u0027: \u0027application/json\u0027,"},{"line_number":40,"context_line":"                \u0027openstack-api-version\u0027: \u0027placement latest\u0027,"},{"line_number":41,"context_line":"        })"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_71b6588d","line":38,"range":{"start_line":38,"start_character":8,"end_line":38,"end_character":16},"in_reply_to":"5f7c97a3_10b5abcd","updated":"2018-06-06 12:46:05.000000000","message":"Two levels (8 spaces) is one standard for continued lines (and IMHO the best).","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"5f9ea28c9afb9800073d6b2680c5a6111f1f9c79","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        self.url \u003d \u0027http://%s/placement\u0027 % str(uuid.uuid4())"},{"line_number":36,"context_line":"        session \u003d requests.Session()"},{"line_number":37,"context_line":"        session.headers.update({"},{"line_number":38,"context_line":"                \u0027accept\u0027: \u0027application/json\u0027,"},{"line_number":39,"context_line":"                \u0027content-type\u0027: \u0027application/json\u0027,"},{"line_number":40,"context_line":"                \u0027openstack-api-version\u0027: \u0027placement latest\u0027,"},{"line_number":41,"context_line":"        })"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_10b5abcd","line":38,"range":{"start_line":38,"start_character":8,"end_line":38,"end_character":16},"in_reply_to":"5f7c97a3_5050030b","updated":"2018-06-06 01:05:58.000000000","message":"That\u0027s what my editor does by default for this kind of indent. I rather like it.","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0f3913a96f75791d88c99fa8188d34fbd475d065","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        session.headers.update({"},{"line_number":38,"context_line":"                \u0027accept\u0027: \u0027application/json\u0027,"},{"line_number":39,"context_line":"                \u0027content-type\u0027: \u0027application/json\u0027,"},{"line_number":40,"context_line":"                \u0027openstack-api-version\u0027: \u0027placement latest\u0027,"},{"line_number":41,"context_line":"        })"},{"line_number":42,"context_line":"        if not keystone:"},{"line_number":43,"context_line":"            session.headers.update({\u0027x-auth-token\u0027: \u0027admin\u0027})"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_f0a26ffc","line":40,"updated":"2018-06-06 00:49:42.000000000","message":"Hmm, I\u0027d go one of two ways with this:\n\n1. pass the version in per-request, like the scheduler report client does\n\n2. pass the version in when constructing this object - which is more like how novaclient and cinderclient work, and kind of suck since you\u0027re pinned to that version for all requests (and drive monty crazy)","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"dcfa5a88614323e0e0cad934a1ce2ca67c03d4ea","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        session.headers.update({"},{"line_number":38,"context_line":"                \u0027accept\u0027: \u0027application/json\u0027,"},{"line_number":39,"context_line":"                \u0027content-type\u0027: \u0027application/json\u0027,"},{"line_number":40,"context_line":"                \u0027openstack-api-version\u0027: \u0027placement latest\u0027,"},{"line_number":41,"context_line":"        })"},{"line_number":42,"context_line":"        if not keystone:"},{"line_number":43,"context_line":"            session.headers.update({\u0027x-auth-token\u0027: \u0027admin\u0027})"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_704f29be","line":40,"in_reply_to":"5f7c97a3_268c1fd6","updated":"2018-06-06 19:04:49.000000000","message":"with requests you can always set headers per request\n\nMy assumption thus far has been that anything (really the only thing thus far being /migrator) that wants to be using this will know exactly the microversion version it should be using. My use of latest here is effectively \"I\u0027m spiking something and that makes things work with minimal thought\".","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d860c4b16c9dbdffd2562f9d17bbbc3d7be0036f","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        session.headers.update({"},{"line_number":38,"context_line":"                \u0027accept\u0027: \u0027application/json\u0027,"},{"line_number":39,"context_line":"                \u0027content-type\u0027: \u0027application/json\u0027,"},{"line_number":40,"context_line":"                \u0027openstack-api-version\u0027: \u0027placement latest\u0027,"},{"line_number":41,"context_line":"        })"},{"line_number":42,"context_line":"        if not keystone:"},{"line_number":43,"context_line":"            session.headers.update({\u0027x-auth-token\u0027: \u0027admin\u0027})"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_268c1fd6","line":40,"in_reply_to":"5f7c97a3_b0ce3759","updated":"2018-06-06 15:16:33.000000000","message":"The way Adapter works is that you can specify a default microversion when you build the Adapter, and then optionally override it on a per-call basis.  In the report client, we\u0027re defaulting to earliest; it just happens that most of the things we need to do are from later microversions, so we\u0027re overriding on most calls.\n\nIn that spirit, we should probably have this constructor accept a default microversion as a kwarg, and default the default (!) if it\u0027s not specified.  (I\u0027m not convinced \u0027latest\u0027 is the right default default, for the same reasons we\u0027re not doing that in the report client.)\n\nIn any case, we should be allowing microversion overrides per call, which it doesn\u0027t look like this handles yet.  (See note above about wrapping session in Adapter().)","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"5f9ea28c9afb9800073d6b2680c5a6111f1f9c79","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        session.headers.update({"},{"line_number":38,"context_line":"                \u0027accept\u0027: \u0027application/json\u0027,"},{"line_number":39,"context_line":"                \u0027content-type\u0027: \u0027application/json\u0027,"},{"line_number":40,"context_line":"                \u0027openstack-api-version\u0027: \u0027placement latest\u0027,"},{"line_number":41,"context_line":"        })"},{"line_number":42,"context_line":"        if not keystone:"},{"line_number":43,"context_line":"            session.headers.update({\u0027x-auth-token\u0027: \u0027admin\u0027})"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_b0ce3759","line":40,"in_reply_to":"5f7c97a3_f0a26ffc","updated":"2018-06-06 01:05:58.000000000","message":"What I\u0027ve implemented is:\n\n3. override per request if you want to\n\nmaking the assumption that if someone is using this thing they are already deep into needing to do special stuff. But 1 might be the better choicer for that. I reckon option 2 is a non-starter. Except for the monty-crazy-driving.","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3086f3c83e55d7774773f0574bcf28e6c0061379","unresolved":false,"context_lines":[{"line_number":28,"context_line":"from nova.api.openstack.placement import deploy"},{"line_number":29,"context_line":"from nova.scheduler.client import report"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"# FIXME(cdent): Undecided where to create the boundary between placement"},{"line_number":32,"context_line":"# and nova. PlacementDirect is something that placement should export,"},{"line_number":33,"context_line":"# but the report client should definitely stay in nova. It might make"},{"line_number":34,"context_line":"# sense for there to be a ReportClientDirect (in nova) which is a subclass"},{"line_number":35,"context_line":"# of a PlacementDirect that is simpler than the one currently provided"},{"line_number":36,"context_line":"# here."},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"class NoAuthReportClient(report.SchedulerReportClient):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_e8f53284","line":36,"range":{"start_line":31,"start_character":0,"end_line":36,"end_character":7},"updated":"2018-06-11 16:34:46.000000000","message":"See my comment in the commit message.","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3086f3c83e55d7774773f0574bcf28e6c0061379","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        headers \u003d {"},{"line_number":56,"context_line":"            \u0027x-auth-token\u0027: \u0027admin\u0027,"},{"line_number":57,"context_line":"        }"},{"line_number":58,"context_line":"        if latest_microversion:"},{"line_number":59,"context_line":"            headers[\u0027OpenStack-API-Version\u0027] \u003d \u0027placement latest\u0027"},{"line_number":60,"context_line":"        self._client \u003d adapter.Adapter("},{"line_number":61,"context_line":"            session.Session(auth\u003dNone, session\u003drequest_session,"},{"line_number":62,"context_line":"                            additional_headers\u003dheaders),"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_88fd9eb3","line":59,"range":{"start_line":58,"start_character":8,"end_line":59,"end_character":65},"updated":"2018-06-11 16:34:46.000000000","message":"Do this via the `default_microversion` kwarg to Adapter().  You get extra logic that way.","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"aba40802b973ead23b41356d3a8c91e484fe8eee","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        headers \u003d {"},{"line_number":56,"context_line":"            \u0027x-auth-token\u0027: \u0027admin\u0027,"},{"line_number":57,"context_line":"        }"},{"line_number":58,"context_line":"        if latest_microversion:"},{"line_number":59,"context_line":"            headers[\u0027OpenStack-API-Version\u0027] \u003d \u0027placement latest\u0027"},{"line_number":60,"context_line":"        self._client \u003d adapter.Adapter("},{"line_number":61,"context_line":"            session.Session(auth\u003dNone, session\u003drequest_session,"},{"line_number":62,"context_line":"                            additional_headers\u003dheaders),"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_cba15097","line":59,"range":{"start_line":58,"start_character":8,"end_line":59,"end_character":65},"in_reply_to":"5f7c97a3_88fd9eb3","updated":"2018-06-11 16:54:04.000000000","message":"Is there a reason why that wasn\u0027t used in the original NoAuthReportClient (before I moved it from test_report_client)?","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a3bdc3dc771012b820d092c02a07960272867c09","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        headers \u003d {"},{"line_number":56,"context_line":"            \u0027x-auth-token\u0027: \u0027admin\u0027,"},{"line_number":57,"context_line":"        }"},{"line_number":58,"context_line":"        if latest_microversion:"},{"line_number":59,"context_line":"            headers[\u0027OpenStack-API-Version\u0027] \u003d \u0027placement latest\u0027"},{"line_number":60,"context_line":"        self._client \u003d adapter.Adapter("},{"line_number":61,"context_line":"            session.Session(auth\u003dNone, session\u003drequest_session,"},{"line_number":62,"context_line":"                            additional_headers\u003dheaders),"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_1c23105a","line":59,"range":{"start_line":58,"start_character":8,"end_line":59,"end_character":65},"in_reply_to":"5f7c97a3_cba15097","updated":"2018-06-11 19:09:12.000000000","message":"Because the header in NoAuthReportClient [1] was introduced before the default_microversion kwarg [2].\n\n[1] https://review.openstack.org/#/c/407309/16/nova/tests/functional/api/openstack/placement/test_report_client.py@43\n[2] https://review.openstack.org/#/c/482746/13/keystoneauth1/adapter.py@80","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3086f3c83e55d7774773f0574bcf28e6c0061379","unresolved":false,"context_lines":[{"line_number":67,"context_line":"    \"\"\"Provide access to the placement service without real HTTP."},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    wsgi-intercept is used to provide a"},{"line_number":70,"context_line":"    scheduler.client.report.ReportClient that has access an in-process"},{"line_number":71,"context_line":"    placement service. This povides access to making changes to the"},{"line_number":72,"context_line":"    placement database without requiring HTTP over the network, it remains"},{"line_number":73,"context_line":"    in-process."}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_c893965b","line":70,"range":{"start_line":70,"start_character":57,"end_line":70,"end_character":59},"updated":"2018-06-11 16:34:46.000000000","message":"to an","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3086f3c83e55d7774773f0574bcf28e6c0061379","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    wsgi-intercept is used to provide a"},{"line_number":70,"context_line":"    scheduler.client.report.ReportClient that has access an in-process"},{"line_number":71,"context_line":"    placement service. This povides access to making changes to the"},{"line_number":72,"context_line":"    placement database without requiring HTTP over the network, it remains"},{"line_number":73,"context_line":"    in-process."},{"line_number":74,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_88eb5edb","line":71,"range":{"start_line":71,"start_character":28,"end_line":71,"end_character":35},"updated":"2018-06-11 16:34:46.000000000","message":"provides\n\nhttp://tineta.com/tineta/product/povide-fr-spray/index.html","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3086f3c83e55d7774773f0574bcf28e6c0061379","unresolved":false,"context_lines":[{"line_number":83,"context_line":"    with PlacementDirect(cfg.CONF) as client:"},{"line_number":84,"context_line":"        allocations \u003d client.get_allocations_for_consumer(context, consumer)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    :param conf: An oslo config with the options used to configured"},{"line_number":87,"context_line":"                 the placement service (notable database connection"},{"line_number":88,"context_line":"                 string)."},{"line_number":89,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_688e022f","line":86,"range":{"start_line":86,"start_character":57,"end_line":86,"end_character":67},"updated":"2018-06-11 16:34:46.000000000","message":"configure","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3086f3c83e55d7774773f0574bcf28e6c0061379","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        allocations \u003d client.get_allocations_for_consumer(context, consumer)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    :param conf: An oslo config with the options used to configured"},{"line_number":87,"context_line":"                 the placement service (notable database connection"},{"line_number":88,"context_line":"                 string)."},{"line_number":89,"context_line":"    \"\"\""},{"line_number":90,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_087f4e17","line":87,"range":{"start_line":87,"start_character":40,"end_line":87,"end_character":47},"updated":"2018-06-11 16:34:46.000000000","message":"notably?","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3086f3c83e55d7774773f0574bcf28e6c0061379","unresolved":false,"context_lines":[{"line_number":89,"context_line":"    \"\"\""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def __init__(self, conf):"},{"line_number":92,"context_line":"        conf.api.auth_strategy \u003d \u0027noauth2\u0027"},{"line_number":93,"context_line":"        app \u003d lambda: deploy.loadapp(conf)"},{"line_number":94,"context_line":"        self.url \u003d \u0027http://%s/placement\u0027 % str(uuidutils.generate_uuid())"},{"line_number":95,"context_line":"        self.client \u003d NoAuthReportClient(latest_microversion\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_08e2eed4","line":92,"range":{"start_line":92,"start_character":8,"end_line":92,"end_character":30},"updated":"2018-06-11 16:34:46.000000000","message":"If I\u0027m reusing a conf from elsewhere in my process, does this have potentially dangerous side effects to something else that uses [api]auth_strategy?\n\nAlso... is [api] the right conf section for this?  Not [api_database]?  (Or [placement_database] once [1] lands?)\n\n[1] https://review.openstack.org/#/c/362766/","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"aba40802b973ead23b41356d3a8c91e484fe8eee","unresolved":false,"context_lines":[{"line_number":89,"context_line":"    \"\"\""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def __init__(self, conf):"},{"line_number":92,"context_line":"        conf.api.auth_strategy \u003d \u0027noauth2\u0027"},{"line_number":93,"context_line":"        app \u003d lambda: deploy.loadapp(conf)"},{"line_number":94,"context_line":"        self.url \u003d \u0027http://%s/placement\u0027 % str(uuidutils.generate_uuid())"},{"line_number":95,"context_line":"        self.client \u003d NoAuthReportClient(latest_microversion\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_cbf8707d","line":92,"range":{"start_line":92,"start_character":8,"end_line":92,"end_character":30},"in_reply_to":"5f7c97a3_08e2eed4","updated":"2018-06-11 16:54:04.000000000","message":"auth_strategy comes from the generic [api] strategy in the conf, the assumption has always been that for _this process_ the api is whatever wsgi app is running.\n\nTo make this safer we could perhaps save any existing setting and make this change in __enter__ and put the saved one back in __exit__.","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"ca932cebf3762154e017d55500d9e6f0f903ad24","unresolved":false,"context_lines":[{"line_number":89,"context_line":"    \"\"\""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def __init__(self, conf):"},{"line_number":92,"context_line":"        conf.api.auth_strategy \u003d \u0027noauth2\u0027"},{"line_number":93,"context_line":"        app \u003d lambda: deploy.loadapp(conf)"},{"line_number":94,"context_line":"        self.url \u003d \u0027http://%s/placement\u0027 % str(uuidutils.generate_uuid())"},{"line_number":95,"context_line":"        self.client \u003d NoAuthReportClient(latest_microversion\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_dcb0388e","line":92,"range":{"start_line":92,"start_character":8,"end_line":92,"end_character":30},"in_reply_to":"5f7c97a3_7cd7a424","updated":"2018-06-11 19:20:48.000000000","message":"note to self: this should be a set_override","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a3bdc3dc771012b820d092c02a07960272867c09","unresolved":false,"context_lines":[{"line_number":89,"context_line":"    \"\"\""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def __init__(self, conf):"},{"line_number":92,"context_line":"        conf.api.auth_strategy \u003d \u0027noauth2\u0027"},{"line_number":93,"context_line":"        app \u003d lambda: deploy.loadapp(conf)"},{"line_number":94,"context_line":"        self.url \u003d \u0027http://%s/placement\u0027 % str(uuidutils.generate_uuid())"},{"line_number":95,"context_line":"        self.client \u003d NoAuthReportClient(latest_microversion\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_7cd7a424","line":92,"range":{"start_line":92,"start_character":8,"end_line":92,"end_character":30},"in_reply_to":"5f7c97a3_cbf8707d","updated":"2018-06-11 19:09:12.000000000","message":"If it wasn\u0027t safe to begin with, it would still be unsafe within the scope of the context manager, but less scrutably so.\n\nI was truly asking the question, not backhandedly asserting there\u0027s a problem.  If you think it\u0027s okay, I\u0027m good with that.  Perhaps a NOTE with the justification?","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d5b9a75d8681a5ac1daac1c4d31e8de6e803a224","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    turning the wsgi-intercept on and off, and setting and removing"},{"line_number":43,"context_line":"    mocks required to keystoneauth1 to work around endpoint discovery."},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    Example::"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    with PlacementDirect(cfg.CONF, latest_microversion\u003dTrue) as client:"},{"line_number":48,"context_line":"        allocations \u003d client.get(\u0027/allocations/%s\u0027 % consumer)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    :param conf: An oslo config with the options used to configure"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_a1d17efd","line":47,"range":{"start_line":45,"start_character":11,"end_line":47,"end_character":4},"updated":"2018-06-12 15:03:58.000000000","message":"Possible that this isn\u0027t proper rst without extra indents on the code sample paragraph.  Since we\u0027re not generating docs, though...","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5b656230f28d93850c8b123ce5a9f56f267f2168","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    turning the wsgi-intercept on and off, and setting and removing"},{"line_number":43,"context_line":"    mocks required to keystoneauth1 to work around endpoint discovery."},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    Example::"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    with PlacementDirect(cfg.CONF, latest_microversion\u003dTrue) as client:"},{"line_number":48,"context_line":"        allocations \u003d client.get(\u0027/allocations/%s\u0027 % consumer)"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    :param conf: An oslo config with the options used to configure"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_7cdc6de0","line":47,"range":{"start_line":45,"start_character":11,"end_line":47,"end_character":4},"in_reply_to":"5f7c97a3_a1d17efd","updated":"2018-06-12 16:01:28.000000000","message":"Done","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"b2dadc62c184739f251bd9185a25a83faf7df8d1","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def __init__(self, conf, app\u003dNone, latest_microversion\u003dFalse):"},{"line_number":62,"context_line":"        conf.set_override(\u0027auth_strategy\u0027, \u0027noauth2\u0027, group\u003d\u0027api\u0027)"},{"line_number":63,"context_line":"        app \u003d app or (lambda: deploy.loadapp(conf))"},{"line_number":64,"context_line":"        self.url \u003d \u0027http://%s/placement\u0027 % str(uuidutils.generate_uuid())"},{"line_number":65,"context_line":"        # Supply our own session so the wsgi-intercept can intercept"},{"line_number":66,"context_line":"        # the right thing."}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_85bd7369","line":63,"updated":"2018-06-12 11:39:49.000000000","message":"The semantics of sending in a different app while also requiring a conf (and setting auth_strategy) is a bit weird.\n\nIt might be the case we should only require and change conf if app \u003d\u003d None.","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5b656230f28d93850c8b123ce5a9f56f267f2168","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def __init__(self, conf, app\u003dNone, latest_microversion\u003dFalse):"},{"line_number":62,"context_line":"        conf.set_override(\u0027auth_strategy\u0027, \u0027noauth2\u0027, group\u003d\u0027api\u0027)"},{"line_number":63,"context_line":"        app \u003d app or (lambda: deploy.loadapp(conf))"},{"line_number":64,"context_line":"        self.url \u003d \u0027http://%s/placement\u0027 % str(uuidutils.generate_uuid())"},{"line_number":65,"context_line":"        # Supply our own session so the wsgi-intercept can intercept"},{"line_number":66,"context_line":"        # the right thing."}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_1cf1b96b","line":63,"in_reply_to":"5f7c97a3_4193ca4f","updated":"2018-06-12 16:01:28.000000000","message":"Done","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"a68a143fd4d02366f789f6236c99b401f849d5a3","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def __init__(self, conf, app\u003dNone, latest_microversion\u003dFalse):"},{"line_number":62,"context_line":"        conf.set_override(\u0027auth_strategy\u0027, \u0027noauth2\u0027, group\u003d\u0027api\u0027)"},{"line_number":63,"context_line":"        app \u003d app or (lambda: deploy.loadapp(conf))"},{"line_number":64,"context_line":"        self.url \u003d \u0027http://%s/placement\u0027 % str(uuidutils.generate_uuid())"},{"line_number":65,"context_line":"        # Supply our own session so the wsgi-intercept can intercept"},{"line_number":66,"context_line":"        # the right thing."}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_5c1e51bb","line":63,"in_reply_to":"5f7c97a3_4193ca4f","updated":"2018-06-12 15:14:58.000000000","message":"that\u0027s correct, the app isn\u0027t executed until later","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d5b9a75d8681a5ac1daac1c4d31e8de6e803a224","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def __init__(self, conf, app\u003dNone, latest_microversion\u003dFalse):"},{"line_number":62,"context_line":"        conf.set_override(\u0027auth_strategy\u0027, \u0027noauth2\u0027, group\u003d\u0027api\u0027)"},{"line_number":63,"context_line":"        app \u003d app or (lambda: deploy.loadapp(conf))"},{"line_number":64,"context_line":"        self.url \u003d \u0027http://%s/placement\u0027 % str(uuidutils.generate_uuid())"},{"line_number":65,"context_line":"        # Supply our own session so the wsgi-intercept can intercept"},{"line_number":66,"context_line":"        # the right thing."}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_4193ca4f","line":63,"in_reply_to":"5f7c97a3_85bd7369","updated":"2018-06-12 15:03:58.000000000","message":"The app kwarg was added for the couple of outlying test cases that needed to do something special.  Is there any prod use case that could want to send its own app?  If not (or until such a need is expressed) maybe it makes more sense to do this bit in a test-only subclass.\n\n[Later] I looked through the RequestsInterceptor code and I think it would even be possible to do:\n\n interceptor \u003d PlacementDirect(CONF)\n interceptor.app \u003d my_snowflake_app\n with interceptor as client:\n     ...\n\n...because it looks like the app doesn\u0027t get used until you actually try to do something with the connection.","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d5b9a75d8681a5ac1daac1c4d31e8de6e803a224","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        if latest_microversion:"},{"line_number":73,"context_line":"            headers[\u0027OpenStack-API-Version\u0027] \u003d \u0027placement latest\u0027"},{"line_number":74,"context_line":"        self.adapter \u003d adapter.Adapter("},{"line_number":75,"context_line":"            session.Session(auth\u003dNone, session\u003drequest_session,"},{"line_number":76,"context_line":"                            additional_headers\u003dheaders),"},{"line_number":77,"context_line":"            service_type\u003d\u0027placement\u0027)"},{"line_number":78,"context_line":"        # TODO(efried): Figure out why this isn\u0027t working:"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_41a50ab4","line":75,"range":{"start_line":75,"start_character":39,"end_line":75,"end_character":62},"updated":"2018-06-12 15:03:58.000000000","message":"Note to self: Specifying this bypasses the use of TCPKeepAliveAdapter, which is unnecessary since we\u0027re not going over the network.\n\nhttps://github.com/openstack/keystoneauth/blob/36ed4c11cb02042a0f5e58e39357ee621880ffc1/keystoneauth1/session.py#L58-L62","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"a68a143fd4d02366f789f6236c99b401f849d5a3","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        if latest_microversion:"},{"line_number":73,"context_line":"            headers[\u0027OpenStack-API-Version\u0027] \u003d \u0027placement latest\u0027"},{"line_number":74,"context_line":"        self.adapter \u003d adapter.Adapter("},{"line_number":75,"context_line":"            session.Session(auth\u003dNone, session\u003drequest_session,"},{"line_number":76,"context_line":"                            additional_headers\u003dheaders),"},{"line_number":77,"context_line":"            service_type\u003d\u0027placement\u0027)"},{"line_number":78,"context_line":"        # TODO(efried): Figure out why this isn\u0027t working:"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_7c19cdce","line":75,"range":{"start_line":75,"start_character":39,"end_line":75,"end_character":62},"in_reply_to":"5f7c97a3_41a50ab4","updated":"2018-06-12 15:14:58.000000000","message":"yes","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d81b496bd6f5aad4cf89ecc132724c6efb865108","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        # the right thing."},{"line_number":65,"context_line":"        request_session \u003d requests.Session()"},{"line_number":66,"context_line":"        headers \u003d {"},{"line_number":67,"context_line":"            \u0027x-auth-token\u0027: \u0027admin\u0027,"},{"line_number":68,"context_line":"        }"},{"line_number":69,"context_line":"        # TODO(efried): See below"},{"line_number":70,"context_line":"        if latest_microversion:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_57a6e711","line":67,"updated":"2018-06-15 02:36:23.000000000","message":"Notable this will give the request context the \u0027admin\u0027 role which is good enough for the defaults, but if someone configured the placement policy for rules with some non-admin type role, then things could fail due to policy, but let\u0027s cross that bridge when we get there.","commit_id":"43cc59abe2ac087f3447ef1a294041684545d1e4"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"ac4359b28ed9ec291cbc6763abefd9d63b01f54d","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        # the right thing."},{"line_number":65,"context_line":"        request_session \u003d requests.Session()"},{"line_number":66,"context_line":"        headers \u003d {"},{"line_number":67,"context_line":"            \u0027x-auth-token\u0027: \u0027admin\u0027,"},{"line_number":68,"context_line":"        }"},{"line_number":69,"context_line":"        # TODO(efried): See below"},{"line_number":70,"context_line":"        if latest_microversion:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_d7b42e39","line":67,"in_reply_to":"5f7c97a3_57a6e711","updated":"2018-06-15 10:29:46.000000000","message":"It\u0027ll be an interesting bridge because this code will run on the nova-compute nodes, not the server where placement is, so assuming the custom policy file is not copied to the nova-compute node, they\u0027ll get the defaults, which will be different from their server.\n\nAnd confusing.","commit_id":"43cc59abe2ac087f3447ef1a294041684545d1e4"}],"nova/tests/functional/api/openstack/placement/test_direct.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0f3913a96f75791d88c99fa8188d34fbd475d065","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"# FIXME(cdent): some dupes with db/test_base.py"},{"line_number":25,"context_line":"class TestDirect(test.NoDBTestCase):"},{"line_number":26,"context_line":"    USES_DB_SELF \u003d True"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def setUp(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_f03eef89","line":25,"updated":"2018-06-06 00:49:42.000000000","message":"Would be nice to have a negative test where you pass in something that will fail json validation just to see that work properly with the direct context.","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"5f9ea28c9afb9800073d6b2680c5a6111f1f9c79","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"# FIXME(cdent): some dupes with db/test_base.py"},{"line_number":25,"context_line":"class TestDirect(test.NoDBTestCase):"},{"line_number":26,"context_line":"    USES_DB_SELF \u003d True"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def setUp(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_5009e392","line":25,"in_reply_to":"5f7c97a3_f03eef89","updated":"2018-06-06 01:05:58.000000000","message":"Good idea, will do something like that after this gets past a first wave of \"do or do not hate\" feedback.","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"156fc3ac6dd079b59455453f407cca52105d9486","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        resource_provider._TRAITS_SYNCED \u003d False"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def test_direct_is_there(self):"},{"line_number":41,"context_line":"        with direct.PlacementDirect(CONF) as (url, session):"},{"line_number":42,"context_line":"            resp \u003d session.get(url + \u0027/\u0027)"},{"line_number":43,"context_line":"            self.assertTrue(resp)"},{"line_number":44,"context_line":"            data \u003d resp.json()"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_32d9bef3","line":41,"range":{"start_line":41,"start_character":46,"end_line":41,"end_character":49},"updated":"2018-06-06 14:26:37.000000000","message":"As the url always ends up in the session.\u003cverb\u003e() call as the prefix of the first param we could automate that by wrapping the session to a minimal class providing \u003cverb\u003e functions.","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"dcfa5a88614323e0e0cad934a1ce2ca67c03d4ea","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        resource_provider._TRAITS_SYNCED \u003d False"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def test_direct_is_there(self):"},{"line_number":41,"context_line":"        with direct.PlacementDirect(CONF) as (url, session):"},{"line_number":42,"context_line":"            resp \u003d session.get(url + \u0027/\u0027)"},{"line_number":43,"context_line":"            self.assertTrue(resp)"},{"line_number":44,"context_line":"            data \u003d resp.json()"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_4b111c53","line":41,"range":{"start_line":41,"start_character":46,"end_line":41,"end_character":49},"in_reply_to":"5f7c97a3_26a5ff47","updated":"2018-06-06 19:04:49.000000000","message":"I\u0027m meh to all that extra stuff, for the reasons stated earlier about allowing (and requiring) the caller to know and do nearly everything.\n\nThat way we\u0027re not making predictions or constraints about how things are eventually going to be used: we can let the uses evolve the chrome that surrounds the implementation.\n\nIf we _are_ trying to predict and make something generic then sure some chrome that provides a bit of automation would be groovy. It could also come later. I don\u0027t mind.","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d860c4b16c9dbdffd2562f9d17bbbc3d7be0036f","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        resource_provider._TRAITS_SYNCED \u003d False"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def test_direct_is_there(self):"},{"line_number":41,"context_line":"        with direct.PlacementDirect(CONF) as (url, session):"},{"line_number":42,"context_line":"            resp \u003d session.get(url + \u0027/\u0027)"},{"line_number":43,"context_line":"            self.assertTrue(resp)"},{"line_number":44,"context_line":"            data \u003d resp.json()"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_26a5ff47","line":41,"range":{"start_line":41,"start_character":46,"end_line":41,"end_character":49},"in_reply_to":"5f7c97a3_32d9bef3","updated":"2018-06-06 15:16:33.000000000","message":"++\n\nWe should implement \u003cverb\u003e functions in PlacementDirect for several reasons, including ^ as well as per-call microversion handling.","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d860c4b16c9dbdffd2562f9d17bbbc3d7be0036f","unresolved":false,"context_lines":[{"line_number":45,"context_line":"            self.assertEqual(\u0027v1.0\u0027, data[\u0027versions\u0027][0][\u0027id\u0027])"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def test_get_resource_providers(self):"},{"line_number":48,"context_line":"        with direct.PlacementDirect(CONF) as (url, session):"},{"line_number":49,"context_line":"            resp \u003d session.get(url + \u0027/resource_providers\u0027)"},{"line_number":50,"context_line":"            self.assertTrue(resp)"},{"line_number":51,"context_line":"            data \u003d resp.json()"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_8612d361","line":48,"range":{"start_line":48,"start_character":8,"end_line":48,"end_character":60},"updated":"2018-06-06 15:16:33.000000000","message":"No me gusta if you *have* to use this as a context manager.  I can\u0027t quite tell from the constructor, but is it also possible to use this as:\n\n pd \u003d PlacementDirect(CONF)\n resp \u003d pd.session.get(...)\n\n?\n\nIf so, cool.","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"2fb10ff53a0a09eddaa3c9819f5d94b041d457b0","unresolved":false,"context_lines":[{"line_number":45,"context_line":"            self.assertEqual(\u0027v1.0\u0027, data[\u0027versions\u0027][0][\u0027id\u0027])"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def test_get_resource_providers(self):"},{"line_number":48,"context_line":"        with direct.PlacementDirect(CONF) as (url, session):"},{"line_number":49,"context_line":"            resp \u003d session.get(url + \u0027/resource_providers\u0027)"},{"line_number":50,"context_line":"            self.assertTrue(resp)"},{"line_number":51,"context_line":"            data \u003d resp.json()"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_ee3915d8","line":48,"range":{"start_line":48,"start_character":8,"end_line":48,"end_character":60},"in_reply_to":"5f7c97a3_4bc4bc92","updated":"2018-06-06 20:21:08.000000000","message":"Okay, I think I get it.  Pursuant to my other comment (about dropping this into SchedulerReportClient), it still works.  The FFU script goes:\n\n virt_driver \u003d virt.whichever.TheDriver()\n with PlacementDirect() as adapter:\n     reportclient \u003d SchedulerReportClient(adapter\u003dadapter)\n     ptree \u003d reportclient.get_provider_tree_and_ensure_root()\n     allocs \u003d reportclient.get_allocations_for_provider_tree()\n     migrating_rps \u003d virt_driver.update_provider_tree(ptree, allocs)\n     if migrating_rps:\n         reportclient.update_from_provider_tree(ptree, allocs, migrating_rps)","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"dcfa5a88614323e0e0cad934a1ce2ca67c03d4ea","unresolved":false,"context_lines":[{"line_number":45,"context_line":"            self.assertEqual(\u0027v1.0\u0027, data[\u0027versions\u0027][0][\u0027id\u0027])"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def test_get_resource_providers(self):"},{"line_number":48,"context_line":"        with direct.PlacementDirect(CONF) as (url, session):"},{"line_number":49,"context_line":"            resp \u003d session.get(url + \u0027/resource_providers\u0027)"},{"line_number":50,"context_line":"            self.assertTrue(resp)"},{"line_number":51,"context_line":"            data \u003d resp.json()"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_4bc4bc92","line":48,"range":{"start_line":48,"start_character":8,"end_line":48,"end_character":60},"in_reply_to":"5f7c97a3_8612d361","updated":"2018-06-06 19:04:49.000000000","message":"The reason the context manager is a good thing is because of the way wsgi-intercept works: it hooks into _all_ http and https lib socket connect calls, looks at the host nane and branches to wsgi-intercept if an intercept is place for that name. We don\u0027t want to leave that lying around.\n\nIt\u0027s possible to start() and stop() the intercept manually but since we want it go out of scope as soon as possible, a context manager is the thing.\n\nAgain, this is written from the perspective that use of PlacementDirect is a special, one-off, in-left-field action (for things like FFU).\n\nOther perspectives may be more better.","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"adfbf29f5b548b6bab217b3cd862698fe577e943","unresolved":false,"context_lines":[{"line_number":45,"context_line":"            self.assertEqual(\u0027v1.0\u0027, data[\u0027versions\u0027][0][\u0027id\u0027])"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def test_get_resource_providers(self):"},{"line_number":48,"context_line":"        with direct.PlacementDirect(CONF) as (url, session):"},{"line_number":49,"context_line":"            resp \u003d session.get(url + \u0027/resource_providers\u0027)"},{"line_number":50,"context_line":"            self.assertTrue(resp)"},{"line_number":51,"context_line":"            data \u003d resp.json()"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_15ffb067","line":48,"range":{"start_line":48,"start_character":8,"end_line":48,"end_character":60},"in_reply_to":"5f7c97a3_ee3915d8","updated":"2018-06-07 13:25:56.000000000","message":"Yeah, that could work well.","commit_id":"632e3c02e063aa6ead51a5242ee058296ce67998"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3086f3c83e55d7774773f0574bcf28e6c0061379","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        self.api_db \u003d self.useFixture(fixtures.Database(database\u003d\u0027api\u0027))"},{"line_number":34,"context_line":"        self._reset_traits_synced()"},{"line_number":35,"context_line":"        self.context \u003d context.get_admin_context()"},{"line_number":36,"context_line":"        self.addCleanup(self._reset_traits_synced)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    @staticmethod"},{"line_number":39,"context_line":"    def _reset_traits_synced():"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_68cb621d","line":36,"range":{"start_line":36,"start_character":8,"end_line":36,"end_character":50},"updated":"2018-06-11 16:34:46.000000000","message":"Is this the same as if you had done:\n\n def tearDown(self):\n     self._reset_traits_synced()\n\n?\n\nOh, not quite, because as written it gets run even if the test raises an exception.\n\nIgnore me.","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"aba40802b973ead23b41356d3a8c91e484fe8eee","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        self.api_db \u003d self.useFixture(fixtures.Database(database\u003d\u0027api\u0027))"},{"line_number":34,"context_line":"        self._reset_traits_synced()"},{"line_number":35,"context_line":"        self.context \u003d context.get_admin_context()"},{"line_number":36,"context_line":"        self.addCleanup(self._reset_traits_synced)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    @staticmethod"},{"line_number":39,"context_line":"    def _reset_traits_synced():"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_aba414a4","line":36,"range":{"start_line":36,"start_character":8,"end_line":36,"end_character":50},"in_reply_to":"5f7c97a3_68cb621d","updated":"2018-06-11 16:54:04.000000000","message":"ya","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3086f3c83e55d7774773f0574bcf28e6c0061379","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    def test_create_resource_provider(self):"},{"line_number":58,"context_line":"        data \u003d {\u0027name\u0027: \u0027fake\u0027}"},{"line_number":59,"context_line":"        with direct.PlacementDirect(CONF) as client:"},{"line_number":60,"context_line":"            resp \u003d client.post(\u0027/resource_providers\u0027, data)"},{"line_number":61,"context_line":"            self.assertTrue(resp)"},{"line_number":62,"context_line":"            resp \u003d client.get(\u0027/resource_providers\u0027)"},{"line_number":63,"context_line":"            self.assertTrue(resp)"},{"line_number":64,"context_line":"            data \u003d resp.json()"},{"line_number":65,"context_line":"            self.assertEqual(1, len(data[\u0027resource_providers\u0027]))"},{"line_number":66,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_48bd4666","line":63,"range":{"start_line":60,"start_character":0,"end_line":63,"end_character":33},"updated":"2018-06-11 16:34:46.000000000","message":"This is dandy; and/or you could POST at microversion 1.20 and the provider is returned in the response.\n\n[Later] I see you have microversion-specific checks below, so not necessary to change this.","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3086f3c83e55d7774773f0574bcf28e6c0061379","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            self.assertFalse(resp)"},{"line_number":91,"context_line":"            self.assertEqual(400, resp.status_code)"},{"line_number":92,"context_line":"            resp \u003d client.post(\u0027/resource_providers\u0027, data, version\u003d\u00271.14\u0027)"},{"line_number":93,"context_line":"            self.assertTrue(resp, resp.text)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def test_report_client_method(self):"},{"line_number":96,"context_line":"        with direct.PlacementDirect(CONF) as client:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_c85e3644","line":93,"range":{"start_line":93,"start_character":17,"end_line":93,"end_character":44},"updated":"2018-06-11 16:34:46.000000000","message":"Just to be clear, by making resp.text the second argument to assertTrue, you\u0027re going to print that text if resp is False.  That makes sense - resp.text ought to contain the error message - just making sure it\u0027s what you intended.","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a3bdc3dc771012b820d092c02a07960272867c09","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            self.assertFalse(resp)"},{"line_number":91,"context_line":"            self.assertEqual(400, resp.status_code)"},{"line_number":92,"context_line":"            resp \u003d client.post(\u0027/resource_providers\u0027, data, version\u003d\u00271.14\u0027)"},{"line_number":93,"context_line":"            self.assertTrue(resp, resp.text)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def test_report_client_method(self):"},{"line_number":96,"context_line":"        with direct.PlacementDirect(CONF) as client:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_9ceba0db","line":93,"range":{"start_line":93,"start_character":17,"end_line":93,"end_character":44},"in_reply_to":"5f7c97a3_0bad0883","updated":"2018-06-11 19:09:12.000000000","message":"++","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"aba40802b973ead23b41356d3a8c91e484fe8eee","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            self.assertFalse(resp)"},{"line_number":91,"context_line":"            self.assertEqual(400, resp.status_code)"},{"line_number":92,"context_line":"            resp \u003d client.post(\u0027/resource_providers\u0027, data, version\u003d\u00271.14\u0027)"},{"line_number":93,"context_line":"            self.assertTrue(resp, resp.text)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def test_report_client_method(self):"},{"line_number":96,"context_line":"        with direct.PlacementDirect(CONF) as client:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_0bad0883","line":93,"range":{"start_line":93,"start_character":17,"end_line":93,"end_character":44},"in_reply_to":"5f7c97a3_c85e3644","updated":"2018-06-11 16:54:04.000000000","message":"Yeah, it makes a test failure actually useful.","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3086f3c83e55d7774773f0574bcf28e6c0061379","unresolved":false,"context_lines":[{"line_number":103,"context_line":""},{"line_number":104,"context_line":"            rp_url \u003d \u0027/resource_providers/%s\u0027 % rp_uuid"},{"line_number":105,"context_line":"            resp \u003d client.get(rp_url, version\u003d\u00271.14\u0027)"},{"line_number":106,"context_line":"            self.assertTrue(resp, resp.text)"},{"line_number":107,"context_line":"            self.assertEqual(\u0027rp1\u0027, resp.json()[\u0027name\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_0ba0a8f2","line":106,"range":{"start_line":106,"start_character":28,"end_line":106,"end_character":43},"updated":"2018-06-11 16:34:46.000000000","message":"ditto","commit_id":"3b47d23c959491533996bea0b63bfa5c18e67c04"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d5b9a75d8681a5ac1daac1c4d31e8de6e803a224","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def setUp(self):"},{"line_number":31,"context_line":"        super(TestDirect, self).setUp()"},{"line_number":32,"context_line":"        self.useFixture(fixtures.Database())"},{"line_number":33,"context_line":"        self.api_db \u003d self.useFixture(fixtures.Database(database\u003d\u0027api\u0027))"},{"line_number":34,"context_line":"        self._reset_traits_synced()"},{"line_number":35,"context_line":"        self.context \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_c1091a31","line":32,"range":{"start_line":32,"start_character":33,"end_line":32,"end_character":41},"updated":"2018-06-12 15:03:58.000000000","message":"This one configures the \u0027main\u0027 database?  Why do we need that?\n\n[Later] I removed it and the suite still passes.  Maybe it was needed when PlacementDirect produced a NoAuthReportClient?","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5b656230f28d93850c8b123ce5a9f56f267f2168","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def setUp(self):"},{"line_number":31,"context_line":"        super(TestDirect, self).setUp()"},{"line_number":32,"context_line":"        self.useFixture(fixtures.Database())"},{"line_number":33,"context_line":"        self.api_db \u003d self.useFixture(fixtures.Database(database\u003d\u0027api\u0027))"},{"line_number":34,"context_line":"        self._reset_traits_synced()"},{"line_number":35,"context_line":"        self.context \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_02f3900a","line":32,"range":{"start_line":32,"start_character":33,"end_line":32,"end_character":41},"in_reply_to":"5f7c97a3_5c4c11c7","updated":"2018-06-12 16:01:28.000000000","message":"I\u0027ll try it and see if CI blows its lid.","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"a68a143fd4d02366f789f6236c99b401f849d5a3","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def setUp(self):"},{"line_number":31,"context_line":"        super(TestDirect, self).setUp()"},{"line_number":32,"context_line":"        self.useFixture(fixtures.Database())"},{"line_number":33,"context_line":"        self.api_db \u003d self.useFixture(fixtures.Database(database\u003d\u0027api\u0027))"},{"line_number":34,"context_line":"        self._reset_traits_synced()"},{"line_number":35,"context_line":"        self.context \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_5c4c11c7","line":32,"range":{"start_line":32,"start_character":33,"end_line":32,"end_character":41},"in_reply_to":"5f7c97a3_c1091a31","updated":"2018-06-12 15:14:58.000000000","message":"It _may_ be cargo. I seem to recall a long time ago that in the gabbi fixture, managing more database was necessary because of tests that came after the gabbi suites stopped running (I never did figure out why), so perhaps try the suite in context of other tests just to be sure (or let CI do it).","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d5b9a75d8681a5ac1daac1c4d31e8de6e803a224","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    def test_direct_is_there(self):"},{"line_number":44,"context_line":"        with direct.PlacementDirect(CONF) as client:"},{"line_number":45,"context_line":"            resp \u003d client.get(\u0027/\u0027)"},{"line_number":46,"context_line":"            self.assertTrue(resp)"},{"line_number":47,"context_line":"            data \u003d resp.json()"},{"line_number":48,"context_line":"            self.assertEqual(\u0027v1.0\u0027, data[\u0027versions\u0027][0][\u0027id\u0027])"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_3ced9524","line":46,"range":{"start_line":46,"start_character":12,"end_line":46,"end_character":33},"updated":"2018-06-12 15:03:58.000000000","message":"nit: this isn\u0027t needed; since we didn\u0027t specify raise_exc\u003dFalse to .get above, it\u0027ll raise on failure.\n\n(This made sense before when we were using a NoAuthReportClient, which does set raise_exc\u003dFalse.)\n\nMore cases of this throughout.","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"a68a143fd4d02366f789f6236c99b401f849d5a3","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    def test_direct_is_there(self):"},{"line_number":44,"context_line":"        with direct.PlacementDirect(CONF) as client:"},{"line_number":45,"context_line":"            resp \u003d client.get(\u0027/\u0027)"},{"line_number":46,"context_line":"            self.assertTrue(resp)"},{"line_number":47,"context_line":"            data \u003d resp.json()"},{"line_number":48,"context_line":"            self.assertEqual(\u0027v1.0\u0027, data[\u0027versions\u0027][0][\u0027id\u0027])"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_fce95d7e","line":46,"range":{"start_line":46,"start_character":12,"end_line":46,"end_character":33},"in_reply_to":"5f7c97a3_3ced9524","updated":"2018-06-12 15:14:58.000000000","message":"blargh, maybe set raise_exc\u003dFalse before we get client in the context manager because exceptions for 4xx is _so_ wrong...","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5b656230f28d93850c8b123ce5a9f56f267f2168","unresolved":false,"context_lines":[{"line_number":43,"context_line":"    def test_direct_is_there(self):"},{"line_number":44,"context_line":"        with direct.PlacementDirect(CONF) as client:"},{"line_number":45,"context_line":"            resp \u003d client.get(\u0027/\u0027)"},{"line_number":46,"context_line":"            self.assertTrue(resp)"},{"line_number":47,"context_line":"            data \u003d resp.json()"},{"line_number":48,"context_line":"            self.assertEqual(\u0027v1.0\u0027, data[\u0027versions\u0027][0][\u0027id\u0027])"},{"line_number":49,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_e2c8d4a8","line":46,"range":{"start_line":46,"start_character":12,"end_line":46,"end_character":33},"in_reply_to":"5f7c97a3_fce95d7e","updated":"2018-06-12 16:01:28.000000000","message":"Well, THIS went off on a ride, didn\u0027t it?\n\nI\u0027m adding TODOs to set the default once https://review.openstack.org/#/c/574784/ is released.","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d81b496bd6f5aad4cf89ecc132724c6efb865108","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    def test_json_validation_happens(self):"},{"line_number":67,"context_line":"        data \u003d {\u0027name\u0027: \u0027fake\u0027, \u0027cowsay\u0027: \u0027moo\u0027}"},{"line_number":68,"context_line":"        with direct.PlacementDirect(CONF) as client:"},{"line_number":69,"context_line":"            # TODO(efried): Set raise_exc globally when"},{"line_number":70,"context_line":"            # https://review.openstack.org/#/c/574784/ is released."},{"line_number":71,"context_line":"            resp \u003d client.post(\u0027/resource_providers\u0027, json\u003ddata,"},{"line_number":72,"context_line":"                               raise_exc\u003dFalse)"},{"line_number":73,"context_line":"            self.assertFalse(resp)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_37c80ba7","line":70,"range":{"start_line":69,"start_character":12,"end_line":70,"end_character":67},"updated":"2018-06-15 02:36:23.000000000","message":"I don\u0027t think we really need the TODOs everywhere for this since we could just go and burn through all of these in nova when the ksa release is out.","commit_id":"43cc59abe2ac087f3447ef1a294041684545d1e4"}],"nova/tests/functional/test_report_client.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d5b9a75d8681a5ac1daac1c4d31e8de6e803a224","unresolved":false,"context_lines":[{"line_number":56,"context_line":"                self._set_client(client)"},{"line_number":57,"context_line":"                return client"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        return ReportClientInterceptor(CONF, app\u003dapp,"},{"line_number":60,"context_line":"                                       latest_microversion\u003dTrue)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def _set_client(self, client):"},{"line_number":63,"context_line":"        \"\"\"Set report client attributes on the TestCase instance."}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_9cf949c9","line":60,"range":{"start_line":59,"start_character":8,"end_line":60,"end_character":64},"updated":"2018-06-12 15:03:58.000000000","message":"Yeah, we can do that goofy app substitution here instead of PlacementDirect.","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5b656230f28d93850c8b123ce5a9f56f267f2168","unresolved":false,"context_lines":[{"line_number":56,"context_line":"                self._set_client(client)"},{"line_number":57,"context_line":"                return client"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        return ReportClientInterceptor(CONF, app\u003dapp,"},{"line_number":60,"context_line":"                                       latest_microversion\u003dTrue)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def _set_client(self, client):"},{"line_number":63,"context_line":"        \"\"\"Set report client attributes on the TestCase instance."}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_1c9699f1","line":60,"range":{"start_line":59,"start_character":8,"end_line":60,"end_character":64},"in_reply_to":"5f7c97a3_9cf949c9","updated":"2018-06-12 16:01:28.000000000","message":"Done","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d5b9a75d8681a5ac1daac1c4d31e8de6e803a224","unresolved":false,"context_lines":[{"line_number":714,"context_line":"        # Do these with a failing interceptor to prove no API calls are made."},{"line_number":715,"context_line":"        def fail_app(environ, start_response):"},{"line_number":716,"context_line":"            self.fail()"},{"line_number":717,"context_line":"        with self._interceptor(app\u003dlambda: fail_app) as client:"},{"line_number":718,"context_line":"            # To begin with, the cache should be empty"},{"line_number":719,"context_line":"            self.assertEqual([], client._provider_tree.get_provider_uuids())"},{"line_number":720,"context_line":"            # When new_tree is empty, it\u0027s a no-op."}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_bce20500","line":717,"range":{"start_line":717,"start_character":31,"end_line":717,"end_character":51},"updated":"2018-06-12 15:03:58.000000000","message":"This is overkill; app\u003d\u0027nuke\u0027 works just as well.","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"5b656230f28d93850c8b123ce5a9f56f267f2168","unresolved":false,"context_lines":[{"line_number":714,"context_line":"        # Do these with a failing interceptor to prove no API calls are made."},{"line_number":715,"context_line":"        def fail_app(environ, start_response):"},{"line_number":716,"context_line":"            self.fail()"},{"line_number":717,"context_line":"        with self._interceptor(app\u003dlambda: fail_app) as client:"},{"line_number":718,"context_line":"            # To begin with, the cache should be empty"},{"line_number":719,"context_line":"            self.assertEqual([], client._provider_tree.get_provider_uuids())"},{"line_number":720,"context_line":"            # When new_tree is empty, it\u0027s a no-op."}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_dc9b4114","line":717,"range":{"start_line":717,"start_character":31,"end_line":717,"end_character":51},"in_reply_to":"5f7c97a3_bce20500","updated":"2018-06-12 16:01:28.000000000","message":"Done","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"a68a143fd4d02366f789f6236c99b401f849d5a3","unresolved":false,"context_lines":[{"line_number":714,"context_line":"        # Do these with a failing interceptor to prove no API calls are made."},{"line_number":715,"context_line":"        def fail_app(environ, start_response):"},{"line_number":716,"context_line":"            self.fail()"},{"line_number":717,"context_line":"        with self._interceptor(app\u003dlambda: fail_app) as client:"},{"line_number":718,"context_line":"            # To begin with, the cache should be empty"},{"line_number":719,"context_line":"            self.assertEqual([], client._provider_tree.get_provider_uuids())"},{"line_number":720,"context_line":"            # When new_tree is empty, it\u0027s a no-op."}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_bc8445b2","line":717,"range":{"start_line":717,"start_character":31,"end_line":717,"end_character":51},"in_reply_to":"5f7c97a3_bce20500","updated":"2018-06-12 15:14:58.000000000","message":"You\u0027re failing at the wrong point then: with fail_app (in a lambda) the failure happens _in_ the app when making a request of it\n\nwith app\u003d\u0027nuke\u0027 you\u0027re failing trying to _create_ the app","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"27b8f31041bb537e710ab2de14735eeb7b9b4354","unresolved":false,"context_lines":[{"line_number":714,"context_line":"        # Do these with a failing interceptor to prove no API calls are made."},{"line_number":715,"context_line":"        def fail_app(environ, start_response):"},{"line_number":716,"context_line":"            self.fail()"},{"line_number":717,"context_line":"        with self._interceptor(app\u003dlambda: fail_app) as client:"},{"line_number":718,"context_line":"            # To begin with, the cache should be empty"},{"line_number":719,"context_line":"            self.assertEqual([], client._provider_tree.get_provider_uuids())"},{"line_number":720,"context_line":"            # When new_tree is empty, it\u0027s a no-op."}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_e280d4f9","line":717,"range":{"start_line":717,"start_character":31,"end_line":717,"end_character":51},"in_reply_to":"5f7c97a3_dc9b4114","updated":"2018-06-12 16:04:13.000000000","message":"As you say, the fact that the test doesn\u0027t blow up means we didn\u0027t even try to create the app, let alone invoke it.  But app\u003dlambda: \u0027nuke\u0027 would be closer to what we\u0027re trying to express, yah?","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"0d19bb1280ef47a97f33d9eee3f647a90ddc15c7","unresolved":false,"context_lines":[{"line_number":714,"context_line":"        # Do these with a failing interceptor to prove no API calls are made."},{"line_number":715,"context_line":"        def fail_app(environ, start_response):"},{"line_number":716,"context_line":"            self.fail()"},{"line_number":717,"context_line":"        with self._interceptor(app\u003dlambda: fail_app) as client:"},{"line_number":718,"context_line":"            # To begin with, the cache should be empty"},{"line_number":719,"context_line":"            self.assertEqual([], client._provider_tree.get_provider_uuids())"},{"line_number":720,"context_line":"            # When new_tree is empty, it\u0027s a no-op."}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_f9a16af8","line":717,"range":{"start_line":717,"start_character":31,"end_line":717,"end_character":51},"in_reply_to":"5f7c97a3_e280d4f9","updated":"2018-06-12 17:06:32.000000000","message":"It\u0027s not clear what the test really wants to mean. The comment says \"prove no API calls are made\" but if you \u0027nuke\u0027 no API calls _can_ be made: the intercept will crash out trying to start the intercept.","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ea50bc8ef5e9df2e48b05794c9fade7acc748359","unresolved":false,"context_lines":[{"line_number":714,"context_line":"        # Do these with a failing interceptor to prove no API calls are made."},{"line_number":715,"context_line":"        def fail_app(environ, start_response):"},{"line_number":716,"context_line":"            self.fail()"},{"line_number":717,"context_line":"        with self._interceptor(app\u003dlambda: fail_app) as client:"},{"line_number":718,"context_line":"            # To begin with, the cache should be empty"},{"line_number":719,"context_line":"            self.assertEqual([], client._provider_tree.get_provider_uuids())"},{"line_number":720,"context_line":"            # When new_tree is empty, it\u0027s a no-op."}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_eaf426d1","line":717,"range":{"start_line":717,"start_character":31,"end_line":717,"end_character":51},"in_reply_to":"5f7c97a3_f9a16af8","updated":"2018-06-12 19:24:31.000000000","message":"I want to prove no API calls are made by the stuff inside the context.  If I make an app that blows up if calls are made, that does the trick, because the test doesn\u0027t blow up, ergo no calls were made.  If I make an app that blows up on instantiation, it doesn\u0027t prove that an API call was attempted (even though if it doesn\u0027t blow up, it proves that *no* API calls were (could have been) attempted).","commit_id":"a0683ee4a45f8700be84d903f890b9ea55db9721"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d81b496bd6f5aad4cf89ecc132724c6efb865108","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        self.client \u003d NoAuthReportClient()"},{"line_number":77,"context_line":"        # TODO(cdent): Port required here to deal with a bug"},{"line_number":78,"context_line":"        # in wsgi-intercept:"},{"line_number":79,"context_line":"        # https://github.com/cdent/wsgi-intercept/issues/41"},{"line_number":80,"context_line":"        self.url \u003d \u0027http://localhost:80/placement\u0027"},{"line_number":81,"context_line":"        self.compute_uuid \u003d uuids.compute_node"},{"line_number":82,"context_line":"        self.compute_name \u003d \u0027computehost\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_b7fe5bad","side":"PARENT","line":79,"range":{"start_line":79,"start_character":10,"end_line":79,"end_character":59},"updated":"2018-06-15 02:36:23.000000000","message":"This was fixed in 1.3.2:\n\nhttps://github.com/cdent/wsgi-intercept/commit/f1a3c4a69ebbbc89aadc3f7f8f8dc2c79f31fb1f\n\nAnd we require at least 1.4.1:\n\nhttps://github.com/openstack/requirements/blob/master/lower-constraints.txt#L443\n\nSo we\u0027re good.","commit_id":"5ef23af397820ac2031731e0a370fdb1236d9563"}]}
