| 2183 | } |
| 2184 | |
| 2185 | gboolean |
| 2186 | mon_refresh_display(gpointer user_data) |
| 2187 | { |
| 2188 | xmlNode *cib_copy = copy_xml(current_cib); |
| 2189 | pe_working_set_t data_set; |
| 2190 | |
| 2191 | last_refresh = time(NULL); |
| 2192 | |
| 2193 | if (cli_config_update(&cib_copy, NULL, FALSE) == FALSE) { |
| 2194 | if (cib) { |
| 2195 | cib->cmds->signoff(cib); |
| 2196 | } |
| 2197 | print_as("Upgrade failed: %s", pcmk_strerror(-pcmk_err_dtd_validation)); |
| 2198 | if (as_console) { |
| 2199 | sleep(2); |
| 2200 | } |
| 2201 | clean_up(EX_USAGE); |
| 2202 | return FALSE; |
| 2203 | } |
| 2204 | |
| 2205 | set_working_set_defaults(&data_set); |
| 2206 | data_set.input = cib_copy; |
| 2207 | cluster_status(&data_set); |
| 2208 | |
| 2209 | if (as_html_file || web_cgi) { |
| 2210 | if (print_html_status(&data_set, as_html_file, web_cgi) != 0) { |
| 2211 | fprintf(stderr, "Critical: Unable to output html file\n"); |
| 2212 | clean_up(EX_USAGE); |
| 2213 | } |
| 2214 | } else if (as_xml) { |
| 2215 | if (print_xml_status(&data_set) != 0) { |
| 2216 | fprintf(stderr, "Critical: Unable to output xml file\n"); |
| 2217 | clean_up(EX_USAGE); |
| 2218 | } |
| 2219 | } else if (daemonize) { |
| 2220 | /* do nothing */ |
| 2221 | |
| 2222 | } else if (simple_status) { |
| 2223 | print_simple_status(&data_set); |
| 2224 | if (has_warnings) { |
| 2225 | clean_up(EX_USAGE); |
| 2226 | } |
| 2227 | |
| 2228 | } else { |
| 2229 | print_status(&data_set); |
| 2230 | } |
| 2231 | |
| 2232 | cleanup_calculations(&data_set); |
| 2233 | return TRUE; |
| 2234 | } |
| 2235 | |
| 2236 | void mon_st_callback(stonith_t *st, stonith_event_t *e) |
| 2237 | { |
no test coverage detected