Added -v option for verbose output. Overrides quiet option in config file
Fixed bug when empty lines in config file
This commit is contained in:
@@ -71,6 +71,9 @@ def getparams(msg):
|
||||
parser.add_option("-t", "--ttl",
|
||||
type="int",
|
||||
help="TTL in seconds")
|
||||
parser.add_option("-v", "--verbose",
|
||||
action="store_true",
|
||||
help="Print progress information")
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
@@ -79,7 +82,6 @@ def getparams(msg):
|
||||
|
||||
msg = readcfg(msg)
|
||||
|
||||
|
||||
# Populate the basic params
|
||||
base_params = ['delete',
|
||||
'domain',
|
||||
@@ -103,6 +105,9 @@ def getparams(msg):
|
||||
if ip:
|
||||
msg['ipaddress'] = ip
|
||||
|
||||
if options.verbose and msg.has_key('quiet'):
|
||||
del msg['quiet']
|
||||
|
||||
return msg
|
||||
|
||||
|
||||
@@ -123,7 +128,7 @@ def readcfg(msg):
|
||||
|
||||
for line in cfgfile.readlines():
|
||||
line = line.strip()
|
||||
if line.find("#", 0, 1) == 0:
|
||||
if line.find("#", 0, 1) == 0 or not line:
|
||||
continue
|
||||
(key, value) = line.split('\t', 1)
|
||||
if not value.strip().lower() == "false":
|
||||
|
||||
Reference in New Issue
Block a user