MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / try_openais

Function try_openais

tools/crm_node.c:692–735  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

690
691#if HAVE_CONFDB
692static gboolean
693try_openais(int command, enum cluster_type_e stack)
694{
695 static crm_cluster_t cluster;
696 cluster.destroy = ais_membership_destroy;
697 cluster.cs_dispatch = ais_membership_dispatch;
698
699 if (init_cs_connection_once(&cluster)) {
700
701 GMainLoop *amainloop = NULL;
702 switch (command) {
703 case 'R':
704 send_ais_text(crm_class_rmpeer, target_uname, TRUE, NULL, crm_msg_ais);
705 cib_remove_node(atoi(target_uname), NULL);
706 crm_exit(0);
707
708 case 'e':
709 /* Age makes no sense (yet) in an AIS cluster */
710 fprintf(stdout, "1\n");
711 crm_exit(0);
712
713 case 'q':
714 send_ais_text(crm_class_quorum, NULL, TRUE, NULL, crm_msg_ais);
715 break;
716
717 case 'l':
718 case 'p':
719 crm_info("Requesting the list of configured nodes");
720 send_ais_text(crm_class_members, __FUNCTION__, TRUE, NULL, crm_msg_ais);
721 break;
722
723 case 'i':
724 printf("%u\n", cluster.nodeid);
725 crm_exit(0);
726
727 default:
728 fprintf(stderr, "Unknown option '%c'\n", command);
729 crm_help('?', EX_USAGE);
730 }
731 amainloop = g_main_new(FALSE);
732 g_main_run(amainloop);
733 }
734 return FALSE;
735}
736#endif
737
738int set_cluster_type(enum cluster_type_e type);

Callers 1

mainFunction · 0.85

Calls 5

cib_remove_nodeFunction · 0.85
crm_exitFunction · 0.85
crm_helpFunction · 0.85
init_cs_connection_onceFunction · 0.50
send_ais_textFunction · 0.50

Tested by

no test coverage detected