@@ -276,8 +276,6 @@ Cluster_set_impl::refresh_cluster_replication_user(Cluster_impl *cluster,
276
276
std::tie (repl_user, repl_user_host) = get_cluster_repl_account (cluster);
277
277
278
278
try {
279
- auto console = mysqlsh::current_console ();
280
-
281
279
log_info (" Resetting password for %s@%s at %s" , repl_user.c_str (),
282
280
repl_user_host.c_str (), primary->descr ().c_str ());
283
281
// re-create replication with a new generated password
@@ -639,7 +637,11 @@ void ensure_no_router_uses_cluster(const std::vector<Router_metadata> &routers,
639
637
640
638
Cluster_global_status Cluster_set_impl::get_cluster_global_status (
641
639
Cluster_impl *cluster) const {
642
- assert (cluster->is_cluster_set_member ());
640
+ {
641
+ auto cluster_set_member = cluster->is_cluster_set_member ();
642
+ assert (cluster_set_member);
643
+ if (!cluster_set_member) return Cluster_global_status::UNKNOWN;
644
+ }
643
645
644
646
if (cluster->is_invalidated ()) return Cluster_global_status::INVALIDATED;
645
647
@@ -1865,7 +1867,6 @@ void Cluster_set_impl::update_replica(
1865
1867
bool dry_run) {
1866
1868
log_info (" Updating replication source at %s" , replica->descr ().c_str ());
1867
1869
1868
- auto console = current_console ();
1869
1870
auto repl_options = ar_options;
1870
1871
1871
1872
try {
@@ -1883,8 +1884,9 @@ void Cluster_set_impl::update_replica(
1883
1884
log_info (" Replication source changed for %sinstance %s" ,
1884
1885
(primary_instance ? " primary " : " " ), replica->descr ().c_str ());
1885
1886
} catch (...) {
1886
- console->print_error (" Error updating replication source for " +
1887
- replica->descr () + " : " + format_active_exception ());
1887
+ current_console ()->print_error (" Error updating replication source for " +
1888
+ replica->descr () + " : " +
1889
+ format_active_exception ());
1888
1890
1889
1891
throw shcore::Exception (
1890
1892
" Could not update replication source of " + replica->descr (),
0 commit comments