shlomi-noach / openarkkit

Automatically exported from code.google.com/p/openarkkit
24 stars 16 forks source link

exit is used instead of sys.exit #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
$ python -V
Python 2.4.3

$ oak-online-alter-table --help
usage: oak-online-alter-table [options]

options:
  -h, --help            show this help message and exit
  -u USER, --user=USER  MySQL user
  -H HOST, --host=HOST  MySQL host (default: localhost)
  -p PASSWORD, --password=PASSWORD
                        MySQL password
  --ask-pass            Prompt for password
  -P PORT, --port=PORT  TCP/IP port (default: 3306)
  -S SOCKET, --socket=SOCKET
                        MySQL socket file. Only applies when host is localhost
  --defaults-file=DEFAULTS_FILE
                        Read from MySQL configuration file. Overrides all
                        other options
  -d DATABASE, --database=DATABASE
                        Database name (required unless table is fully
                        qualified)
  -t TABLE, --table=TABLE
                        Table to alter (optionally fully qualified)
  -g GHOST, --ghost=GHOST
                        Table name to serve as ghost. This table will be
                        created and synchronized with the original table
  -a ALTER_STATEMENT, --alter=ALTER_STATEMENT
                        Comma delimited ALTER statement details, excluding the
                        'ALTER TABLE t' itself
  -c CHUNK_SIZE, --chunk-size=CHUNK_SIZE
                        Number of rows to act on in chunks. Default: 1000
  -l, --lock-chunks     Use LOCK TABLES for each chunk
  --sleep=SLEEP_MILLIS  Number of milliseconds to sleep between chunks.
                        Default: 0
  --cleanup             Remove custom triggers, ghost table from possible
                        previous runs
  -v, --verbose         Print user friendly messages
  -q, --quiet           Quiet mode, do not verbose
exceptions.Exception 0
-- ERROR: Errors found. Initiating cleanup
-- ERROR: 0
Traceback (most recent call last):
  File "/usr/local/bin/oak-online-alter-table", line 954, in ?
    exit_with_error(err)
  File "/usr/local/bin/oak-online-alter-table", line 853, in exit_with_error
    exit(1)
TypeError: 'str' object is not callable

$ python
Python 2.4.3 (#1, Sep  3 2009, 15:37:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit
'Use Ctrl-D (i.e. EOF) to exit.'
>>> exit(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: 'str' object is not callable

$ python
Python 2.4.3 (#1, Sep  3 2009, 15:37:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.exit
<built-in function exit>
>>> sys.exit(1)

Original issue reported on code.google.com by gha...@gmail.com on 18 Jan 2011 at 11:48

GoogleCodeExporter commented 9 years ago
Is this ReadHat/CentOS? I found different behavior than with Debian/Ubuntu.
The "exit(1)" call is widespread in all openark-kit binaries. Will fix them all.

Original comment by shlomi.n...@gmail.com on 30 Jan 2011 at 6:44

GoogleCodeExporter commented 9 years ago
Is this ReadHat/CentOS? I found different behavior than with Debian/Ubuntu.
The "exit(1)" call is widespread in all openark-kit binaries. Will fix them all.

Original comment by shlomi.n...@gmail.com on 30 Jan 2011 at 6:44