diff --git a/Diagnostic/Utils/misc_helpers.py b/Diagnostic/Utils/misc_helpers.py index d082b9c72..2d2723627 100644 --- a/Diagnostic/Utils/misc_helpers.py +++ b/Diagnostic/Utils/misc_helpers.py @@ -150,14 +150,12 @@ def log_and_report_failed_config_generation(self, ext_event_type, config_invalid secrets in the protected settings. This is for logging to Geneva for diagnostic purposes. :return: None """ - config_invalid_log = "Invalid config settings given: " + config_invalid_reason + \ - ". Can't proceed, although this install/enable operation is reported as successful so " \ - "the VM can complete successful startup." - self._logger_log(config_invalid_log) - self._status_reporter(ext_event_type, 'success', '0', config_invalid_log) + config_invalid_log = "Invalid config settings given: {0}".format(config_invalid_reason) + self._logger_error(config_invalid_log) + self._status_reporter(ext_event_type, 'error', '2', config_invalid_log) self._waagent_event_adder(name=self._ext_name, op=ext_event_type, - isSuccess=True, # Note this is True, because it is a user error. + isSuccess=False, version=self._ext_ver, message="Invalid handler settings encountered: {0}".format(redacted_handler_settings)) @@ -169,14 +167,12 @@ def log_and_report_invalid_mdsd_cfg(self, ext_event_type, config_validate_cmd_ms :param mdsd_cfg_xml: Content of xmlCfg.xml to be sent to Geneva :return: None """ - message = "Problem(s) detected in generated mdsd configuration. Can't enable, although this install/enable " \ - "operation is reported as successful so the VM can complete successful startup. Linux Diagnostic " \ - "Extension will exit. Config validation message: {0}".format(config_validate_cmd_msg) - self._logger_log(message) - self._status_reporter(ext_event_type, 'success', '0', message) + message = "Problem(s) detected in generated mdsd configuration. Config validation message: {0}".format(config_validate_cmd_msg) + self._logger_error(message) + self._status_reporter(ext_event_type, 'error', '2', message) self._waagent_event_adder(name=self._ext_name, op=ext_event_type, - isSuccess=True, # Note this is True, because it is a user error. + isSuccess=False, version=self._ext_ver, message="Problem(s) detected in generated mdsd configuration: {0}".format(mdsd_cfg_xml)) diff --git a/Diagnostic/diagnostic.py b/Diagnostic/diagnostic.py index e674e261c..2debf49a1 100755 --- a/Diagnostic/diagnostic.py +++ b/Diagnostic/diagnostic.py @@ -261,13 +261,12 @@ def check_for_supported_waagent_and_distro_version(): return False if g_dist_config is None: - msg = ("LAD does not support distro/version ({0}); not installed. This extension install/enable operation is " - "still considered a success as it's an external error.").format(str(platform.dist())) + msg = ("LAD does not support distro/version ({0}); not installed.").format(str(platform.dist())) hutil.log(msg) - hutil.do_status_report(g_ext_op_type, "success", '0', msg) + hutil.do_status_report(g_ext_op_type, 'error', '2', msg) waagent.AddExtensionEvent(name=hutil.get_name(), op=g_ext_op_type, - isSuccess=True, + isSuccess=False, version=hutil.get_extension_version(), message="Can't be installed on this OS " + str(platform.dist())) return False @@ -496,7 +495,7 @@ def start_mdsd(configurator): g_mdsd_bin_path, xml_file, g_ext_dir) config_validate_cmd_status, config_validate_cmd_msg = RunGetOutput(config_validate_cmd) if config_validate_cmd_status is not 0: - # Invalid config. Log error and report success. + # Invalid config, report error. g_lad_log_helper.log_and_report_invalid_mdsd_cfg(g_ext_op_type, config_validate_cmd_msg, read_file_to_string(xml_file)) return