From 59b020c0d4f301cbd7c38286d1dd5acc06f7efe9 Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 25 Jul 2018 21:41:05 +0200 Subject: [PATCH] Replace all occurrences of logger.info with logger.error --- hosting/views.py | 2 +- opennebula_api/models.py | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hosting/views.py b/hosting/views.py index 6af1885b..f2c51cf5 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -1394,7 +1394,7 @@ class VirtualMachineView(LoginRequiredMixin, View): terminated = manager.delete_vm(vm.id) if not terminated: - logger.debug( + logger.error( "manager.delete_vm returned False. Hence, error making " "xml-rpc call to delete vm failed." ) diff --git a/opennebula_api/models.py b/opennebula_api/models.py index 29632009..611a0712 100644 --- a/opennebula_api/models.py +++ b/opennebula_api/models.py @@ -110,7 +110,7 @@ class OpenNebulaManager(): raise UserExistsError() except OpenNebulaException as err: logger.error('OpenNebulaException error: {0}'.format(err)) - logger.debug('User exists but password is wrong') + logger.error('User exists but password is wrong') raise UserCredentialError() except WrongNameError: @@ -148,7 +148,7 @@ class OpenNebulaManager(): ) return opennebula_user except ConnectionRefusedError: - logger.info( + logger.error( 'Could not connect to host: {host} via protocol {protocol}'.format( host=settings.OPENNEBULA_DOMAIN, protocol=settings.OPENNEBULA_PROTOCOL) @@ -160,7 +160,7 @@ class OpenNebulaManager(): user_pool = oca.UserPool(self.oneadmin_client) user_pool.info() except ConnectionRefusedError: - logger.info( + logger.error( 'Could not connect to host: {host} via protocol {protocol}'.format( host=settings.OPENNEBULA_DOMAIN, protocol=settings.OPENNEBULA_PROTOCOL) @@ -174,7 +174,7 @@ class OpenNebulaManager(): vm_pool.info() return vm_pool except AttributeError: - logger.info('Could not connect via client, using oneadmin instead') + logger.error('Could not connect via client, using oneadmin instead') try: vm_pool = oca.VirtualMachinePool(self.oneadmin_client) vm_pool.info(filter=-2) @@ -183,7 +183,7 @@ class OpenNebulaManager(): raise ConnectionRefusedError except ConnectionRefusedError: - logger.info( + logger.error( 'Could not connect to host: {host} via protocol {protocol}'.format( host=settings.OPENNEBULA_DOMAIN, protocol=settings.OPENNEBULA_PROTOCOL) @@ -325,14 +325,14 @@ class OpenNebulaManager(): ) vm_terminated = True except socket.timeout as socket_err: - logger.info("Socket timeout error: {0}".format(socket_err)) + logger.error("Socket timeout error: {0}".format(socket_err)) except OpenNebulaException as opennebula_err: - logger.info( + logger.error( "OpenNebulaException error: {0}".format(opennebula_err)) except OSError as os_err: - logger.info("OSError : {0}".format(os_err)) + logger.error("OSError : {0}".format(os_err)) except ValueError as value_err: - logger.info("ValueError : {0}".format(value_err)) + logger.error("ValueError : {0}".format(value_err)) return vm_terminated @@ -342,7 +342,7 @@ class OpenNebulaManager(): template_pool.info() return template_pool except ConnectionRefusedError: - logger.info( + logger.error( """Could not connect to host: {host} via protocol {protocol}""".format( host=settings.OPENNEBULA_DOMAIN,