minor update regarding DNS data retrieval task

This commit is contained in:
Miroslav Stampar
2012-04-02 12:22:40 +00:00
parent f7a664b120
commit abffc39929
5 changed files with 35 additions and 11 deletions

View File

@@ -244,8 +244,28 @@ class Agent:
return payload
def getComment(self, request):
"""
Returns comment form for the given request
"""
return request.comment if "comment" in request else ""
def hexConvertField(self, field):
"""
Returns hex converted field string
"""
rootQuery = queries[Backend.getIdentifiedDbms()]
hexField = field
if 'hex' in rootQuery:
hexField = rootQuery.hex.query % field
else:
warnMsg = "switch '--hex' is currently not supported on DBMS '%s'. " % Backend.getIdentifiedDbms()
singleTimeWarnMessage(warnMsg)
return hexField
def nullAndCastField(self, field):
"""
Take in input a field string and return its processed nulled and
@@ -288,14 +308,7 @@ class Agent:
nulledCastedField = rootQuery.isnull.query % nulledCastedField
if conf.hexConvert:
if 'hex' in rootQuery:
nulledCastedField = rootQuery.hex.query % nulledCastedField
else:
warnMsg = "switch '--hex' is currently not supported on DBMS '%s'. " % Backend.getIdentifiedDbms()
warnMsg += "Going to switch it off"
singleTimeWarnMessage(warnMsg)
conf.hexConvert = False
nulledCastedField = hexConvertField(nulledCastedField)
return nulledCastedField