)]}'
{"nova/scheduler/filters/trusted_filter.py":[{"author":{"_account_id":67,"name":"Vish Ishaya","email":"vishvananda@gmail.com","username":"vishvananda"},"change_message_id":"b3752b21d18ae65c1f0ffdf5f1255e40677b8948","unresolved":false,"context_lines":[{"line_number":187,"context_line":"        raise NotImplementedError()"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"class ComputaeAttestationCached(AttestationService):"},{"line_number":191,"context_line":"    \"\"\"Attestate compute node based on cache."},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"    Cache compute node\u0027s trust level for sometime,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2Fc0s%3D","line":190,"updated":"2012-09-10 18:02:47.000000000","message":"Typo? Computae","commit_id":"2296bdafe5001ef2312762e0ccfa3932a0e2f161"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"73796dfe6183a159fa5dc8774c18521ffd6691c1","unresolved":false,"context_lines":[{"line_number":187,"context_line":"        raise NotImplementedError()"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"class ComputaeAttestationCached(AttestationService):"},{"line_number":191,"context_line":"    \"\"\"Attestate compute node based on cache."},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"    Cache compute node\u0027s trust level for sometime,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2Fce8%3D","line":190,"in_reply_to":"AAAALH%2F%2Fc0s%3D","updated":"2012-09-11 02:56:07.000000000","message":"Thanks for pointing this out. Can\u0027t imagine how it passed my several review :$","commit_id":"2296bdafe5001ef2312762e0ccfa3932a0e2f161"},{"author":{"_account_id":67,"name":"Vish Ishaya","email":"vishvananda@gmail.com","username":"vishvananda"},"change_message_id":"b3752b21d18ae65c1f0ffdf5f1255e40677b8948","unresolved":false,"context_lines":[{"line_number":222,"context_line":""},{"line_number":223,"context_line":"        for compute in self.compute_nodes.keys():"},{"line_number":224,"context_line":"            if compute not in hosts:"},{"line_number":225,"context_line":"                del self.compute_nodes[compute]"},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"    def _cache_valid(self, host):"},{"line_number":228,"context_line":"        cachevalid \u003d False"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2Fc0g%3D","line":225,"updated":"2012-09-10 18:02:47.000000000","message":"the db entry for compute hosts is almost never deleted so I\u0027m not sure this whole piece is necessary. If you get rid of this part you can stop passing the cache around and you don\u0027t need the db att all. You can just flush by iterating through self.compute_nodes.\n\nThere should be no way for a host to get passed in to is_trusted here that no longer exists in the db anyway so I don\u0027t think you need this at all.","commit_id":"2296bdafe5001ef2312762e0ccfa3932a0e2f161"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"73796dfe6183a159fa5dc8774c18521ffd6691c1","unresolved":false,"context_lines":[{"line_number":222,"context_line":""},{"line_number":223,"context_line":"        for compute in self.compute_nodes.keys():"},{"line_number":224,"context_line":"            if compute not in hosts:"},{"line_number":225,"context_line":"                del self.compute_nodes[compute]"},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"    def _cache_valid(self, host):"},{"line_number":228,"context_line":"        cachevalid \u003d False"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2Fcaw%3D","line":225,"in_reply_to":"AAAALH%2F%2Fc0g%3D","updated":"2012-09-11 02:56:07.000000000","message":"There are two methods to setup the cache for the host list (i.e. compute_nodes). One is, each time the trusted_filter is invoked, we will cache the host name in the compute_node, another method is to sync with db.\n\nThere reasons to use db is to reduce polling to OAT service as much as possible. The reason is, each OAT service polling may take from several hundred ms to more than 10 seconds, depends on OAT service strategy and configuration.\n\na) If we cache the host list when trusted_filter is invoked, then in the first round invoke,trusted filter need consult OAT for each host. That may take a very long time to finish this first round scheduler. However, if we get the host list from db, we need polling OAT service only once. \n\nb) after very long-time running, possibly a lot of compute nodes has been removed from the cloud, and we want to purge the host list cache soon.\n\nc) If a new compute is added during a round scheduler, we don\u0027t need to polling to OAT service for this host, instead, it can be merged with other polling.\n\nOne potential concern to the db sync method is too many access to db and impact overall performance. But I think that will not happen, because we will access database only once during each round scheduler, i.e. each instance launch, others will hit the cache.\n\nAs you stated that \"db entry for compute hosts is almost never deleted\", so do you know any other db entry that will show compute hosts status better?\n\nThanks\n--jyh","commit_id":"2296bdafe5001ef2312762e0ccfa3932a0e2f161"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"faa036880fd288515942832a43c541efb1506f35","unresolved":false,"context_lines":[{"line_number":237,"context_line":"        self.compute_nodes[host] \u003d {"},{"line_number":238,"context_line":"            \u0027trust_lvl\u0027: \u0027unknown\u0027,"},{"line_number":239,"context_line":"            \u0027vtime\u0027: timeutils.normalize_time("},{"line_number":240,"context_line":"                        timeutils.parse_isotime(\"1970-01-01T04:00:00\"))}"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    def _invalidate_caches(self):"},{"line_number":243,"context_line":"        for host in self.compute_nodes:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAMH%2F%2F1vs%3D","line":240,"updated":"2012-11-20 17:01:20.000000000","message":"this seems like a very round about way to get here, what about doing timeutils.parse_isotime(\"1970-01-01T00:00:00Z\")) (which I think is your goal.\n\nOr better yet, just create a time out of 0 epoch directly. As I expect that vtime value is going to jump around based on TZ in a very funny way (it\u0027s suspiciously EST 0)","commit_id":"1a82b372bb4e5672b1b0e75ec76efa2b70492c68"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"b06b956d1199b67c4bbc8c5001294b47fc256d4f","unresolved":false,"context_lines":[{"line_number":237,"context_line":"        self.compute_nodes[host] \u003d {"},{"line_number":238,"context_line":"            \u0027trust_lvl\u0027: \u0027unknown\u0027,"},{"line_number":239,"context_line":"            \u0027vtime\u0027: timeutils.normalize_time("},{"line_number":240,"context_line":"                        timeutils.parse_isotime(\"1970-01-01T04:00:00\"))}"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"    def _invalidate_caches(self):"},{"line_number":243,"context_line":"        for host in self.compute_nodes:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAMH%2F%2FzNQ%3D","line":240,"in_reply_to":"AAAAMH%2F%2F1vs%3D","updated":"2012-11-22 09:11:27.000000000","message":"The 04:00:00 is a leftover because originally the timeutils.normalize_time() has a bug, that I have to use  T04:00:00+04:00 before. After that fix is check-in oslo (https://bugs.launchpad.net/oslo/+bug/1048636 ), I remove the \"+04:00\", but didn\u0027t change it back to epoch 0.\n\nThe normlize_time() will always return TZ time, that\u0027s the reason all time is normalized in the code, so \"vtime value is going to jump around based on TZ\" will not happen.","commit_id":"1a82b372bb4e5672b1b0e75ec76efa2b70492c68"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"256cdb8facd22fa27910348f2454e12c35d8be61","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                                    cert_reqs\u003dssl.CERT_REQUIRED)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"class AttestationService(object):"},{"line_number":129,"context_line":"    # Provide access wrapper to attestation server to get integrity report."},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def __init__(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2FuQo%3D","line":128,"updated":"2012-11-28 18:03:58.000000000","message":"Curious; do you have any idea why this class originally derived from httplib.HTTPSConnection?","commit_id":"8cb7f719ff4d5942c92ecc7d2809094d602f1102"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"256cdb8facd22fa27910348f2454e12c35d8be61","unresolved":false,"context_lines":[{"line_number":180,"context_line":"            return status, None"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"    def do_attestation(self, hosts):"},{"line_number":183,"context_line":"        \"\"\" Attestate compute nodes through OAT service."},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        : param hosts: hosts list to be attestated"},{"line_number":186,"context_line":"        : returns: dictonary for trust level and validate time"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2FuQ8%3D","line":183,"updated":"2012-11-28 18:03:58.000000000","message":"Eliminate the space after the triple-quote here or place the description on the next line.  Also, \"attestate\" isn\u0027t a word I know, so the description probably needs a little rephrasing.\n\n(femtonit)","commit_id":"8cb7f719ff4d5942c92ecc7d2809094d602f1102"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"256cdb8facd22fa27910348f2454e12c35d8be61","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        \"\"\" Attestate compute nodes through OAT service."},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        : param hosts: hosts list to be attestated"},{"line_number":186,"context_line":"        : returns: dictonary for trust level and validate time"},{"line_number":187,"context_line":"        \"\"\""},{"line_number":188,"context_line":"        result \u003d None"},{"line_number":189,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2FuQw%3D","line":186,"updated":"2012-11-28 18:03:58.000000000","message":"Correct formatting is \":param hosts:\" and \":returns:\"; eliminate the space after the opening \":\".  Also, again \"attestated\" I don\u0027t know, and you have \"dictionary\" misspelled as \"dictonary\".\n\n(femtonit)","commit_id":"8cb7f719ff4d5942c92ecc7d2809094d602f1102"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"256cdb8facd22fa27910348f2454e12c35d8be61","unresolved":false,"context_lines":[{"line_number":195,"context_line":""},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"class ComputeAttestationCache(object):"},{"line_number":198,"context_line":"    \"\"\" Cache for compute node attestation"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"    Cache compute node\u0027s trust level for sometime,"},{"line_number":201,"context_line":"    if the cache is out of date, poll OAT service to flush the"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2FuQg%3D","line":198,"updated":"2012-11-28 18:03:58.000000000","message":"Again, eliminate the space after the triple-quote…\n\n(femtonit)","commit_id":"8cb7f719ff4d5942c92ecc7d2809094d602f1102"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"256cdb8facd22fa27910348f2454e12c35d8be61","unresolved":false,"context_lines":[{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    OAT service may have cache also. OAT service\u0027s cache valid time"},{"line_number":205,"context_line":"    should be set shorter than trusted filter\u0027s cache valid time."},{"line_number":206,"context_line":"    \"\"\""},{"line_number":207,"context_line":"    def __init__(self):"},{"line_number":208,"context_line":"        self.attestservice \u003d AttestationService()"},{"line_number":209,"context_line":"        self.compute_nodes \u003d {}"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2FuQY%3D","line":206,"updated":"2012-11-28 18:03:58.000000000","message":"According to HACKING.rst, there should be a blank line after this triple-quote.","commit_id":"8cb7f719ff4d5942c92ecc7d2809094d602f1102"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"256cdb8facd22fa27910348f2454e12c35d8be61","unresolved":false,"context_lines":[{"line_number":289,"context_line":"    \"\"\"Trusted filter to support Trusted Compute Pools.\"\"\""},{"line_number":290,"context_line":""},{"line_number":291,"context_line":"    def __init__(self):"},{"line_number":292,"context_line":"        self.ComputeAttestation \u003d ComputeAttestation()"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"    def host_passes(self, host_state, filter_properties):"},{"line_number":295,"context_line":"        instance \u003d filter_properties.get(\u0027instance_type\u0027, {})"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2FuQI%3D","line":292,"updated":"2012-11-28 18:03:58.000000000","message":"Please use snake_case for instance variables rather than CamelCase.","commit_id":"8cb7f719ff4d5942c92ecc7d2809094d602f1102"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"daa560a6df63b11e66a374aac2d4309f509d4357","unresolved":false,"context_lines":[{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    OAT service may have cache also. OAT service\u0027s cache valid time"},{"line_number":205,"context_line":"    should be set shorter than trusted filter\u0027s cache valid time."},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"    \"\"\""},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    def __init__(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAMX%2F%2F7Z0%3D","line":206,"updated":"2012-12-06 16:19:41.000000000","message":"Nit: this blank line should be eliminated…","commit_id":"9cdb0af47277c326434353768a000d63c40a0d7e"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"e52d4cd466a3a28cdcae78e40b9fd595266f7322","unresolved":false,"context_lines":[{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    OAT service may have cache also. OAT service\u0027s cache valid time"},{"line_number":205,"context_line":"    should be set shorter than trusted filter\u0027s cache valid time."},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"    \"\"\""},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    def __init__(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2F%2Fsc%3D","line":206,"in_reply_to":"AAAAMX%2F%2F7Z0%3D","updated":"2012-12-17 09:25:48.000000000","message":"Done","commit_id":"9cdb0af47277c326434353768a000d63c40a0d7e"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"eef8be21ba1060b6c925700693935023c06368a8","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        \"\"\"Attests compute nodes through OAT service."},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        :param hosts: hosts list to be attested"},{"line_number":186,"context_line":"        :returns: dictonary for trust level and validate time"},{"line_number":187,"context_line":"        \"\"\""},{"line_number":188,"context_line":"        result \u003d None"},{"line_number":189,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAM3%2F%2Fy2o%3D","line":186,"updated":"2013-01-04 20:45:47.000000000","message":"\"dictionary\" (femtonit)","commit_id":"afabf91659e5f750a15845e3252f1b1db0f8c277"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"d44928567872019d67de0a1efdbd1c29fce225e2","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        \"\"\"Attests compute nodes through OAT service."},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        :param hosts: hosts list to be attested"},{"line_number":186,"context_line":"        :returns: dictonary for trust level and validate time"},{"line_number":187,"context_line":"        \"\"\""},{"line_number":188,"context_line":"        result \u003d None"},{"line_number":189,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAM3%2F%2FyF0%3D","line":186,"in_reply_to":"AAAAM3%2F%2Fy2o%3D","updated":"2013-01-05 07:38:13.000000000","message":"Oops. Thanks for pointing this out.","commit_id":"afabf91659e5f750a15845e3252f1b1db0f8c277"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"eef8be21ba1060b6c925700693935023c06368a8","unresolved":false,"context_lines":[{"line_number":277,"context_line":"        return level"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"class ComputeAttestation(object):"},{"line_number":281,"context_line":"    def __init__(self):"},{"line_number":282,"context_line":"        self.caches \u003d ComputeAttestationCache()"},{"line_number":283,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAM3%2F%2Fy2U%3D","line":280,"updated":"2013-01-04 20:45:47.000000000","message":"To be honest, this seems like just a hair too much abstraction.  It seems to me that you can implement all the caching behavior within the ComputeAttestation class, without needing the ComputeAttestationCache class…","commit_id":"afabf91659e5f750a15845e3252f1b1db0f8c277"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"d44928567872019d67de0a1efdbd1c29fce225e2","unresolved":false,"context_lines":[{"line_number":277,"context_line":"        return level"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"class ComputeAttestation(object):"},{"line_number":281,"context_line":"    def __init__(self):"},{"line_number":282,"context_line":"        self.caches \u003d ComputeAttestationCache()"},{"line_number":283,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAM3%2F%2FyF8%3D","line":280,"in_reply_to":"AAAAM3%2F%2Fy2U%3D","updated":"2013-01-05 07:38:13.000000000","message":"The ComputeAttestationCache \u0027s purpose is, possibly we will have multiple type cache model support in future.\n\n--jyh","commit_id":"afabf91659e5f750a15845e3252f1b1db0f8c277"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"79c0eba31a762618da5d2b2613515db1314b96dd","unresolved":false,"context_lines":[{"line_number":277,"context_line":"        return level"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"class ComputeAttestation(object):"},{"line_number":281,"context_line":"    def __init__(self):"},{"line_number":282,"context_line":"        self.caches \u003d ComputeAttestationCache()"},{"line_number":283,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAM3%2F%2FwLY%3D","line":280,"in_reply_to":"AAAAM3%2F%2FyF8%3D","updated":"2013-01-07 16:52:36.000000000","message":"Well, we can put it back in the future :)  (I won\u0027t hold this up for this change, though…)","commit_id":"afabf91659e5f750a15845e3252f1b1db0f8c277"}],"nova/tests/scheduler/test_host_filters.py":[{"author":{"_account_id":67,"name":"Vish Ishaya","email":"vishvananda@gmail.com","username":"vishvananda"},"change_message_id":"b3752b21d18ae65c1f0ffdf5f1255e40677b8948","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"DATA \u003d \u0027\u0027"},{"line_number":36,"context_line":"Attestated \u003d False"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def stub_out_https_backend(stubs):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2Fc00%3D","line":36,"updated":"2012-09-10 18:02:47.000000000","message":"This should be all caps. Also mb ATTESTED ?","commit_id":"2296bdafe5001ef2312762e0ccfa3932a0e2f161"},{"author":{"_account_id":1849,"name":"Joe Gordon","email":"joe.gordon0@gmail.com","username":"jogo"},"change_message_id":"f533e19ea97f25e32bc0e77e5c521e69664a3f41","unresolved":false,"context_lines":[{"line_number":1276,"context_line":""},{"line_number":1277,"context_line":"        Attestated \u003d False"},{"line_number":1278,"context_line":"        timeutils.advance_time_seconds("},{"line_number":1279,"context_line":"            flags.FLAGS.trusted_computing.attestation_auth_timeout + 10)"},{"line_number":1280,"context_line":"        filt_cls.host_passes(host, filter_properties)"},{"line_number":1281,"context_line":"        self.assertTrue(Attestated)"},{"line_number":1282,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAMH%2F%2F9os%3D","line":1279,"updated":"2012-11-14 00:39:51.000000000","message":"dont we use CONF now?\n\nCONF.trusted_computing.attestation_auth_timeout","commit_id":"9872c55cda681880159433c449ca157f71e02dcf"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"256cdb8facd22fa27910348f2454e12c35d8be61","unresolved":false,"context_lines":[{"line_number":34,"context_line":"CONF \u003d cfg.CONF"},{"line_number":35,"context_line":"CONF.import_opt(\u0027my_ip\u0027, \u0027nova.config\u0027)"},{"line_number":36,"context_line":"DATA \u003d \u0027\u0027"},{"line_number":37,"context_line":"Attestated \u003d False"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"def stub_out_https_backend(stubs):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2FuQA%3D","line":37,"updated":"2012-11-28 18:03:58.000000000","message":"Please use snake_case for variables, rather than CamelCase.  Also, is there any way to eliminate this as a global variable?  There is no guarantee of the order in which the tests are run, to my knowledge.","commit_id":"8cb7f719ff4d5942c92ecc7d2809094d602f1102"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"256cdb8facd22fa27910348f2454e12c35d8be61","unresolved":false,"context_lines":[{"line_number":1175,"context_line":"    def test_trusted_filter_trusted_and_trusted_passes(self):"},{"line_number":1176,"context_line":"        global DATA"},{"line_number":1177,"context_line":""},{"line_number":1178,"context_line":"        DATA \u003d \u0027{\"hosts\":[{\"host_name\":\"host1\",\"trust_lvl\":\"trusted\",\\"},{"line_number":1179,"context_line":"                           \"vtime\":\"2012-09-09T09:10:40Z\"}]}\u0027"},{"line_number":1180,"context_line":"        self._stub_service_is_up(True)"},{"line_number":1181,"context_line":"        filt_cls \u003d self.class_map[\u0027TrustedFilter\u0027]()"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2FuP8%3D","line":1178,"updated":"2012-11-28 18:03:58.000000000","message":"This backslash is unnecessary, and should be eliminated.","commit_id":"8cb7f719ff4d5942c92ecc7d2809094d602f1102"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"6ac09b193fe76ea4298801ca66168ecf695c7e58","unresolved":false,"context_lines":[{"line_number":1176,"context_line":"        global DATA"},{"line_number":1177,"context_line":""},{"line_number":1178,"context_line":"        DATA \u003d \u0027{\"hosts\":[{\"host_name\":\"host1\",\"trust_lvl\":\"trusted\",\\"},{"line_number":1179,"context_line":"                           \"vtime\":\"2012-09-09T09:10:40Z\"}]}\u0027"},{"line_number":1180,"context_line":"        self._stub_service_is_up(True)"},{"line_number":1181,"context_line":"        filt_cls \u003d self.class_map[\u0027TrustedFilter\u0027]()"},{"line_number":1182,"context_line":"        extra_specs \u003d {\u0027trust:trusted_host\u0027: \u0027trusted\u0027}"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2FsHQ%3D","line":1179,"updated":"2012-11-30 12:13:42.000000000","message":"Instead of picking some random time in the past, can we have the tests actually set this to *now*, then the tests don\u0027t have to keep tricking the clock.","commit_id":"8cb7f719ff4d5942c92ecc7d2809094d602f1102"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"256cdb8facd22fa27910348f2454e12c35d8be61","unresolved":false,"context_lines":[{"line_number":1195,"context_line":"    def test_trusted_filter_trusted_and_untrusted_fails(self):"},{"line_number":1196,"context_line":"        global DATA"},{"line_number":1197,"context_line":""},{"line_number":1198,"context_line":"        DATA \u003d \u0027{\"hosts\":[{\"host_name\":\"host1\",\"trust_lvl\":\"untrusted\",\\"},{"line_number":1199,"context_line":"                           \"vtime\":\"2012-09-09T09:10:40Z\"}]}\u0027"},{"line_number":1200,"context_line":"        self._stub_service_is_up(True)"},{"line_number":1201,"context_line":"        filt_cls \u003d self.class_map[\u0027TrustedFilter\u0027]()"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2FuP4%3D","line":1198,"updated":"2012-11-28 18:03:58.000000000","message":"This backslash is unnecessary, and should be eliminated.","commit_id":"8cb7f719ff4d5942c92ecc7d2809094d602f1102"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"256cdb8facd22fa27910348f2454e12c35d8be61","unresolved":false,"context_lines":[{"line_number":1214,"context_line":""},{"line_number":1215,"context_line":"    def test_trusted_filter_untrusted_and_trusted_fails(self):"},{"line_number":1216,"context_line":"        global DATA"},{"line_number":1217,"context_line":"        DATA \u003d \u0027{\"hosts\":[{\"host_name\":\"host1\",\"trust_lvl\":\"trusted\",\\"},{"line_number":1218,"context_line":"                           \"vtime\":\"2012-09-09T09:10:40Z\"}]}\u0027"},{"line_number":1219,"context_line":"        self._stub_service_is_up(True)"},{"line_number":1220,"context_line":"        filt_cls \u003d self.class_map[\u0027TrustedFilter\u0027]()"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2FuP0%3D","line":1217,"updated":"2012-11-28 18:03:58.000000000","message":"This backslash is unnecessary, and should be eliminated.","commit_id":"8cb7f719ff4d5942c92ecc7d2809094d602f1102"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"256cdb8facd22fa27910348f2454e12c35d8be61","unresolved":false,"context_lines":[{"line_number":1235,"context_line":"        global DATA"},{"line_number":1236,"context_line":"        global Attestated"},{"line_number":1237,"context_line":""},{"line_number":1238,"context_line":"        DATA \u003d \u0027{\"hosts\":[{\"host_name\":\"host1\",\"trust_lvl\":\"untrusted\",\\"},{"line_number":1239,"context_line":"                           \"vtime\":\"2012-09-09T09:10:40Z\"}]}\u0027"},{"line_number":1240,"context_line":""},{"line_number":1241,"context_line":"        self._stub_service_is_up(True)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2FuPw%3D","line":1238,"updated":"2012-11-28 18:03:58.000000000","message":"This backslash is unnecessary, and should be eliminated.","commit_id":"8cb7f719ff4d5942c92ecc7d2809094d602f1102"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"256cdb8facd22fa27910348f2454e12c35d8be61","unresolved":false,"context_lines":[{"line_number":1257,"context_line":"        global DATA"},{"line_number":1258,"context_line":"        global Attestated"},{"line_number":1259,"context_line":""},{"line_number":1260,"context_line":"        DATA \u003d \u0027{\"hosts\":[{\"host_name\":\"host1\",\"trust_lvl\":\"untrusted\",\\"},{"line_number":1261,"context_line":"                           \"vtime\":\"2012-09-09T09:10:40Z\"}]}\u0027"},{"line_number":1262,"context_line":""},{"line_number":1263,"context_line":"        filt_cls \u003d self.class_map[\u0027TrustedFilter\u0027]()"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2FuPs%3D","line":1260,"updated":"2012-11-28 18:03:58.000000000","message":"This backslash is unnecessary, and should be eliminated.","commit_id":"8cb7f719ff4d5942c92ecc7d2809094d602f1102"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"256cdb8facd22fa27910348f2454e12c35d8be61","unresolved":false,"context_lines":[{"line_number":1289,"context_line":"        global DATA"},{"line_number":1290,"context_line":"        global Attestated"},{"line_number":1291,"context_line":""},{"line_number":1292,"context_line":"        DATA \u003d \u0027{\"hosts\":[{\"host_name\":\"host1\",\"trust_lvl\":\"untrusted\",\\"},{"line_number":1293,"context_line":"                           \"vtime\":\"2012-09-09T05:10:40-04:00\"}]}\u0027"},{"line_number":1294,"context_line":""},{"line_number":1295,"context_line":"        filt_cls \u003d self.class_map[\u0027TrustedFilter\u0027]()"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2FuPo%3D","line":1292,"updated":"2012-11-28 18:03:58.000000000","message":"This backslash is unnecessary, and should be eliminated.","commit_id":"8cb7f719ff4d5942c92ecc7d2809094d602f1102"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"daa560a6df63b11e66a374aac2d4309f509d4357","unresolved":false,"context_lines":[{"line_number":34,"context_line":"CONF \u003d cfg.CONF"},{"line_number":35,"context_line":"CONF.import_opt(\u0027my_ip\u0027, \u0027nova.config\u0027)"},{"line_number":36,"context_line":"DATA \u003d \u0027\u0027"},{"line_number":37,"context_line":"oat_attested \u003d False"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"def stub_out_https_backend(stubs):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAMX%2F%2F7Zg%3D","line":37,"updated":"2012-12-06 16:19:41.000000000","message":"I still don\u0027t like using a global here, I\u0027d almost rather stub_out_https_backend() be moved into the test, and oat_attested be made an instance variable of the test class…","commit_id":"9cdb0af47277c326434353768a000d63c40a0d7e"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"e52d4cd466a3a28cdcae78e40b9fd595266f7322","unresolved":false,"context_lines":[{"line_number":34,"context_line":"CONF \u003d cfg.CONF"},{"line_number":35,"context_line":"CONF.import_opt(\u0027my_ip\u0027, \u0027nova.config\u0027)"},{"line_number":36,"context_line":"DATA \u003d \u0027\u0027"},{"line_number":37,"context_line":"oat_attested \u003d False"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"def stub_out_https_backend(stubs):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2F%2FsY%3D","line":37,"in_reply_to":"AAAAMX%2F%2F7Zg%3D","updated":"2012-12-17 09:25:48.000000000","message":"Hmm, that sounds a good idea. I\u0027d prefer to submit a separated patch to fix this, The global DATA exist is already there, and the logic to \"remove the global variable\" is not related to the trust cache, thus a separated patch makes this patch more clean.\n\nDo you think this make sense?","commit_id":"9cdb0af47277c326434353768a000d63c40a0d7e"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"538530bedc9d5efc0389987cbe328d13f4571ab4","unresolved":false,"context_lines":[{"line_number":34,"context_line":"CONF \u003d cfg.CONF"},{"line_number":35,"context_line":"CONF.import_opt(\u0027my_ip\u0027, \u0027nova.config\u0027)"},{"line_number":36,"context_line":"DATA \u003d \u0027\u0027"},{"line_number":37,"context_line":"oat_attested \u003d False"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"def stub_out_https_backend(stubs):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAM3%2F%2F%2FZ0%3D","line":37,"updated":"2012-12-17 16:44:57.000000000","message":"Sure, cleaning up DATA in a separate patch makes sense; I\u0027m most concerned about the introduction of oat_attested here.  Although, to be clear, I have no problem with globals that are read-only (I see them as constants anyway), only the ones that are treated as read-write.","commit_id":"516cb25a3ee0aecd7f977980a626c881c57d5861"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"09a735873e7550dc2158203124a29fe1562388ca","unresolved":false,"context_lines":[{"line_number":34,"context_line":"CONF \u003d cfg.CONF"},{"line_number":35,"context_line":"CONF.import_opt(\u0027my_ip\u0027, \u0027nova.config\u0027)"},{"line_number":36,"context_line":"DATA \u003d \u0027\u0027"},{"line_number":37,"context_line":"oat_attested \u003d False"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"def stub_out_https_backend(stubs):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAM3%2F%2F%2BrY%3D","line":37,"in_reply_to":"AAAAM3%2F%2F%2FZ0%3D","updated":"2012-12-18 00:29:56.000000000","message":"Sure. The DATA/oat_attested here is in fact similar  (both are read-write), and the usage model is same also (for the http stub). I will create patch for it after this one merged.","commit_id":"516cb25a3ee0aecd7f977980a626c881c57d5861"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"eef8be21ba1060b6c925700693935023c06368a8","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def fake_do_request(self, *args, **kwargs):"},{"line_number":56,"context_line":"        global oat_attested"},{"line_number":57,"context_line":"        oat_attested \u003d True"},{"line_number":58,"context_line":"        return httplib.OK, FakeHTTPResponse()"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    stubs.Set(AttestationService, \u0027_do_request\u0027, fake_do_request)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAM3%2F%2Fy2I%3D","line":57,"updated":"2013-01-04 20:45:47.000000000","message":"Again, I have grave concerns about this use of global variables, even in the test suite.  What I see is that DATA and now oat_attested are only modified by HostFiltersTestCase.  What needs to happen is that stub_out_https_backend() gets moved into HostFiltersTestCase, and DATA and oat_attested need to become instance variables on that class.  I cannot feel comfortable hitting +2 on this patch until a change like that goes in…","commit_id":"afabf91659e5f750a15845e3252f1b1db0f8c277"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"d44928567872019d67de0a1efdbd1c29fce225e2","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def fake_do_request(self, *args, **kwargs):"},{"line_number":56,"context_line":"        global oat_attested"},{"line_number":57,"context_line":"        oat_attested \u003d True"},{"line_number":58,"context_line":"        return httplib.OK, FakeHTTPResponse()"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    stubs.Set(AttestationService, \u0027_do_request\u0027, fake_do_request)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAM3%2F%2FyGc%3D","line":57,"in_reply_to":"AAAAM3%2F%2Fy2I%3D","updated":"2013-01-05 07:38:13.000000000","message":"I thought you agreed my previous suggestion that I will submit another patch to fix the global variable issue after this merged .\n\nNow I have created a patch as https://review.openstack.org/#/c/19029/, which remove the global DATA, and the stub_out_https_backend\u0027s functionality is implemented as a function in HostFiltersTestCase.\n\n--jyh","commit_id":"afabf91659e5f750a15845e3252f1b1db0f8c277"}]}
