)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"02b0aa8821b790f86f248c6277c08805d64d29b1","unresolved":false,"context_lines":[{"line_number":10,"context_line":"The `db sync` command will be used to sync the cell0 database."},{"line_number":11,"context_line":"This ensures that operators will only have two db sync commands to"},{"line_number":12,"context_line":"perform in the single cell case."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"blueprint cells-cell0"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I21ae13a6c029e8ac89484faa212434911160fd51"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":13,"id":"7af24918_7317bb51","line":13,"updated":"2016-03-01 21:50:52.000000000","message":"It would be helpful to explain why context is being passed around to the db sync methods now. It\u0027s probably not immediately clear to reviewers.","commit_id":"974dd347aabcbfcf51298877825f779ceaf96afd"}],"nova/cmd/manage.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"cb78f2975d78a13c95ecfb53ca5db5653b69b689","unresolved":false,"context_lines":[{"line_number":933,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":934,"context_line":"        if cell_uuid:"},{"line_number":935,"context_line":"            cell_mapping \u003d objects.CellMapping.get_by_uuid(ctxt, cell_uuid)"},{"line_number":936,"context_line":"            with context.target_cell(ctxt, cell_mapping) as cell_ctxt:"},{"line_number":937,"context_line":"                return migration.db_sync(version, context\u003dcell_ctxt)"},{"line_number":938,"context_line":"        else:"},{"line_number":939,"context_line":"            migration.db_sync(version, context\u003dctxt)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a5ae5dd_31766b07","line":936,"range":{"start_line":936,"start_character":56,"end_line":936,"end_character":69},"updated":"2016-02-09 01:37:59.000000000","message":"This isn\u0027t required actually (I updated the commit message in my patch), you can leave this off and then do context\u003dctxt for the db_sync call and probably simplify this code","commit_id":"5d4108aaee795452bc1cb0649ae70ec9a9671539"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"a1ec0fa57957156454065294e994bb9ef7beedfd","unresolved":false,"context_lines":[{"line_number":932,"context_line":"    @args(\u0027--version\u0027, metavar\u003d\u0027\u003cversion\u003e\u0027, help\u003d\u0027Database version\u0027)"},{"line_number":933,"context_line":"    @args(\u0027--cell0\u0027, action\u003d\u0027store_true\u0027,"},{"line_number":934,"context_line":"          help\u003d\u0027Sync the cell0 database\u0027)"},{"line_number":935,"context_line":"    def sync(self, version\u003dNone, cell0\u003dFalse):"},{"line_number":936,"context_line":"        \"\"\"Sync the database up to the most recent version.\"\"\""},{"line_number":937,"context_line":"        if cell0:"},{"line_number":938,"context_line":"            ctxt \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_23a28999","line":935,"updated":"2016-02-29 17:59:44.000000000","message":"I thought we landed on this being True by default, though it\u0027s possible I\u0027m misremembering or missed a convo.","commit_id":"0f8cd6a83021507e2fa3066dd7565b21d17fee99"},{"author":{"_account_id":18247,"name":"Mark Doffman","email":"mdoffman@linux.vnet.ibm.com","username":"doffm"},"change_message_id":"1a2a3ffe63898828e8b41d841702dd801d4a0c26","unresolved":false,"context_lines":[{"line_number":932,"context_line":"    @args(\u0027--version\u0027, metavar\u003d\u0027\u003cversion\u003e\u0027, help\u003d\u0027Database version\u0027)"},{"line_number":933,"context_line":"    @args(\u0027--cell0\u0027, action\u003d\u0027store_true\u0027,"},{"line_number":934,"context_line":"          help\u003d\u0027Sync the cell0 database\u0027)"},{"line_number":935,"context_line":"    def sync(self, version\u003dNone, cell0\u003dFalse):"},{"line_number":936,"context_line":"        \"\"\"Sync the database up to the most recent version.\"\"\""},{"line_number":937,"context_line":"        if cell0:"},{"line_number":938,"context_line":"            ctxt \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_4cb41581","line":935,"in_reply_to":"9aed3d3a_23a28999","updated":"2016-02-29 20:18:00.000000000","message":"I will set it to True, that was the conclusion we came to on IRC, not sure why I flipped back.","commit_id":"0f8cd6a83021507e2fa3066dd7565b21d17fee99"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"a1ec0fa57957156454065294e994bb9ef7beedfd","unresolved":false,"context_lines":[{"line_number":935,"context_line":"    def sync(self, version\u003dNone, cell0\u003dFalse):"},{"line_number":936,"context_line":"        \"\"\"Sync the database up to the most recent version.\"\"\""},{"line_number":937,"context_line":"        if cell0:"},{"line_number":938,"context_line":"            ctxt \u003d context.get_admin_context()"},{"line_number":939,"context_line":"            cell_mapping \u003d objects.CellMapping.get_by_uuid(ctxt,"},{"line_number":940,"context_line":"                                            objects.CellMapping.CELL0_UUID)"},{"line_number":941,"context_line":"            with context.target_cell(ctxt, cell_mapping):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_a366994e","line":938,"updated":"2016-02-29 17:59:44.000000000","message":"Does this need to be an admin context?","commit_id":"0f8cd6a83021507e2fa3066dd7565b21d17fee99"},{"author":{"_account_id":18247,"name":"Mark Doffman","email":"mdoffman@linux.vnet.ibm.com","username":"doffm"},"change_message_id":"ad706f4e130df7469a2bf7beda330b10280c84c4","unresolved":false,"context_lines":[{"line_number":935,"context_line":"    def sync(self, version\u003dNone, cell0\u003dFalse):"},{"line_number":936,"context_line":"        \"\"\"Sync the database up to the most recent version.\"\"\""},{"line_number":937,"context_line":"        if cell0:"},{"line_number":938,"context_line":"            ctxt \u003d context.get_admin_context()"},{"line_number":939,"context_line":"            cell_mapping \u003d objects.CellMapping.get_by_uuid(ctxt,"},{"line_number":940,"context_line":"                                            objects.CellMapping.CELL0_UUID)"},{"line_number":941,"context_line":"            with context.target_cell(ctxt, cell_mapping):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_ecf4095c","line":938,"in_reply_to":"9aed3d3a_a366994e","updated":"2016-02-29 20:16:47.000000000","message":"I don\u0027t think there are any \u0027require_admin_context\u0027 calls between here and the database write. This does seem to be the standard pattern in this file though. I could create a non-admin RequestContext, but that doesn\u0027t seem to be what others have done here. There is no \u0027get_non_admin_context\u0027 in the context.py file.","commit_id":"0f8cd6a83021507e2fa3066dd7565b21d17fee99"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"7d9f00f87503b0c2764358f02b893d63066e29e6","unresolved":false,"context_lines":[{"line_number":935,"context_line":"    def sync(self, version\u003dNone, cell0\u003dFalse):"},{"line_number":936,"context_line":"        \"\"\"Sync the database up to the most recent version.\"\"\""},{"line_number":937,"context_line":"        if cell0:"},{"line_number":938,"context_line":"            ctxt \u003d context.get_admin_context()"},{"line_number":939,"context_line":"            cell_mapping \u003d objects.CellMapping.get_by_uuid(ctxt,"},{"line_number":940,"context_line":"                                            objects.CellMapping.CELL0_UUID)"},{"line_number":941,"context_line":"            with context.target_cell(ctxt, cell_mapping):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_b7a88a78","line":938,"in_reply_to":"9aed3d3a_ecf4095c","updated":"2016-02-29 20:34:27.000000000","message":"Yeah, I\u0027ve noticed the pattern is pretty prevalent. I think it is because there is no utility method for getting a non admin context as you pointed out. Unless it\u0027s necessary to have an admin context it would be better to just create the RequestContext so there are no questions later about why this uses an admin context.","commit_id":"0f8cd6a83021507e2fa3066dd7565b21d17fee99"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"a1ec0fa57957156454065294e994bb9ef7beedfd","unresolved":false,"context_lines":[{"line_number":936,"context_line":"        \"\"\"Sync the database up to the most recent version.\"\"\""},{"line_number":937,"context_line":"        if cell0:"},{"line_number":938,"context_line":"            ctxt \u003d context.get_admin_context()"},{"line_number":939,"context_line":"            cell_mapping \u003d objects.CellMapping.get_by_uuid(ctxt,"},{"line_number":940,"context_line":"                                            objects.CellMapping.CELL0_UUID)"},{"line_number":941,"context_line":"            with context.target_cell(ctxt, cell_mapping):"},{"line_number":942,"context_line":"                return migration.db_sync(version, context\u003dctxt)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_43418da8","line":939,"updated":"2016-02-29 17:59:44.000000000","message":"You need to handle the CellMappingNotFound exception that could be raised. I would suggest printing a warning in that case.","commit_id":"0f8cd6a83021507e2fa3066dd7565b21d17fee99"},{"author":{"_account_id":18247,"name":"Mark Doffman","email":"mdoffman@linux.vnet.ibm.com","username":"doffm"},"change_message_id":"1a2a3ffe63898828e8b41d841702dd801d4a0c26","unresolved":false,"context_lines":[{"line_number":936,"context_line":"        \"\"\"Sync the database up to the most recent version.\"\"\""},{"line_number":937,"context_line":"        if cell0:"},{"line_number":938,"context_line":"            ctxt \u003d context.get_admin_context()"},{"line_number":939,"context_line":"            cell_mapping \u003d objects.CellMapping.get_by_uuid(ctxt,"},{"line_number":940,"context_line":"                                            objects.CellMapping.CELL0_UUID)"},{"line_number":941,"context_line":"            with context.target_cell(ctxt, cell_mapping):"},{"line_number":942,"context_line":"                return migration.db_sync(version, context\u003dctxt)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_cca82523","line":939,"in_reply_to":"9aed3d3a_43418da8","updated":"2016-02-29 20:18:00.000000000","message":"Thanks, will do.","commit_id":"0f8cd6a83021507e2fa3066dd7565b21d17fee99"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"a1ec0fa57957156454065294e994bb9ef7beedfd","unresolved":false,"context_lines":[{"line_number":1333,"context_line":"                scheme, netloc, path, query, fragment \u003d \\"},{"line_number":1334,"context_line":"                    urlparse.urlsplit(CONF.database.connection)"},{"line_number":1335,"context_line":"                root, ext \u003d os.path.splitext(path)"},{"line_number":1336,"context_line":"                path \u003d root + \"_cell0\" + ext"},{"line_number":1337,"context_line":"                return urlparse.urlunsplit((scheme, netloc, path, query,"},{"line_number":1338,"context_line":"                                            fragment))"},{"line_number":1339,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_e3ad419c","line":1336,"updated":"2016-02-29 17:59:44.000000000","message":"This should go on the patch under this.","commit_id":"0f8cd6a83021507e2fa3066dd7565b21d17fee99"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"02b0aa8821b790f86f248c6277c08805d64d29b1","unresolved":false,"context_lines":[{"line_number":935,"context_line":"    def sync(self, version\u003dNone, disable_cell0\u003dFalse):"},{"line_number":936,"context_line":"        \"\"\"Sync the database up to the most recent version.\"\"\""},{"line_number":937,"context_line":"        if not disable_cell0:"},{"line_number":938,"context_line":"            ctxt \u003d context.get_admin_context()"},{"line_number":939,"context_line":"            try:"},{"line_number":940,"context_line":"                cell_mapping \u003d objects.CellMapping.get_by_uuid(ctxt,"},{"line_number":941,"context_line":"                                            objects.CellMapping.CELL0_UUID)"}],"source_content_type":"text/x-python","patch_set":13,"id":"7af24918_b38663b7","line":938,"updated":"2016-03-01 21:50:52.000000000","message":"I would still prefer this to not be an admin context, but it doesn\u0027t change anything if it is.","commit_id":"974dd347aabcbfcf51298877825f779ceaf96afd"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"97c06f1e1627668f64bef0397a6c91f569862d1c","unresolved":false,"context_lines":[{"line_number":732,"context_line":""},{"line_number":733,"context_line":"    @args(\u0027--version\u0027, metavar\u003d\u0027\u003cversion\u003e\u0027, help\u003d\u0027Database version\u0027)"},{"line_number":734,"context_line":"    @args(\u0027--disable_cell0\u0027, action\u003d\u0027store_true\u0027,"},{"line_number":735,"context_line":"          help\u003d\u0027Do not attempt to sync the cell0 database\u0027)"},{"line_number":736,"context_line":"    def sync(self, version\u003dNone, disable_cell0\u003dFalse):"},{"line_number":737,"context_line":"        \"\"\"Sync the database up to the most recent version.\"\"\""},{"line_number":738,"context_line":"        if not disable_cell0:"}],"source_content_type":"text/x-python","patch_set":20,"id":"dab17558_6736f2b5","line":735,"updated":"2016-05-12 18:22:08.000000000","message":"The plan is to eventually have this fan out to all cell databases right? I\u0027m just thinking that this flag should not be specific to a single cell. Perhaps something like --only-local, or --all-cells.","commit_id":"a0e511d87e91b79814e8e7866e92f33dfee1edf1"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"1f4fe01d45b7e883db25d8e80df98eba06074d2a","unresolved":false,"context_lines":[{"line_number":732,"context_line":""},{"line_number":733,"context_line":"    @args(\u0027--version\u0027, metavar\u003d\u0027\u003cversion\u003e\u0027, help\u003d\u0027Database version\u0027)"},{"line_number":734,"context_line":"    @args(\u0027--disable_cell0\u0027, action\u003d\u0027store_true\u0027,"},{"line_number":735,"context_line":"          help\u003d\u0027Do not attempt to sync the cell0 database\u0027)"},{"line_number":736,"context_line":"    def sync(self, version\u003dNone, disable_cell0\u003dFalse):"},{"line_number":737,"context_line":"        \"\"\"Sync the database up to the most recent version.\"\"\""},{"line_number":738,"context_line":"        if not disable_cell0:"}],"source_content_type":"text/x-python","patch_set":20,"id":"dab17558_aeeb5777","line":735,"in_reply_to":"dab17558_28b59f30","updated":"2016-05-13 19:11:07.000000000","message":"In this context, db migrations, I think we treat cell0 like any other cell. So I would expect to fan out to all cells, or just run locally.","commit_id":"a0e511d87e91b79814e8e7866e92f33dfee1edf1"},{"author":{"_account_id":18247,"name":"Mark Doffman","email":"mdoffman@linux.vnet.ibm.com","username":"doffm"},"change_message_id":"f5e3b994827252d9f76368a6b2e21f85b80faee1","unresolved":false,"context_lines":[{"line_number":732,"context_line":""},{"line_number":733,"context_line":"    @args(\u0027--version\u0027, metavar\u003d\u0027\u003cversion\u003e\u0027, help\u003d\u0027Database version\u0027)"},{"line_number":734,"context_line":"    @args(\u0027--disable_cell0\u0027, action\u003d\u0027store_true\u0027,"},{"line_number":735,"context_line":"          help\u003d\u0027Do not attempt to sync the cell0 database\u0027)"},{"line_number":736,"context_line":"    def sync(self, version\u003dNone, disable_cell0\u003dFalse):"},{"line_number":737,"context_line":"        \"\"\"Sync the database up to the most recent version.\"\"\""},{"line_number":738,"context_line":"        if not disable_cell0:"}],"source_content_type":"text/x-python","patch_set":20,"id":"dab17558_28b59f30","line":735,"in_reply_to":"dab17558_6736f2b5","updated":"2016-05-13 18:09:29.000000000","message":"Do you think that cell0 should be regarded as any other cell in this case? Should the default be to fanout to all the cells?","commit_id":"a0e511d87e91b79814e8e7866e92f33dfee1edf1"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"97c06f1e1627668f64bef0397a6c91f569862d1c","unresolved":false,"context_lines":[{"line_number":736,"context_line":"    def sync(self, version\u003dNone, disable_cell0\u003dFalse):"},{"line_number":737,"context_line":"        \"\"\"Sync the database up to the most recent version.\"\"\""},{"line_number":738,"context_line":"        if not disable_cell0:"},{"line_number":739,"context_line":"            ctxt \u003d context.get_admin_context()"},{"line_number":740,"context_line":"            try:"},{"line_number":741,"context_line":"                cell_mapping \u003d objects.CellMapping.get_by_uuid(ctxt,"},{"line_number":742,"context_line":"                                            objects.CellMapping.CELL0_UUID)"}],"source_content_type":"text/x-python","patch_set":20,"id":"dab17558_c747de1b","line":739,"updated":"2016-05-12 18:22:08.000000000","message":"Is an admin context needed here? If not please use context.RequestContext(user_id\u003dNone, project_id\u003dNone).","commit_id":"a0e511d87e91b79814e8e7866e92f33dfee1edf1"},{"author":{"_account_id":18247,"name":"Mark Doffman","email":"mdoffman@linux.vnet.ibm.com","username":"doffm"},"change_message_id":"f5e3b994827252d9f76368a6b2e21f85b80faee1","unresolved":false,"context_lines":[{"line_number":736,"context_line":"    def sync(self, version\u003dNone, disable_cell0\u003dFalse):"},{"line_number":737,"context_line":"        \"\"\"Sync the database up to the most recent version.\"\"\""},{"line_number":738,"context_line":"        if not disable_cell0:"},{"line_number":739,"context_line":"            ctxt \u003d context.get_admin_context()"},{"line_number":740,"context_line":"            try:"},{"line_number":741,"context_line":"                cell_mapping \u003d objects.CellMapping.get_by_uuid(ctxt,"},{"line_number":742,"context_line":"                                            objects.CellMapping.CELL0_UUID)"}],"source_content_type":"text/x-python","patch_set":20,"id":"dab17558_2502ea0b","line":739,"in_reply_to":"dab17558_c747de1b","updated":"2016-05-13 18:09:29.000000000","message":"Admin context not required, will change.","commit_id":"a0e511d87e91b79814e8e7866e92f33dfee1edf1"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"3a4cc628cf544006a8d75f943f32ad42cb229e02","unresolved":false,"context_lines":[{"line_number":740,"context_line":"    def sync(self, version\u003dNone, local_cell\u003dFalse):"},{"line_number":741,"context_line":"        \"\"\"Sync the database up to the most recent version.\"\"\""},{"line_number":742,"context_line":"        if not local_cell:"},{"line_number":743,"context_line":"            ctxt \u003d context.get_admin_context()"},{"line_number":744,"context_line":"            #NOTE(mdoff): Multiple cells not yet implemented. Currently"},{"line_number":745,"context_line":"            # fanout only looks for cell0."},{"line_number":746,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":21,"id":"bab6814e_871dca75","line":743,"updated":"2016-05-18 18:12:09.000000000","message":"admin context :)","commit_id":"9e9414e4700ee83908ed81f9dd858f220327731c"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"3a4cc628cf544006a8d75f943f32ad42cb229e02","unresolved":false,"context_lines":[{"line_number":741,"context_line":"        \"\"\"Sync the database up to the most recent version.\"\"\""},{"line_number":742,"context_line":"        if not local_cell:"},{"line_number":743,"context_line":"            ctxt \u003d context.get_admin_context()"},{"line_number":744,"context_line":"            #NOTE(mdoff): Multiple cells not yet implemented. Currently"},{"line_number":745,"context_line":"            # fanout only looks for cell0."},{"line_number":746,"context_line":"            try:"},{"line_number":747,"context_line":"                cell_mapping \u003d objects.CellMapping.get_by_uuid(ctxt,"}],"source_content_type":"text/x-python","patch_set":21,"id":"bab6814e_c7407259","line":744,"updated":"2016-05-18 18:12:09.000000000","message":"I think pep8 is going to yell at your for this. You need a space after the #.","commit_id":"9e9414e4700ee83908ed81f9dd858f220327731c"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"74c9e5092de59798fb9f46da0786474e55bc8e56","unresolved":false,"context_lines":[{"line_number":734,"context_line":"        pass"},{"line_number":735,"context_line":""},{"line_number":736,"context_line":"    @args(\u0027--version\u0027, metavar\u003d\u0027\u003cversion\u003e\u0027, help\u003d\u0027Database version\u0027)"},{"line_number":737,"context_line":"    @args(\u0027--local_cell\u0027, action\u003d\u0027store_true\u0027,"},{"line_number":738,"context_line":"          help\u003d\u0027Only sync db in the local cell: do not attempt to fan-out\u0027"},{"line_number":739,"context_line":"               \u0027to all cells\u0027)"},{"line_number":740,"context_line":"    def sync(self, version\u003dNone, local_cell\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":23,"id":"3aaa91ec_a214d84c","line":737,"updated":"2016-06-29 18:55:01.000000000","message":"The option name seems a touch awkward.\n\nWhat do you think of \"--all\" with a default of \"true\", meaning by default to sync all cells, including cell0?  If false, sync only the local cell.","commit_id":"e45defca488323ca410a8ffb682c8289d279cefb"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d46e063c445d15fa7d99a9e20258e72c16562de4","unresolved":false,"context_lines":[{"line_number":734,"context_line":"        pass"},{"line_number":735,"context_line":""},{"line_number":736,"context_line":"    @args(\u0027--version\u0027, metavar\u003d\u0027\u003cversion\u003e\u0027, help\u003d\u0027Database version\u0027)"},{"line_number":737,"context_line":"    @args(\u0027--local_cell\u0027, action\u003d\u0027store_true\u0027,"},{"line_number":738,"context_line":"          help\u003d\u0027Only sync db in the local cell: do not attempt to fan-out\u0027"},{"line_number":739,"context_line":"               \u0027to all cells\u0027)"},{"line_number":740,"context_line":"    def sync(self, version\u003dNone, local_cell\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":23,"id":"1aa78d24_0b896775","line":737,"in_reply_to":"3aaa91ec_a214d84c","updated":"2016-07-06 18:28:03.000000000","message":"The default is false, which means do all of them, which I think is okay for most people. Large deploys will need to be careful.","commit_id":"e45defca488323ca410a8ffb682c8289d279cefb"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d46e063c445d15fa7d99a9e20258e72c16562de4","unresolved":false,"context_lines":[{"line_number":735,"context_line":""},{"line_number":736,"context_line":"    @args(\u0027--version\u0027, metavar\u003d\u0027\u003cversion\u003e\u0027, help\u003d\u0027Database version\u0027)"},{"line_number":737,"context_line":"    @args(\u0027--local_cell\u0027, action\u003d\u0027store_true\u0027,"},{"line_number":738,"context_line":"          help\u003d\u0027Only sync db in the local cell: do not attempt to fan-out\u0027"},{"line_number":739,"context_line":"               \u0027to all cells\u0027)"},{"line_number":740,"context_line":"    def sync(self, version\u003dNone, local_cell\u003dFalse):"},{"line_number":741,"context_line":"        \"\"\"Sync the database up to the most recent version.\"\"\""}],"source_content_type":"text/x-python","patch_set":23,"id":"1aa78d24_ab15b340","line":738,"range":{"start_line":738,"start_character":66,"end_line":738,"end_character":73},"updated":"2016-07-06 18:28:03.000000000","message":"Can we s/fan-out/loop/ ? Otherwise I think this becomes a terminology clash with RPC fanout.","commit_id":"e45defca488323ca410a8ffb682c8289d279cefb"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"615074ab6c65a11192ac36c5a2498538e1165b4b","unresolved":false,"context_lines":[{"line_number":735,"context_line":""},{"line_number":736,"context_line":"    @args(\u0027--version\u0027, metavar\u003d\u0027\u003cversion\u003e\u0027, help\u003d\u0027Database version\u0027)"},{"line_number":737,"context_line":"    @args(\u0027--local_cell\u0027, action\u003d\u0027store_true\u0027,"},{"line_number":738,"context_line":"          help\u003d\u0027Only sync db in the local cell: do not attempt to fan-out\u0027"},{"line_number":739,"context_line":"               \u0027to all cells\u0027)"},{"line_number":740,"context_line":"    def sync(self, version\u003dNone, local_cell\u003dFalse):"},{"line_number":741,"context_line":"        \"\"\"Sync the database up to the most recent version.\"\"\""}],"source_content_type":"text/x-python","patch_set":23,"id":"dada55a8_82cbcc1d","line":738,"range":{"start_line":738,"start_character":66,"end_line":738,"end_character":73},"in_reply_to":"1aa78d24_ab15b340","updated":"2016-07-19 16:30:29.000000000","message":"I agree.","commit_id":"e45defca488323ca410a8ffb682c8289d279cefb"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e7b6e8db04927cabf7726c23639a65e62cee060f","unresolved":false,"context_lines":[{"line_number":738,"context_line":"          help\u003d\u0027Only sync db in the local cell: do not attempt to fan-out\u0027"},{"line_number":739,"context_line":"               \u0027to all cells\u0027)"},{"line_number":740,"context_line":"    def sync(self, version\u003dNone, local_cell\u003dFalse):"},{"line_number":741,"context_line":"        \"\"\"Sync the database up to the most recent version.\"\"\""},{"line_number":742,"context_line":"        if not local_cell:"},{"line_number":743,"context_line":"            ctxt \u003d context.RequestContext()"},{"line_number":744,"context_line":"            # NOTE(mdoff): Multiple cells not yet implemented. Currently"}],"source_content_type":"text/x-python","patch_set":23,"id":"3aaa91ec_66c4525f","line":741,"updated":"2016-06-27 13:32:44.000000000","message":"I\u0027m actually a bit confused here too. Tbc, FWIW, I thought that cell0 is something that can be there either in the API DB or in the cell DB, depending on the operators, right?\n\nBy default, sure, we create it like if it was a cell DB (so in the legacy DB), but I wonder why we should sync it by using the \u0027legacy\u0027 db.sync ? Why not having the cell0 sync done by a different sync call? Of course, the wrapping one-for-all cellv2 call could also run it.","commit_id":"e45defca488323ca410a8ffb682c8289d279cefb"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"615074ab6c65a11192ac36c5a2498538e1165b4b","unresolved":false,"context_lines":[{"line_number":738,"context_line":"          help\u003d\u0027Only sync db in the local cell: do not attempt to fan-out\u0027"},{"line_number":739,"context_line":"               \u0027to all cells\u0027)"},{"line_number":740,"context_line":"    def sync(self, version\u003dNone, local_cell\u003dFalse):"},{"line_number":741,"context_line":"        \"\"\"Sync the database up to the most recent version.\"\"\""},{"line_number":742,"context_line":"        if not local_cell:"},{"line_number":743,"context_line":"            ctxt \u003d context.RequestContext()"},{"line_number":744,"context_line":"            # NOTE(mdoff): Multiple cells not yet implemented. Currently"}],"source_content_type":"text/x-python","patch_set":23,"id":"dada55a8_4246f4bf","line":741,"in_reply_to":"1aa78d24_6b6c6bd0","updated":"2016-07-19 16:30:29.000000000","message":"Oh, thanks Dan, yeah Cell0 just acts as a normal cell.","commit_id":"e45defca488323ca410a8ffb682c8289d279cefb"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"57583963775219eca8e0495974d178aaa7c1d6da","unresolved":false,"context_lines":[{"line_number":738,"context_line":"          help\u003d\u0027Only sync db in the local cell: do not attempt to fan-out\u0027"},{"line_number":739,"context_line":"               \u0027to all cells\u0027)"},{"line_number":740,"context_line":"    def sync(self, version\u003dNone, local_cell\u003dFalse):"},{"line_number":741,"context_line":"        \"\"\"Sync the database up to the most recent version.\"\"\""},{"line_number":742,"context_line":"        if not local_cell:"},{"line_number":743,"context_line":"            ctxt \u003d context.RequestContext()"},{"line_number":744,"context_line":"            # NOTE(mdoff): Multiple cells not yet implemented. Currently"}],"source_content_type":"text/x-python","patch_set":23,"id":"3aaa91ec_ec2300a6","line":741,"in_reply_to":"3aaa91ec_66c4525f","updated":"2016-06-27 14:41:56.000000000","message":"cell0 is a cell db just like any other. It can reside on any host so it could be colocated with an api db but the schema matches all other cell dbs. So this would be the right sync command to use.","commit_id":"e45defca488323ca410a8ffb682c8289d279cefb"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d46e063c445d15fa7d99a9e20258e72c16562de4","unresolved":false,"context_lines":[{"line_number":738,"context_line":"          help\u003d\u0027Only sync db in the local cell: do not attempt to fan-out\u0027"},{"line_number":739,"context_line":"               \u0027to all cells\u0027)"},{"line_number":740,"context_line":"    def sync(self, version\u003dNone, local_cell\u003dFalse):"},{"line_number":741,"context_line":"        \"\"\"Sync the database up to the most recent version.\"\"\""},{"line_number":742,"context_line":"        if not local_cell:"},{"line_number":743,"context_line":"            ctxt \u003d context.RequestContext()"},{"line_number":744,"context_line":"            # NOTE(mdoff): Multiple cells not yet implemented. Currently"}],"source_content_type":"text/x-python","patch_set":23,"id":"1aa78d24_6b6c6bd0","line":741,"in_reply_to":"3aaa91ec_ec2300a6","updated":"2016-07-06 18:28:03.000000000","message":"Right, but to answer Sylvain\u0027s question: It\u0027s always a cell, regardless of where you physically locate it.","commit_id":"e45defca488323ca410a8ffb682c8289d279cefb"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d46e063c445d15fa7d99a9e20258e72c16562de4","unresolved":false,"context_lines":[{"line_number":745,"context_line":"            # fanout only looks for cell0."},{"line_number":746,"context_line":"            try:"},{"line_number":747,"context_line":"                cell_mapping \u003d objects.CellMapping.get_by_uuid(ctxt,"},{"line_number":748,"context_line":"                                            objects.CellMapping.CELL0_UUID)"},{"line_number":749,"context_line":"                with context.target_cell(ctxt, cell_mapping):"},{"line_number":750,"context_line":"                    migration.db_sync(version, context\u003dctxt)"},{"line_number":751,"context_line":"            except exception.CellMappingNotFound:"}],"source_content_type":"text/x-python","patch_set":23,"id":"1aa78d24_2b84235c","line":748,"updated":"2016-07-06 18:28:03.000000000","message":"Making this a proper loop over all cells from the get-go would probably help with the confusion around what we\u0027re doing here and when. But, I\u0027m okay with leaving it as is for now if it matters. Now that I\u0027ve realized my point of confusion, that is :)","commit_id":"e45defca488323ca410a8ffb682c8289d279cefb"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"615074ab6c65a11192ac36c5a2498538e1165b4b","unresolved":false,"context_lines":[{"line_number":745,"context_line":"            # fanout only looks for cell0."},{"line_number":746,"context_line":"            try:"},{"line_number":747,"context_line":"                cell_mapping \u003d objects.CellMapping.get_by_uuid(ctxt,"},{"line_number":748,"context_line":"                                            objects.CellMapping.CELL0_UUID)"},{"line_number":749,"context_line":"                with context.target_cell(ctxt, cell_mapping):"},{"line_number":750,"context_line":"                    migration.db_sync(version, context\u003dctxt)"},{"line_number":751,"context_line":"            except exception.CellMappingNotFound:"}],"source_content_type":"text/x-python","patch_set":23,"id":"dada55a8_76277db6","line":748,"in_reply_to":"1aa78d24_2b84235c","updated":"2016-07-19 16:30:29.000000000","message":"Not sure I totally get the direction here. So, we default to running the cell0 db sync added to the normal db sync, but we claim it\u0027s multi-cellsv2. \nThat\u0027s not totally honest, right? That only works because we agreed on only having one single cellv2 for Newton, that\u0027s it.\n\nSo, I can see 2 alternatives here\n\n - either we loop over all the cells like Dan said\n - or we don\u0027t pretend looping over in the help, just mentioning that the opt just prevents cell0 to be synced.","commit_id":"e45defca488323ca410a8ffb682c8289d279cefb"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"74c9e5092de59798fb9f46da0786474e55bc8e56","unresolved":false,"context_lines":[{"line_number":746,"context_line":"            try:"},{"line_number":747,"context_line":"                cell_mapping \u003d objects.CellMapping.get_by_uuid(ctxt,"},{"line_number":748,"context_line":"                                            objects.CellMapping.CELL0_UUID)"},{"line_number":749,"context_line":"                with context.target_cell(ctxt, cell_mapping):"},{"line_number":750,"context_line":"                    migration.db_sync(version, context\u003dctxt)"},{"line_number":751,"context_line":"            except exception.CellMappingNotFound:"},{"line_number":752,"context_line":"                print(_(\u0027WARNING: cell0 mapping not found - not\u0027"}],"source_content_type":"text/x-python","patch_set":23,"id":"3aaa91ec_35cc9d69","line":749,"updated":"2016-06-29 18:55:01.000000000","message":"This context manipulation stuff feels weird.  It would be so much more straightforward to just call the DB layer with the DB you intend to work with, but that\u0027s outside the scope of this patch.","commit_id":"e45defca488323ca410a8ffb682c8289d279cefb"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d46e063c445d15fa7d99a9e20258e72c16562de4","unresolved":false,"context_lines":[{"line_number":746,"context_line":"            try:"},{"line_number":747,"context_line":"                cell_mapping \u003d objects.CellMapping.get_by_uuid(ctxt,"},{"line_number":748,"context_line":"                                            objects.CellMapping.CELL0_UUID)"},{"line_number":749,"context_line":"                with context.target_cell(ctxt, cell_mapping):"},{"line_number":750,"context_line":"                    migration.db_sync(version, context\u003dctxt)"},{"line_number":751,"context_line":"            except exception.CellMappingNotFound:"},{"line_number":752,"context_line":"                print(_(\u0027WARNING: cell0 mapping not found - not\u0027"}],"source_content_type":"text/x-python","patch_set":23,"id":"1aa78d24_cb5d9f16","line":749,"in_reply_to":"3aaa91ec_35cc9d69","updated":"2016-07-06 18:28:03.000000000","message":"This is how we do it.","commit_id":"e45defca488323ca410a8ffb682c8289d279cefb"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"74c9e5092de59798fb9f46da0786474e55bc8e56","unresolved":false,"context_lines":[{"line_number":752,"context_line":"                print(_(\u0027WARNING: cell0 mapping not found - not\u0027"},{"line_number":753,"context_line":"                        \u0027 syncing cell0.\u0027))"},{"line_number":754,"context_line":"            except Exception:"},{"line_number":755,"context_line":"                print(_(\u0027ERROR: could not access cell mapping database - has\u0027"},{"line_number":756,"context_line":"                        \u0027 api db been created?\u0027))"},{"line_number":757,"context_line":"        return migration.db_sync(version)"},{"line_number":758,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"3aaa91ec_82055c7b","line":755,"updated":"2016-06-29 18:55:01.000000000","message":"It would be nice to show what the exception is or catch a more specific exception.","commit_id":"e45defca488323ca410a8ffb682c8289d279cefb"}]}
