diff options
Diffstat (limited to 'glances/exports/rabbitmq/__init__.py')
-rw-r--r-- | glances/exports/rabbitmq/__init__.py | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/glances/exports/rabbitmq/__init__.py b/glances/exports/rabbitmq/__init__.py index 8ffa8337..04ab8307 100644 --- a/glances/exports/rabbitmq/__init__.py +++ b/glances/exports/rabbitmq/__init__.py @@ -2,20 +2,10 @@ # # This file is part of Glances. # -# Copyright (C) 2019 Nicolargo <nicolas@nicolargo.com> +# SPDX-FileCopyrightText: 2022 Nicolas Hennion <nicolas@nicolargo.com> # -# Glances is free software; you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# SPDX-License-Identifier: LGPL-3.0-only # -# Glances is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. """JMS interface class.""" @@ -53,7 +43,7 @@ class Export(GlancesExport): 'rabbitmq', mandatories=['host', 'port', 'user', 'password', 'queue'], options=['protocol'] ) if not self.export_enable: - sys.exit(2) + exit('Missing RABBITMQ config') # Get the current hostname self.hostname = socket.gethostname() @@ -81,8 +71,8 @@ class Export(GlancesExport): channel = connection.channel() return channel except Exception as e: - logger.critical("Connection to rabbitMQ failed : %s " % e) - return None + logger.critical("Connection to rabbitMQ server %s:%s failed. %s" % (self.host, self.port, e)) + sys.exit(2) def export(self, name, columns, points): """Write the points in RabbitMQ.""" |