Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
a48a734b
Commit
a48a734b
authored
Jan 12, 2011
by
JINMEI Tatuya
Browse files
some more editorial fixes with one refactoring: s/db_file/dbfile/ for variable name consistency.
parent
0f06a4fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/python/isc/datasrc/sqlite3_ds.py
View file @
a48a734b
...
...
@@ -71,7 +71,6 @@ def open(dbfile):
Return sqlite3 connection, sqlite3 cursor.
"""
# Open the database file. If necessary, set it up"""
try
:
conn
=
sqlite3
.
connect
(
dbfile
)
cur
=
conn
.
cursor
()
...
...
@@ -135,13 +134,13 @@ def get_zone_soa(zonename, dbfile):
def
get_zone_rrset
(
zonename
,
rr_name
,
rdtype
,
dbfile
):
"""Return the rrset of the zone with the given zone name, rrset
name and given
rd
type. If the zone doesn't exist or
rd
type
name and given
RR
type. If the zone doesn't exist or
RR
type
doesn't exist, return an empty list.
Arguments:
zonename - the zone's origin name.
rr_name - rr name.
rdtype -
rdata
type.
rdtype -
RR
type.
dbfile - the filename for the sqlite3 database.
"""
conn
,
cur
=
open
(
dbfile
)
...
...
@@ -154,13 +153,13 @@ def get_zone_rrset(zonename, rr_name, rdtype, dbfile):
return
datas
def
get_zones_info
(
db
_
file
):
def
get_zones_info
(
dbfile
):
""" Return all the zones' information in the database.
Arguments:
dbfile - the filename for the sqlite3 database.
"""
conn
,
cur
=
open
(
db
_
file
)
conn
,
cur
=
open
(
dbfile
)
cur
.
execute
(
"SELECT name, rdclass FROM zones"
)
info
=
cur
.
fetchone
()
while
info
:
...
...
@@ -192,7 +191,7 @@ def get_zoneid(zonename, cur):
def
zone_exist
(
zonename
,
dbfile
):
""" Search for the zone with the given zone name in databse. This
method may throw a Sqlite3DSError exception because its underlying
method
s
open() can throw that exception.
method open() can throw that exception.
Arguments:
zonename - the zone's origin name.
...
...
@@ -204,14 +203,14 @@ def zone_exist(zonename, dbfile):
zoneid
=
get_zoneid
(
zonename
,
cur
)
cur
.
close
()
conn
.
close
()
if
(
zoneid
)
:
if
zoneid
:
return
True
return
False
def
reverse_name
(
name
):
"""Reverse the labels of a domain name; for example,
given 'www.
isc
.org.', return 'org.
isc
.www.' This is needed
given 'www.
example
.org.', return 'org.
example
.www.' This is needed
for DNSSEC sort order.
Arguments:
...
...
src/lib/python/isc/datasrc/tests/Makefile.am
View file @
a48a734b
...
...
@@ -17,4 +17,3 @@ endif
env PYTHONPATH=$(abs_top_srcdir)/src/lib/python:$(abs_top_builddir)/src/lib/python:$(abs_top_builddir)/src/lib/python/isc/log
\
$(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ;
\
done
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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