parser.error("The --server option is required for the %s command." % command) # The --server option must be used with --show-options and/or a valid command if opt.server and (not opt.show_options and not command_requires_server(command)): parser.error("The --server option requires --show-options and/or " "a valid command.") # The --server option is also required by --show-options if opt.show_options and not opt.server: parser.error("The --server option is required for --show-options.") # The --audit-log-name is required if a command specified. if command_requires_log_name(command) and not opt.log_name: parser.error("The --audit-log-name option is required for the %s command." % command) if opt.log_name and (not opt.file_stats and not command_requires_log_name(command)): parser.error("The --audit-log-name option requires --file-stats and/or " "a valid command.") # Attempt to parse the --server option server_values = None if opt.server: try: server_values = parse_connection(opt.server, None, opt) except FormatError: _, err, _ = sys.exc_info()
parser.error("The --server option is required for the {0} command." "".format(command)) # The --server option must be used with --show-options and/or a valid # command if opt.server and (not opt.show_options and not command_requires_server(command)): parser.error("The --server option requires --show-options and/or " "a valid command.") # The --server option is also required by --show-options if opt.show_options and not opt.server: parser.error("The --server option is required for --show-options.") # The --audit-log-name is required if a command specified. if command_requires_log_name(command) and not opt.log_name: parser.error("The --audit-log-name option is required for the {0} " "command.".format(command)) if opt.log_name and (not opt.file_stats and not command_requires_log_name(command)): parser.error("The --audit-log-name option requires --file-stats " "and/or a valid command.") # ssl option requires server if not opt.server and (opt.ssl_ca or opt.ssl_cert or opt.ssl_key): parser.error(PARSE_ERR_SSL_REQ_SERVER) # Attempt to parse the --server option server_values = None if opt.server: