diff --git a/monasca_notification/main.py b/monasca_notification/main.py index 629127f..bc86265 100644 --- a/monasca_notification/main.py +++ b/monasca_notification/main.py @@ -95,7 +95,7 @@ def main(argv=None): else: config_file = '/etc/monasca/notification.yaml' - config = yaml.load(open(config_file, 'r')) + config = yaml.safe_load(open(config_file, 'r')) # Setup logging logging.config.dictConfig(config['logging']) diff --git a/monasca_notification/plugins/jira_notifier.py b/monasca_notification/plugins/jira_notifier.py index 9801db6..02a6bcd 100644 --- a/monasca_notification/plugins/jira_notifier.py +++ b/monasca_notification/plugins/jira_notifier.py @@ -83,7 +83,7 @@ class JiraNotifier(AbstractNotifier): if (not self.jira_fields_format and self._config.get("custom_formatter")): try: with open(self._config.get("custom_formatter")) as f: - jira_fields_format = yaml.load(f) + jira_fields_format = yaml.safe_load(f) except Exception: self._log.exception("Unable to read custom_formatter file. Check file location") raise