Ejemplo n.º 1
0
add_locking(parser)

# Add regexp
add_regexp(parser)

# Replication user and password
add_rpl_user(parser, None)

# Add replication options but don't include 'both'
add_rpl_mode(parser, False, False)

# Now we process the rest of the arguments.
opt, args = parser.parse_args()

try:
    skips = check_skip_options(opt.skip_objects)
except UtilError, e:
    print "ERROR: %s" % e.errmsg
    exit(1)

# Fail if no options listed.
if opt.destination is None:
    parser.error("No destination server specified.")

# Fail if no db arguments or all
if len(args) == 0 and not opt.all:
    parser.error("You must specify at least one database to copy or "
                 "use the --all option to copy all databases.")
    
# Fail if we have arguments and all databases option listed.
check_all(parser, opt, args, "databases")
Ejemplo n.º 2
0
# Add comment replication output
parser.add_option("--comment-rpl",
                  action="store_true",
                  default=False,
                  dest="comment_rpl",
                  help="place the replication statements "
                  "in comment statements. Valid only with --rpl option.")

# Now we process the rest of the arguments.
opt, args = parser.parse_args()

# Warn if quiet and verbosity are both specified
check_verbosity(opt)

try:
    skips = check_skip_options(opt.skip_objects)
except UtilError, e:
    print "ERROR: %s" % e.errmsg
    exit(1)

# Fail if no db arguments or all
if len(args) == 0 and not opt.all:
    parser.error("You must specify at least one database to export or "
                 "use the --all option to export all databases.")

# Check replication options
check_rpl_options(parser, opt)

# Fail if we have arguments and all databases option listed.
check_all(parser, opt, args, "databases")