)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4279b552e68a067187d150e059d125603687cf91","unresolved":false,"context_lines":[{"line_number":10,"context_line":"Currently, there is an issue where Object fields that are nullable can cause"},{"line_number":11,"context_line":"Exceptions when the get_schema() method is called."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"implements bp json-schema-for-versioned-object"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: Icce7a4c0ecbdf109132ceb901d0f1c141badbfe3"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"da4df55a_e688c873","line":13,"range":{"start_line":13,"start_character":14,"end_line":13,"end_character":46},"updated":"2016-12-27 16:45:51.000000000","message":"This should be \"json-schema-for-versioned-notifications\"","commit_id":"93ac485999438ac5c568722aedd71b8bcfb0d3a3"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e1cba2b7475e8db3878f8499e358183837c84f59","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Create script that prints JSON Schema of Notification Payload Classes"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change depends on https://review.openstack.org/#/c/411822/."},{"line_number":10,"context_line":"Currently, there is an issue where Object fields that are nullable can cause"},{"line_number":11,"context_line":"Exceptions when the get_schema() method is called."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"ba5201f7_40bc3ebb","line":9,"range":{"start_line":9,"start_character":12,"end_line":9,"end_character":64},"updated":"2017-01-11 14:33:33.000000000","message":"are you sure ? I don\u0027t see a Depends-On tag here describing the o.vo change-id.","commit_id":"cccfc816e95799bf3db88eb1ad3d9c28de940fe2"},{"author":{"_account_id":20411,"name":"Julian","email":"julian.sy@att.com","username":"syjulian"},"change_message_id":"fdfbc54a5464f0c6e97c6d55e02ceb65715f9a5d","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Create script that prints JSON Schema of Notification Payload Classes"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change depends on https://review.openstack.org/#/c/411822/."},{"line_number":10,"context_line":"Currently, there is an issue where Object fields that are nullable can cause"},{"line_number":11,"context_line":"Exceptions when the get_schema() method is called."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9a57fde8_c155041e","line":9,"range":{"start_line":9,"start_character":12,"end_line":9,"end_character":64},"in_reply_to":"ba5201f7_40bc3ebb","updated":"2017-01-12 13:45:32.000000000","message":"Done","commit_id":"cccfc816e95799bf3db88eb1ad3d9c28de940fe2"}],"nova/cmd/jsonschema_notifications.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6d9feab6295133434cb7f902f233b4de5789fcdc","unresolved":false,"context_lines":[{"line_number":30,"context_line":"import nova.objects.base as obj_base"},{"line_number":31,"context_line":"from nova import utils"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"import inspect"},{"line_number":34,"context_line":"import pkgutil"},{"line_number":35,"context_line":"import pprint"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"CONF \u003d nova.conf.CONF"},{"line_number":38,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5a3905b3_70956a85","line":35,"range":{"start_line":33,"start_character":0,"end_line":35,"end_character":13},"updated":"2017-01-23 08:40:04.000000000","message":"nit: I guess these imports are in the same category as sys above so no need a separate block for them","commit_id":"4fa43de7d5771239865dbd92027e8186a50ffac7"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6d9feab6295133434cb7f902f233b4de5789fcdc","unresolved":false,"context_lines":[{"line_number":40,"context_line":"def main():"},{"line_number":41,"context_line":"    config.parse_args(sys.argv)"},{"line_number":42,"context_line":"    logging.setup(CONF, \"nova\")"},{"line_number":43,"context_line":"    utils.monkey_patch()"},{"line_number":44,"context_line":"    objects.register_all()"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    payload_classes \u003d []"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a3905b3_10f18601","line":43,"updated":"2017-01-23 08:40:04.000000000","message":"Do we really need monkey patching to make this cmd work?","commit_id":"4fa43de7d5771239865dbd92027e8186a50ffac7"}],"tools/print_notification_schema.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"fa7d47a034d642ec9149015972a23b9f39fa6d87","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"def main():"},{"line_number":32,"context_line":"    payload_classes \u003d []"},{"line_number":33,"context_line":"    for loader, module_name, _ in pkgutil.walk_packages(notify_obj.__path__):"},{"line_number":34,"context_line":"        module \u003d loader.find_module(module_name).load_module(module_name)"},{"line_number":35,"context_line":"        for m in inspect.getmembers(module):"},{"line_number":36,"context_line":"            if inspect.isclass(m[1]) and issubclass("},{"line_number":37,"context_line":"                m[1], base.NotificationPayloadBase):"},{"line_number":38,"context_line":"                payload_classes.append(m[1])"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    # The OVO needs to be in the registry to be looked up from the field"},{"line_number":41,"context_line":"    obj_base.NovaObjectRegistry.register_notification_objects()"}],"source_content_type":"text/x-python","patch_set":1,"id":"da4df55a_65b91c79","line":38,"range":{"start_line":32,"start_character":0,"end_line":38,"end_character":44},"updated":"2016-12-28 11:40:36.000000000","message":"I think NovaObjectRegistry can be used to iterate over every registered ovo so you don\u0027t have to walk through the packages. See https://github.com/openstack/nova/blob/master/doc/ext/versioned_notifications.py#L56 as example.","commit_id":"93ac485999438ac5c568722aedd71b8bcfb0d3a3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"92651d9415658a91d7e28752f4c9237c6ac007b5","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"def main():"},{"line_number":32,"context_line":"    payload_classes \u003d []"},{"line_number":33,"context_line":"    for loader, module_name, _ in pkgutil.walk_packages(notify_obj.__path__):"},{"line_number":34,"context_line":"        module \u003d loader.find_module(module_name).load_module(module_name)"},{"line_number":35,"context_line":"        for m in inspect.getmembers(module):"},{"line_number":36,"context_line":"            if inspect.isclass(m[1]) and issubclass("},{"line_number":37,"context_line":"                m[1], base.NotificationPayloadBase):"},{"line_number":38,"context_line":"                payload_classes.append(m[1])"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    # The OVO needs to be in the registry to be looked up from the field"},{"line_number":41,"context_line":"    obj_base.NovaObjectRegistry.register_notification_objects()"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5201f7_b67cd0ec","line":38,"range":{"start_line":32,"start_character":0,"end_line":38,"end_character":44},"in_reply_to":"ba5201f7_ce6ecdc8","updated":"2017-01-09 10:15:27.000000000","message":"You are right. We have the same problem in the doc generation that we have to import modules manually to get the notifications registered. Then this is good as is.","commit_id":"93ac485999438ac5c568722aedd71b8bcfb0d3a3"},{"author":{"_account_id":20411,"name":"Julian","email":"julian.sy@att.com","username":"syjulian"},"change_message_id":"17ff19d88554e58b19fa1fad005b072a38f3a97a","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"def main():"},{"line_number":32,"context_line":"    payload_classes \u003d []"},{"line_number":33,"context_line":"    for loader, module_name, _ in pkgutil.walk_packages(notify_obj.__path__):"},{"line_number":34,"context_line":"        module \u003d loader.find_module(module_name).load_module(module_name)"},{"line_number":35,"context_line":"        for m in inspect.getmembers(module):"},{"line_number":36,"context_line":"            if inspect.isclass(m[1]) and issubclass("},{"line_number":37,"context_line":"                m[1], base.NotificationPayloadBase):"},{"line_number":38,"context_line":"                payload_classes.append(m[1])"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    # The OVO needs to be in the registry to be looked up from the field"},{"line_number":41,"context_line":"    obj_base.NovaObjectRegistry.register_notification_objects()"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5201f7_ce6ecdc8","line":38,"range":{"start_line":32,"start_character":0,"end_line":38,"end_character":44},"in_reply_to":"da4df55a_65b91c79","updated":"2017-01-03 19:58:03.000000000","message":"the NovaObjectRegistry doesn\u0027t seem to have all the notifications registered unless they\u0027re imported in the script. I tried using NovaObjectRegistry, but I would get an error about the ExceptionPayload not being in the registry","commit_id":"93ac485999438ac5c568722aedd71b8bcfb0d3a3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"fa7d47a034d642ec9149015972a23b9f39fa6d87","unresolved":false,"context_lines":[{"line_number":40,"context_line":"    # The OVO needs to be in the registry to be looked up from the field"},{"line_number":41,"context_line":"    obj_base.NovaObjectRegistry.register_notification_objects()"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    for cls in payload_classes:"},{"line_number":44,"context_line":"        schema \u003d cls.to_json_schema()"},{"line_number":45,"context_line":"        print(\u0027Schema for %s:\\n%s\\n----------\u0027 % (cls.__name__,"},{"line_number":46,"context_line":"                                                  pprint.pformat(schema),))"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"if __name__ \u003d\u003d \u0027__main__\u0027:"}],"source_content_type":"text/x-python","patch_set":1,"id":"da4df55a_e0b41a36","line":46,"range":{"start_line":43,"start_character":0,"end_line":46,"end_character":75},"updated":"2016-12-28 11:40:36.000000000","message":"I\u0027m wondering about what format the notification consumer wants to consume these schemas. Consumer can assume that the notification received from the versioned_notification topic has a versioned object payload. So the consumer can read payload[\u0027nova_object.name\u0027] field to get the name of the payload class. Then the consumer might want the get the schema of that class by the name of the class. We try to help the non python notification consumers with these schemas. They most probably won\u0027t call this script at runtime but instead generate the schemas build time and save them in their package / code. \n\nI think this is a good first step towards that. So let\u0027s get this merged. \n\nThen later on we can consider generating one file per schema or even providing a REST API where consumer can look up a schema by payload class name or by even_type.","commit_id":"93ac485999438ac5c568722aedd71b8bcfb0d3a3"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e1cba2b7475e8db3878f8499e358183837c84f59","unresolved":false,"context_lines":[{"line_number":18,"context_line":"\"\"\"Tool for printing the JSON Schema of the Notification Payloads"},{"line_number":19,"context_line":"\"\"\""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"import nova.notifications.objects as notify_obj"},{"line_number":23,"context_line":"import nova.notifications.objects.base as base"},{"line_number":24,"context_line":"import nova.objects.base as obj_base"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba5201f7_20965af0","line":21,"updated":"2017-01-11 14:33:33.000000000","message":"what is the purpose of this tool ? For operators wanting to know the schemas ?\n\nIf so, why are you not doing like nova-policy and write a cmd command ?","commit_id":"cccfc816e95799bf3db88eb1ad3d9c28de940fe2"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"7f16a7d841d7bb68eb6971b65692807f60dfb238","unresolved":false,"context_lines":[{"line_number":18,"context_line":"\"\"\"Tool for printing the JSON Schema of the Notification Payloads"},{"line_number":19,"context_line":"\"\"\""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"import nova.notifications.objects as notify_obj"},{"line_number":23,"context_line":"import nova.notifications.objects.base as base"},{"line_number":24,"context_line":"import nova.objects.base as obj_base"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_854adbaa","line":21,"in_reply_to":"9a57fde8_815bfc53","updated":"2017-01-16 08:58:19.000000000","message":"It is OK for me to make this a cmd.","commit_id":"cccfc816e95799bf3db88eb1ad3d9c28de940fe2"},{"author":{"_account_id":20411,"name":"Julian","email":"julian.sy@att.com","username":"syjulian"},"change_message_id":"fdfbc54a5464f0c6e97c6d55e02ceb65715f9a5d","unresolved":false,"context_lines":[{"line_number":18,"context_line":"\"\"\"Tool for printing the JSON Schema of the Notification Payloads"},{"line_number":19,"context_line":"\"\"\""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"import nova.notifications.objects as notify_obj"},{"line_number":23,"context_line":"import nova.notifications.objects.base as base"},{"line_number":24,"context_line":"import nova.objects.base as obj_base"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a57fde8_815bfc53","line":21,"in_reply_to":"ba5201f7_20965af0","updated":"2017-01-12 13:45:32.000000000","message":"i believe so. there wasn\u0027t much discussion on this script\u0027s implementation since it didn\u0027t have spec. i can create a cmd command if it needs to be that instead. \n\nthoughts?","commit_id":"cccfc816e95799bf3db88eb1ad3d9c28de940fe2"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a248f1129fc4f50ac560a7aa03dae7dd17cccd2b","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        for m in inspect.getmembers(module):"},{"line_number":36,"context_line":"            if inspect.isclass(m[1]) and issubclass("},{"line_number":37,"context_line":"                m[1], base.NotificationPayloadBase):"},{"line_number":38,"context_line":"                payload_classes.append(m[1])"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    # The OVO needs to be in the registry to be looked up from the field"},{"line_number":41,"context_line":"    obj_base.NovaObjectRegistry.register_notification_objects()"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba5201f7_1edbbc1c","line":38,"updated":"2017-01-10 11:04:51.000000000","message":"nit: add an extra indent to distinguish between the continuation line of the if\u0027s condition and this line.","commit_id":"cccfc816e95799bf3db88eb1ad3d9c28de940fe2"},{"author":{"_account_id":20411,"name":"Julian","email":"julian.sy@att.com","username":"syjulian"},"change_message_id":"fdfbc54a5464f0c6e97c6d55e02ceb65715f9a5d","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        for m in inspect.getmembers(module):"},{"line_number":36,"context_line":"            if inspect.isclass(m[1]) and issubclass("},{"line_number":37,"context_line":"                m[1], base.NotificationPayloadBase):"},{"line_number":38,"context_line":"                payload_classes.append(m[1])"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    # The OVO needs to be in the registry to be looked up from the field"},{"line_number":41,"context_line":"    obj_base.NovaObjectRegistry.register_notification_objects()"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a57fde8_a1580058","line":38,"in_reply_to":"ba5201f7_1edbbc1c","updated":"2017-01-12 13:45:32.000000000","message":"Done","commit_id":"cccfc816e95799bf3db88eb1ad3d9c28de940fe2"}]}
