Sfoglia il codice sorgente

HUE-9199 [core] Remove internationalization of log message in runcherrypy

Romain 5 anni fa
parent
commit
51beb02a15

+ 7 - 8
desktop/core/src/desktop/management/commands/runcherrypyserver.py

@@ -25,7 +25,6 @@ from django.core.management.base import BaseCommand
 
 from desktop import conf
 from desktop.lib.daemon_utils import drop_privileges_if_necessary
-from django.utils.translation import ugettext as _
 
 
 CPSERVER_HELP = r"""
@@ -51,7 +50,7 @@ CPSERVER_OPTIONS = {
 
 
 class Command(BaseCommand):
-    help = _("CherryPy Server for Desktop.")
+    help = "CherryPy Server for Desktop."
     args = ""
 
     def handle(self, *args, **options):
@@ -68,7 +67,7 @@ class Command(BaseCommand):
         except AttributeError:
             pass
         runcpserver(args)
-        
+
     def usage(self, subcommand):
         return CPSERVER_HELP
 
@@ -83,7 +82,7 @@ def start_server(options):
     server = Server(
         (options['host'], int(options['port'])),
         WSGIHandler(),
-        int(options['threads']), 
+        int(options['threads']),
         options['server_name']
     )
     if options['ssl_certificate'] and options['ssl_private_key']:
@@ -93,7 +92,7 @@ def start_server(options):
             server.ssl_certificate_chain = options['ssl_certificate_chain']
         server.ssl_cipher_list = options['ssl_cipher_list']
         server.ssl_no_renegotiation = options['ssl_no_renegotiation']
-        
+
         ssl_password = conf.get_ssl_password()
         if ssl_password:
             server.ssl_password_cb = lambda *unused: ssl_password
@@ -104,7 +103,7 @@ def start_server(options):
 
         if isinstance(server.socket, SSLConnection):
           ciphers = server.socket.get_cipher_list()
-          logging.info(_("List of enabled ciphers: {}").format(':'.join(ciphers)))
+          logging.info("List of enabled ciphers: {}".format(':'.join(ciphers)))
 
         server.listen_and_loop()
     except KeyboardInterrupt:
@@ -121,13 +120,13 @@ def runcpserver(argset=[], **kwargs):
         else:
             k, v = x, True
         options[k.lower()] = v
-    
+
     if "help" in options:
         print(CPSERVER_HELP)
         return
 
     # Start the webserver
-    logging.info(_("Starting server with options:\n{}").format(pprint.pformat(options)))
+    logging.info("Starting server with options:\n{}".format(pprint.pformat(options)))
 
     start_server(options)