merged gholts changes

This commit is contained in:
Clay Gerrard 2010-12-29 13:34:46 -06:00
commit e09c25be1a
15 changed files with 5 additions and 28 deletions

2
bin/st
View File

@ -44,8 +44,6 @@ except:
try:
from swift.common.bufferedhttp \
import BufferedHTTPConnection as HTTPConnection
import gettext
gettext.install('swift', unicode=1)
except:
from httplib import HTTPConnection

View File

@ -20,7 +20,6 @@ from urllib import quote
from hashlib import md5
import getopt
from itertools import chain
import gettext
import simplejson
from eventlet.greenpool import GreenPool
@ -325,7 +324,6 @@ class Auditor(object):
if __name__ == '__main__':
gettext.install('swift', unicode=1)
try:
optlist, args = getopt.getopt(sys.argv[1:], 'c:r:e:d')
except getopt.GetoptError, err:

View File

@ -18,13 +18,11 @@ from ConfigParser import ConfigParser
from optparse import OptionParser
from os.path import basename
from sys import argv, exit
import gettext
from swift.common.bufferedhttp import http_connect_raw as http_connect
if __name__ == '__main__':
gettext.install('swift', unicode=1)
default_conf = '/etc/swift/auth-server.conf'
parser = OptionParser(
usage='Usage: %prog [options] <account> <user> <password>')

View File

@ -17,12 +17,10 @@
from ConfigParser import ConfigParser
from optparse import OptionParser
from sys import argv, exit
import gettext
from swift.common.bufferedhttp import http_connect_raw as http_connect
if __name__ == '__main__':
gettext.install('swift', unicode=1)
default_conf = '/etc/swift/auth-server.conf'
parser = OptionParser(usage='Usage: %prog [options]')
parser.add_option('-c', '--conf', dest='conf', default=default_conf,

View File

@ -16,13 +16,11 @@
from os.path import basename
from sys import argv, exit
import gettext
from swift.common.db import get_db_connection
if __name__ == '__main__':
gettext.install('swift', unicode=1)
app = basename(argv[0])
if len(argv) != 3:
exit('''

View File

@ -20,7 +20,6 @@ import sys
import signal
import uuid
from optparse import OptionParser
import gettext
from swift.common.bench import BenchController
from swift.common.utils import readconf, NamedLogger
@ -56,7 +55,6 @@ SAIO_DEFAULTS = {
}
if __name__ == '__main__':
gettext.install('swift', unicode=1)
usage = "usage: %prog [OPTIONS] [CONF_FILE]"
usage += """\n\nConf file with SAIO defaults:

View File

@ -20,7 +20,6 @@ import re
import subprocess
import sys
from ConfigParser import ConfigParser
import gettext
from swift.common.utils import get_logger
@ -87,7 +86,6 @@ def comment_fstab(mount_point):
os.rename('/etc/fstab.new', '/etc/fstab')
if __name__ == '__main__':
gettext.install('swift', unicode=1)
c = ConfigParser()
try:
conf_path = sys.argv[1]

View File

@ -16,14 +16,11 @@
import sys
import urllib
import gettext
from swift.common.ring import Ring
from swift.common.utils import hash_path
gettext.install('swift', unicode=1)
if len(sys.argv) < 3 or len(sys.argv) > 5:
print 'Usage: %s <ring.gz> <account> [<container>] [<object>]' \
% sys.argv[0]

View File

@ -15,14 +15,12 @@
# limitations under the License.
import sys
import gettext
from swift.stats.log_uploader import LogUploader
from swift.common.utils import parse_options
from swift.common import utils
if __name__ == '__main__':
gettext.install('swift', unicode=1)
conf_file, options = parse_options(usage="Usage: %prog CONFIG_FILE PLUGIN")
try:
plugin = options['extra_args'][0]

View File

@ -18,14 +18,12 @@ import sys
import cPickle as pickle
from datetime import datetime
from hashlib import md5
import gettext
from swift.common.ring import Ring
from swift.obj.server import read_metadata
from swift.common.utils import hash_path
if __name__ == '__main__':
gettext.install('swift', unicode=1)
if len(sys.argv) <= 1:
print "Usage: %s OBJECT_FILE" % sys.argv[0]
sys.exit(1)

View File

@ -21,7 +21,6 @@ from os import mkdir
from os.path import basename, dirname, exists, join as pathjoin
from sys import argv, exit
from time import time
import gettext
from swift.common.ring import RingBuilder
@ -175,7 +174,6 @@ swift-ring-builder <builder_file> set_min_part_hours <hours>
if __name__ == '__main__':
gettext.install('swift', unicode=1)
if len(argv) < 2:
print '''
swift-ring-builder %(MAJOR_VERSION)s.%(MINOR_VERSION)s

View File

@ -21,7 +21,6 @@ from optparse import OptionParser
from sys import exit, argv
from time import time
from uuid import uuid4
import gettext
from eventlet import GreenPool, patcher, sleep
from eventlet.pools import Pool
@ -76,7 +75,6 @@ def report(success):
if __name__ == '__main__':
global begun, created, item_type, next_report, need_to_create, retries_done
gettext.install('swift', unicode=1)
patcher.monkey_patch()
parser = OptionParser()

View File

@ -23,7 +23,6 @@ from optparse import OptionParser
from sys import argv, exit, stderr
from time import time
from uuid import uuid4
import gettext
from eventlet import GreenPool, hubs, patcher, sleep, Timeout
from eventlet.pools import Pool
@ -747,7 +746,6 @@ def object_delete_report(coropool, connpool, options):
if __name__ == '__main__':
gettext.install('swift', unicode=1)
patcher.monkey_patch()
hubs.get_hub().debug_exceptions = False

View File

@ -1,3 +1,5 @@
__version__ = '1.1.0'
import gettext
__version__ = '1.1.0'
gettext.install('swift')

View File

@ -23,6 +23,7 @@ from shutil import rmtree
from eventlet import spawn, TimeoutError, listen
from eventlet.timeout import Timeout
from swift.common import utils
from swift.container import updater as container_updater
from swift.container import server as container_server
from swift.common.db import ContainerBroker
@ -33,6 +34,7 @@ from swift.common.utils import normalize_timestamp
class TestContainerUpdater(unittest.TestCase):
def setUp(self):
utils.HASH_PATH_SUFFIX = 'endcap'
self.path_to_test_xfs = os.environ.get('PATH_TO_TEST_XFS')
if not self.path_to_test_xfs or \
not os.path.exists(self.path_to_test_xfs):