Commit a48a734b authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

some more editorial fixes with one refactoring: s/db_file/dbfile/ for variable name consistency.

parent 0f06a4fc
......@@ -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
methods 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:
......
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment