--- wb_admin_control.py 2011-12-02 12:36:54.000000000 +0100 +++ /usr/lib64/mysql-workbench/modules/wb_admin_control.py 2011-12-26 19:55:27.103215460 +0100 @@ -360,32 +360,6 @@ def init(self): - # connect SQL - while self.sql_enabled: - try: - self.connect_sql() - break - except MySQLError, err: - if err.code == MYSQL_ERR_ACCESS_DENIED: - # Invalid password, request password - r = mforms.Utilities.show_error("Could not connect to MySQL Server at %s" % err.location, - "Could not connect to MySQL server: %s\nClick Continue to proceed without functionality that requires a DB connection." % err, - "Retry", "Cancel", "Continue") - if r == mforms.ResultOk: - continue - elif r == mforms.ResultCancel: - raise OperationCancelledError("Connection cancelled") - else: - # continue without a db connection - self.sql_enabled = False - else: - if mforms.Utilities.show_warning("Could not connect to MySQL Server at %s" % err.location, - "%s\nYou may continue anyway, but some functionality will be unavailable." % err, - "Continue", "Cancel", "") != mforms.ResultOk: - raise OperationCancelledError("Could not connect to MySQL") - else: - self.sql_enabled = False - if self.server_profile.uses_ssh: try: self.ssh = SSH(self.server_profile, self.password_handler) @@ -432,6 +406,32 @@ dprint_ex(1, "uses_ssh: %i uses_wmi: %i" % (self.server_profile.uses_ssh, self.server_profile.uses_wmi)) raise Exception("Unknown management method selected. Server Profile is possibly inconsistent") + # connect SQL + while self.sql_enabled: + try: + self.connect_sql() + break + except MySQLError, err: + if err.code == MYSQL_ERR_ACCESS_DENIED: + # Invalid password, request password + r = mforms.Utilities.show_error("Could not connect to MySQL Server at %s" % err.location, + "Could not connect to MySQL server: %s\nClick Continue to proceed without functionality that requires a DB connection." % err, + "Retry", "Cancel", "Continue") + if r == mforms.ResultOk: + continue + elif r == mforms.ResultCancel: + raise OperationCancelledError("Connection cancelled") + else: + # continue without a db connection + self.sql_enabled = False + else: + if mforms.Utilities.show_warning("Could not connect to MySQL Server at %s" % err.location, + "%s\nYou may continue anyway, but some functionality will be unavailable." % err, + "Continue", "Cancel", "") != mforms.ResultOk: + raise OperationCancelledError("Could not connect to MySQL") + else: + self.sql_enabled = False + def shutdown(self): self.events.event('shutdown') @@ -583,7 +583,7 @@ self.cfg_data = self.execute_filtered_command('cat %s' % self.server_profile.config_file_path, as_admin = True, admin_password = password)[0] - cfg_file = StringIO.StringIO(self.tail_data) + cfg_file = StringIO.StringIO(self.cfg_data) else: return {}