summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-06-13 16:12:23 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2013-07-26 07:31:17 -0700
commitcd9d8e45c6b8a747069d0cec2c1ff0360ebe6d73 (patch)
tree34a18abc1b5b0e4e151333a9af6cff697c1c4578 /tools
parent84b730b70f362f195728f50361ab54513efefe66 (diff)
downloadnova-cd9d8e45c6b8a747069d0cec2c1ff0360ebe6d73.tar.gz
Remove the monkey patching of _ into the builtins
Previous _ was monkey patched into builtins whenever certain modules were imported. This removes that and simply imports it when it is needed. Change-Id: I0af2c6d8a230e94440d655d13cab9107ac20d13c
Diffstat (limited to 'tools')
-rwxr-xr-xtools/db/schema_diff.py2
-rw-r--r--tools/esx/guest_tool.py4
-rw-r--r--tools/xenserver/populate_other_config.py3
-rwxr-xr-xtools/xenserver/vm_vdi_cleaner.py4
4 files changed, 5 insertions, 8 deletions
diff --git a/tools/db/schema_diff.py b/tools/db/schema_diff.py
index 406a2b6652..d2fd493914 100755
--- a/tools/db/schema_diff.py
+++ b/tools/db/schema_diff.py
@@ -37,6 +37,8 @@ import os
import subprocess
import sys
+from nova.openstack.common.gettextutils import _
+
### Dump
diff --git a/tools/esx/guest_tool.py b/tools/esx/guest_tool.py
index 2c2793010a..99cd62a64d 100644
--- a/tools/esx/guest_tool.py
+++ b/tools/esx/guest_tool.py
@@ -21,7 +21,6 @@ On Windows we require pyWin32 installed on Python.
"""
import array
-import gettext
import logging
import os
import platform
@@ -31,7 +30,8 @@ import subprocess
import sys
import time
-gettext.install('nova', unicode=1)
+from nova.openstack.common.gettextutils import _
+
PLATFORM_WIN = 'win32'
PLATFORM_LINUX = 'linux2'
diff --git a/tools/xenserver/populate_other_config.py b/tools/xenserver/populate_other_config.py
index 7151fee615..cf73e45dae 100644
--- a/tools/xenserver/populate_other_config.py
+++ b/tools/xenserver/populate_other_config.py
@@ -30,9 +30,6 @@ Run on compute-worker (not Dom0):
python ./tools/xenserver/populate_other_config.py [--dry-run|--verbose]
"""
-import gettext
-gettext.install('nova', unicode=1)
-
import os
import sys
diff --git a/tools/xenserver/vm_vdi_cleaner.py b/tools/xenserver/vm_vdi_cleaner.py
index fde666d936..f5f6357b97 100755
--- a/tools/xenserver/vm_vdi_cleaner.py
+++ b/tools/xenserver/vm_vdi_cleaner.py
@@ -17,15 +17,12 @@
"""vm_vdi_cleaner.py - List or clean orphaned VDIs/instances on XenServer."""
import doctest
-import gettext
import os
import sys
from oslo.config import cfg
import XenAPI
-gettext.install('nova', unicode=1)
-
possible_topdir = os.getcwd()
if os.path.exists(os.path.join(possible_topdir, "nova", "__init__.py")):
sys.path.insert(0, possible_topdir)
@@ -38,6 +35,7 @@ from nova.openstack.common import timeutils
from nova.virt import virtapi
from nova.virt.xenapi import driver as xenapi_driver
+
cleaner_opts = [
cfg.IntOpt('zombie_instance_updated_at_window',
default=172800,