Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Adam Osuchowski
Kea
Commits
22a8be53
Commit
22a8be53
authored
Mar 23, 2012
by
Jelte Jansen
Browse files
[963] add --quiet mode to b10-dbutil
parent
5e70d900
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/bin/dbutil/b10-dbutil.8
View file @
22a8be53
...
...
@@ -31,9 +31,9 @@
b10-dbutil \- Zone Database Maintenance Utility
.SH "SYNOPSIS"
.HP \w'\fBb10\-dbutil\ \-\-check\fR\ 'u
\fBb10\-dbutil \-\-check\fR [\-\-verbose] [\fIdbfile\fR]
\fBb10\-dbutil \-\-check\fR [\-\-verbose]
[\-\-quiet]
[\fIdbfile\fR]
.HP \w'\fBb10\-dbutil\ \-\-upgrade\fR\ 'u
\fBb10\-dbutil \-\-upgrade\fR [\-\-noconfirm] [\-\-verbose] [\fIdbfile\fR]
\fBb10\-dbutil \-\-upgrade\fR [\-\-noconfirm] [\-\-verbose]
[\-\-quiet]
[\fIdbfile\fR]
.SH "DESCRIPTION"
.PP
The
...
...
@@ -77,6 +77,11 @@ The upgrade function will upgrade a BIND 10 database \- no matter how old the sc
Enable verbose mode\&. Each SQL command issued by the utility will be printed to stdout before it is executed\&.
.RE
.PP
\fB\-\-quiet\fR
.RS 4
Enable quiet mode\&. No output is printed, except errors during command\-line argument parsing, or the user confirmation dialog\&.
.RE
.PP
\fB\fIdbfile\fR\fR
.RS 4
Name of the database file to check of upgrade\&.
...
...
src/bin/dbutil/b10-dbutil.xml
View file @
22a8be53
...
...
@@ -45,12 +45,14 @@
<cmdsynopsis>
<command>
b10-dbutil --check
</command>
<arg>
--verbose
</arg>
<arg>
--quiet
</arg>
<arg><replaceable
choice=
'req'
>
dbfile
</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>
b10-dbutil --upgrade
</command>
<arg>
--noconfirm
</arg>
<arg>
--verbose
</arg>
<arg>
--quiet
</arg>
<arg><replaceable
choice=
'req'
>
dbfile
</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
...
...
@@ -161,6 +163,17 @@
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>
--quiet
</option>
</term>
<listitem>
<para>
Enable quiet mode. No output is printed, except errors during
command-line argument parsing, or the user confirmation dialog.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option><replaceable
choice=
'req'
>
dbfile
</replaceable></option>
...
...
src/bin/dbutil/dbutil.py.in
View file @
22a8be53
...
...
@@ -509,6 +509,9 @@ def parse_command():
parser.add_option("-v", "--verbose", action="store_true",
dest="verbose", default=False,
help="Print SQL statements as they are executed")
parser.add_option("-q", "--quiet", action="store_true",
dest="quiet", default=False,
help="Don't print any info, warnings or errors")
(options, args) = parser.parse_args()
# Set the database file on which to operate
...
...
@@ -543,6 +546,11 @@ if __name__ == "__main__":
if options.verbose:
isc.log.init("b10-dbutil", "DEBUG", 99)
logger = isc.log.Logger("dbutil")
elif options.quiet:
# We don't use FATAL, so setting the logger to use
# it should essentially make it silent.
isc.log.init("b10-dbutil", "FATAL")
logger = isc.log.Logger("dbutil")
db = Database(args[0])
exit_code = EXIT_SUCCESS
...
...
src/bin/dbutil/tests/dbutil_test.sh.in
View file @
22a8be53
...
...
@@ -443,6 +443,12 @@ copy_file $testdata/old_v1.sqlite3 $tempfile
passzero
$?
rm
-f
$tempfile
$backupfile
echo
"13.3 quiet flag"
copy_file
$testdata
/old_v1.sqlite3
$tempfile
../run_dbutil.sh
--check
--quiet
$tempfile
2>&1 |
grep
dbutil
failzero
$?
rm
-f
$tempfile
$backupfile
echo
"13.3 Interactive prompt - yes"
copy_file
$testdata
/old_v1.sqlite3
$tempfile
../run_dbutil.sh
--upgrade
$tempfile
<<
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment