[roster-dns-management] r1146 committed - Fixing a huge flaw in dns_query_lib that. It will now check for srv re...

0 views
Skip to first unread message

roster-dns...@googlecode.com

unread,
Jul 10, 2013, 2:36:39 PM7/10/13
to roster-...@googlegroups.com
Revision: 1146
Author: J.S.P...@gmail.com
Date: Wed Jul 10 11:36:18 2013
Log: Fixing a huge flaw in dns_query_lib that. It will now check for
srv records, and correctly check txt records.
http://code.google.com/p/roster-dns-management/source/detail?r=1146

Modified:
/trunk/roster-config-manager/roster_config_manager/dns_query_lib.py

=======================================
--- /trunk/roster-config-manager/roster_config_manager/dns_query_lib.py Thu
Mar 7 12:12:04 2013
+++ /trunk/roster-config-manager/roster_config_manager/dns_query_lib.py Wed
Jul 10 11:36:18 2013
@@ -187,8 +187,15 @@
break

elif( record_type == u'txt' ):
- if( record_arguments[u'quoted_text'] == u'"%s"' % (
- answer.strings[0]) ):
+ quoted_text = unicode(' '.join(
+ ['"%s"' % answer_string for answer_string in answer.strings]))
+ if( record_arguments[u'quoted_text'] == quoted_text ):
+ good_records.append(record)
+ break
+ elif( record_type == u'srv' ):
+ if( record_arguments['weight'] == answer.weight and
+ record_arguments['priority'] == answer.priority and
+ record_arguments['assignment_host'] ==
unicode(answer.target) ):
good_records.append(record)
break

@@ -198,7 +205,7 @@
records.remove(record)

bad_records = records
-
+
#This is purely for asthetic reasons. If you were to print bad_records,
#you'd see a bunch of None's which doesn't help you. It just clutters
#the screen.
Reply all
Reply to author
Forward
0 new messages