)]}'
{"trove/guestagent/datastore/couchbase/manager.py":[{"author":{"_account_id":8214,"name":"Auston McReynolds","email":"amcreynolds@ebaysf.com","username":"amcreynolds"},"change_message_id":"5aade68673cf3e6abd248692f1bcef0945a1c197","unresolved":false,"context_lines":[{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    def enable_root(self, context):"},{"line_number":150,"context_line":"        return self.app.enable_root()"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def _perform_restore(self, backup_info, context, restore_location, app):"},{"line_number":153,"context_line":"        raise exception.DatastoreOperationNotSupported("},{"line_number":154,"context_line":"            operation\u003d\u0027_perform_restore\u0027, datastore\u003dMANAGER)"}],"source_content_type":"text/x-python","patch_set":4,"id":"facab960_e280e68d","line":151,"updated":"2014-04-28 21:07:52.000000000","message":"is_root_enabled should remain, and it should simply check for the existence of system.pwd_file.","commit_id":"8a1d67e28bf4e26f5332dba4bf9bc5f62ad370bf"},{"author":{"_account_id":9895,"name":"Michael Yu","email":"michayu@ebaysf.com","username":"michayu"},"change_message_id":"f92807e39efb0ad2e961456aa5cdf8bf0aa847a4","unresolved":false,"context_lines":[{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    def enable_root(self, context):"},{"line_number":150,"context_line":"        return self.app.enable_root()"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def _perform_restore(self, backup_info, context, restore_location, app):"},{"line_number":153,"context_line":"        raise exception.DatastoreOperationNotSupported("},{"line_number":154,"context_line":"            operation\u003d\u0027_perform_restore\u0027, datastore\u003dMANAGER)"}],"source_content_type":"text/x-python","patch_set":4,"id":"facab960_85a48458","line":151,"in_reply_to":"facab960_e280e68d","updated":"2014-04-28 21:22:12.000000000","message":"Ah, good catch.  Done.","commit_id":"8a1d67e28bf4e26f5332dba4bf9bc5f62ad370bf"}],"trove/guestagent/datastore/couchbase/service.py":[{"author":{"_account_id":8214,"name":"Auston McReynolds","email":"amcreynolds@ebaysf.com","username":"amcreynolds"},"change_message_id":"1d8b916a416ade94927655d7e95ae4b0550d7a39","unresolved":false,"context_lines":[{"line_number":27,"context_line":"from trove.guestagent.datastore.couchbase import system"},{"line_number":28,"context_line":"from trove.openstack.common import log as logging"},{"line_number":29,"context_line":"from trove.openstack.common.gettextutils import _"},{"line_number":30,"context_line":"from trove.guestagent.db import models"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":33,"context_line":"CONF \u003d cfg.CONF"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAXH%2F%2FbHM%3D","line":30,"updated":"2014-04-21 22:17:51.000000000","message":"this import should be below \"from trove.guestagent.datastore.couchbase import system\" according to the hacking guidelines.","commit_id":"4c84f8c878b790ea935370f54da72353e8b10948"},{"author":{"_account_id":8214,"name":"Auston McReynolds","email":"amcreynolds@ebaysf.com","username":"amcreynolds"},"change_message_id":"01ce2b18ea642d5776cca01f6fd8cd15cbf14ac6","unresolved":false,"context_lines":[{"line_number":253,"context_line":"        self.write_password_to_file(root_password)"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    def write_password_to_file(self, root_password):"},{"line_number":256,"context_line":"        file \u003d open(system.pwd_file, \u0027w\u0027)"},{"line_number":257,"context_line":"        file.write(root_password)"},{"line_number":258,"context_line":"        file.close()"},{"line_number":259,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAXH%2F%2FbDw%3D","line":256,"updated":"2014-04-21 22:20:51.000000000","message":"should use a context manager.","commit_id":"4c84f8c878b790ea935370f54da72353e8b10948"},{"author":{"_account_id":8214,"name":"Auston McReynolds","email":"amcreynolds@ebaysf.com","username":"amcreynolds"},"change_message_id":"01ce2b18ea642d5776cca01f6fd8cd15cbf14ac6","unresolved":false,"context_lines":[{"line_number":263,"context_line":"        if os.path.exists(system.pwd_file):"},{"line_number":264,"context_line":"            with open(system.pwd_file) as file:"},{"line_number":265,"context_line":"                pwd \u003d file.readline()"},{"line_number":266,"context_line":"            file.close()"},{"line_number":267,"context_line":"        return pwd"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAXH%2F%2FbD0%3D","line":266,"updated":"2014-04-21 22:20:51.000000000","message":"redundant, because context manager auto-closes.","commit_id":"4c84f8c878b790ea935370f54da72353e8b10948"},{"author":{"_account_id":8214,"name":"Auston McReynolds","email":"amcreynolds@ebaysf.com","username":"amcreynolds"},"change_message_id":"09af4c03b543ec169a68edeb46c017b14e0a2aec","unresolved":false,"context_lines":[{"line_number":270,"context_line":"        pwd \u003d \"password\""},{"line_number":271,"context_line":"        if os.path.exists(system.pwd_file):"},{"line_number":272,"context_line":"            with open(system.pwd_file) as file:"},{"line_number":273,"context_line":"                pwd \u003d file.readline()"},{"line_number":274,"context_line":"        return pwd"}],"source_content_type":"text/x-python","patch_set":6,"id":"bad4c104_9aaa1dd3","line":273,"updated":"2014-04-29 07:50:44.000000000","message":"needs to be file.readline().strip(), otherwise the password retains the trailing newline, causing commands to fail:\n\n    2014-04-29 06:29:32.373 ERROR trove.guestagent.datastore.couchbase.service [req-47158a09-80bf-491c-981a-72097b5082df 5d1c550211ee45d7be97a0ca87c5bb13 76baf1dec8a1454db7c47ca0383414fd] Process execution error     Unexpected error while running command.\n    Command: sudo /opt/couchbase/bin/couchbase-cli cluster-init -c 10.0.0.4:8091 --cluster-init-username\u003droot --cluster-init-password\u003dfpuzhevHWD7eptz2vVZdMpFZyeZUEF9TZNVb\n     --cluster-init-port\u003d8091\n    Exit code: 127\n    Stdout: \u0027\u0027\n    Stderr: \u0027/bin/sh: 2: --cluster-init-port\u003d8091: not found\\n\u0027","commit_id":"6c1d7f903cf8398e0fabc255858a12765d77b648"},{"author":{"_account_id":8415,"name":"Denis M.","email":"lildee1991@gmail.com","username":"dmakogon"},"change_message_id":"d31262e5c1fb8bfa92428f1d27f54d86d82a1452","unresolved":false,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def set_password(self, root_password):"},{"line_number":241,"context_line":"        self.ip_address \u003d operating_system.get_ip_address()"},{"line_number":242,"context_line":"        child \u003d pexpect.spawn(system.cmd_reset_pwd % {\u0027IP\u0027: self.ip_address})"},{"line_number":243,"context_line":"        try:"},{"line_number":244,"context_line":"            child.expect(\u0027.*password.*\u0027)"},{"line_number":245,"context_line":"            child.sendline(root_password)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bad4c104_a00ecf32","line":242,"updated":"2014-04-29 11:33:36.000000000","message":"should be moved to try:except block","commit_id":"69b27e9f58a4903f4ca4046f7d1dfa99e6309314"},{"author":{"_account_id":8214,"name":"Auston McReynolds","email":"amcreynolds@ebaysf.com","username":"amcreynolds"},"change_message_id":"52e828d2497f9e1cba7719f765b10620f66ee388","unresolved":false,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def set_password(self, root_password):"},{"line_number":241,"context_line":"        self.ip_address \u003d operating_system.get_ip_address()"},{"line_number":242,"context_line":"        child \u003d pexpect.spawn(system.cmd_reset_pwd % {\u0027IP\u0027: self.ip_address})"},{"line_number":243,"context_line":"        try:"},{"line_number":244,"context_line":"            child.expect(\u0027.*password.*\u0027)"},{"line_number":245,"context_line":"            child.sendline(root_password)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9ad9bd40_8be730e4","line":242,"in_reply_to":"9ad9bd40_b4a29698","updated":"2014-04-30 07:46:43.000000000","message":"if they literally \"moved to try:except block\" (the existing one), there would be bigger issues. it\u0027s understood that the expect should be covered, but the spawn? in my opinion, you\u0027re splitting hairs here, considering all across the code-base this same \"problem\" exists. my stance remains as-is. on a related note, i\u0027d ask that you elaborate on your positions/suggestions in future code-reviews: the number of folks that are coming to CORE for clarifications on your comments is fairly high. we appreciate your insight, it\u0027s just a bit more content would help to avoid some churn.","commit_id":"69b27e9f58a4903f4ca4046f7d1dfa99e6309314"},{"author":{"_account_id":8415,"name":"Denis M.","email":"lildee1991@gmail.com","username":"dmakogon"},"change_message_id":"aaafebee20f3ea7dfeb90120ac9aac65e7acacbd","unresolved":false,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def set_password(self, root_password):"},{"line_number":241,"context_line":"        self.ip_address \u003d operating_system.get_ip_address()"},{"line_number":242,"context_line":"        child \u003d pexpect.spawn(system.cmd_reset_pwd % {\u0027IP\u0027: self.ip_address})"},{"line_number":243,"context_line":"        try:"},{"line_number":244,"context_line":"            child.expect(\u0027.*password.*\u0027)"},{"line_number":245,"context_line":"            child.sendline(root_password)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9ad9bd40_b4a29698","line":242,"in_reply_to":"bad4c104_6f55881c","updated":"2014-04-30 06:06:23.000000000","message":"Because when spawn called command being executed and it can possibly fail, out of try except block error hadling is not performed.\nErro handling should be done also for it. It\u0027s 100% unsafe to do like it done.","commit_id":"69b27e9f58a4903f4ca4046f7d1dfa99e6309314"},{"author":{"_account_id":8214,"name":"Auston McReynolds","email":"amcreynolds@ebaysf.com","username":"amcreynolds"},"change_message_id":"c57d8a691085a3481d1ed1ab843edbc2a32b471f","unresolved":false,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def set_password(self, root_password):"},{"line_number":241,"context_line":"        self.ip_address \u003d operating_system.get_ip_address()"},{"line_number":242,"context_line":"        child \u003d pexpect.spawn(system.cmd_reset_pwd % {\u0027IP\u0027: self.ip_address})"},{"line_number":243,"context_line":"        try:"},{"line_number":244,"context_line":"            child.expect(\u0027.*password.*\u0027)"},{"line_number":245,"context_line":"            child.sendline(root_password)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bad4c104_6f55881c","line":242,"in_reply_to":"bad4c104_a00ecf32","updated":"2014-04-29 19:30:46.000000000","message":"disagree. provide a lengthy reason explaining why and what problem/situation it would handle.","commit_id":"69b27e9f58a4903f4ca4046f7d1dfa99e6309314"},{"author":{"_account_id":8415,"name":"Denis M.","email":"lildee1991@gmail.com","username":"dmakogon"},"change_message_id":"d31262e5c1fb8bfa92428f1d27f54d86d82a1452","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        self.write_password_to_file(root_password)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"    def write_password_to_file(self, root_password):"},{"line_number":257,"context_line":"        utils.execute_with_timeout(\u0027mkdir\u0027,"},{"line_number":258,"context_line":"                                   \u0027-p\u0027,"},{"line_number":259,"context_line":"                                   system.COUCHBASE_CONF_DIR,"},{"line_number":260,"context_line":"                                   run_as_root\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":7,"id":"bad4c104_e00ff72c","line":257,"updated":"2014-04-29 11:33:36.000000000","message":"try:except required","commit_id":"69b27e9f58a4903f4ca4046f7d1dfa99e6309314"},{"author":{"_account_id":8214,"name":"Auston McReynolds","email":"amcreynolds@ebaysf.com","username":"amcreynolds"},"change_message_id":"52e828d2497f9e1cba7719f765b10620f66ee388","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        self.write_password_to_file(root_password)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"    def write_password_to_file(self, root_password):"},{"line_number":257,"context_line":"        utils.execute_with_timeout(\u0027mkdir\u0027,"},{"line_number":258,"context_line":"                                   \u0027-p\u0027,"},{"line_number":259,"context_line":"                                   system.COUCHBASE_CONF_DIR,"},{"line_number":260,"context_line":"                                   run_as_root\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9ad9bd40_cba2189a","line":257,"in_reply_to":"9ad9bd40_d4c63a49","updated":"2014-04-30 07:46:43.000000000","message":"this is a generalized answer to what was a very specific question. my stance remains as-is.","commit_id":"69b27e9f58a4903f4ca4046f7d1dfa99e6309314"},{"author":{"_account_id":8415,"name":"Denis M.","email":"lildee1991@gmail.com","username":"dmakogon"},"change_message_id":"aaafebee20f3ea7dfeb90120ac9aac65e7acacbd","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        self.write_password_to_file(root_password)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"    def write_password_to_file(self, root_password):"},{"line_number":257,"context_line":"        utils.execute_with_timeout(\u0027mkdir\u0027,"},{"line_number":258,"context_line":"                                   \u0027-p\u0027,"},{"line_number":259,"context_line":"                                   system.COUCHBASE_CONF_DIR,"},{"line_number":260,"context_line":"                                   run_as_root\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9ad9bd40_d4c63a49","line":257,"in_reply_to":"bad4c104_0f5ebc45","updated":"2014-04-30 06:06:23.000000000","message":"there are tons of cases when execute_with_timeout can fail: timeouts, wrong access writes, etc.\n\nSo, please, do error handling when your doing execs. It\u0027s required.\nPoor error handling is not what codebase needs!","commit_id":"69b27e9f58a4903f4ca4046f7d1dfa99e6309314"},{"author":{"_account_id":8214,"name":"Auston McReynolds","email":"amcreynolds@ebaysf.com","username":"amcreynolds"},"change_message_id":"c57d8a691085a3481d1ed1ab843edbc2a32b471f","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        self.write_password_to_file(root_password)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"    def write_password_to_file(self, root_password):"},{"line_number":257,"context_line":"        utils.execute_with_timeout(\u0027mkdir\u0027,"},{"line_number":258,"context_line":"                                   \u0027-p\u0027,"},{"line_number":259,"context_line":"                                   system.COUCHBASE_CONF_DIR,"},{"line_number":260,"context_line":"                                   run_as_root\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":7,"id":"bad4c104_0f5ebc45","line":257,"in_reply_to":"bad4c104_e00ff72c","updated":"2014-04-29 19:30:46.000000000","message":"disagree. provide a lengthy reason explaining why and what problem/situation it would handle.","commit_id":"69b27e9f58a4903f4ca4046f7d1dfa99e6309314"}],"trove/guestagent/datastore/couchbase/system.py":[{"author":{"_account_id":8214,"name":"Auston McReynolds","email":"amcreynolds@ebaysf.com","username":"amcreynolds"},"change_message_id":"1d8b916a416ade94927655d7e95ae4b0550d7a39","unresolved":false,"context_lines":[{"line_number":38,"context_line":"cmd_update_sysctl_conf \u003d (\u0027echo \"vm.swappiness \u003d 0\" | sudo tee -a \u0027"},{"line_number":39,"context_line":"                          \u0027/etc/sysctl.conf\u0027)"},{"line_number":40,"context_line":"cmd_reset_pwd \u003d \u0027sudo /opt/couchbase/bin/cbreset_password %(IP)s:8091\u0027"},{"line_number":41,"context_line":"pwd_file \u003d \u0027/tmp/secret_key\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAXH%2F%2FbGs%3D","line":41,"updated":"2014-04-21 22:17:51.000000000","message":"relying on a file in /tmp to be around for the life of a vm is extremely dangerous (and insecure). this should be stored in /etc/couchbase/ somewhere.","commit_id":"4c84f8c878b790ea935370f54da72353e8b10948"}]}
