[roster-dns-management] r1156 committed - Fixing error where dnsconfigsync would strip letters off of zone name ...

0 views
Skip to first unread message

roster-dns...@googlecode.com

unread,
Aug 2, 2013, 1:46:47 PM8/2/13
to roster-...@googlegroups.com
Revision: 1156
Author: cook...@gmail.com
Date: Fri Aug 2 10:46:36 2013
Log: Fixing error where dnsconfigsync would strip letters off of zone
name when compiling on dns server.

http://code.google.com/p/roster-dns-management/source/detail?r=1156

Modified:
/trunk/roster-config-manager/scripts/dnsconfigsync
/trunk/test/dnsconfigsync_test.py

=======================================
--- /trunk/roster-config-manager/scripts/dnsconfigsync Fri Jul 19 13:56:34
2013
+++ /trunk/roster-config-manager/scripts/dnsconfigsync Fri Aug 2 10:46:36
2013
@@ -262,7 +262,7 @@

#Making sure self.bind_dir exists
result = fabric_api.run('file %s' % self.bind_dir)
- if( result.stdout == "%s: cannot open `%s' (No such file or
directory)" % (
+ if( result.stdout == "%s: ERROR: cannot open `%s' (No such file or
directory)" % (
self.bind_dir, self.bind_dir) ):
raise config_lib.ServerCheckError(
'BIND directory %s does not exist on server %s' % (self.bind_dir,
@@ -414,7 +414,9 @@
'check.' % zone_origin)

if( self.compilezone ):
- zone_binary_file_name = '%s.aa' % zone_file_name.rstrip('.db')
+ zone_binary_file_name = '%s.aa' % zone_file_name
+ if( zone_file_name.endswith('.db') ):
+ zone_binary_file_name = '%s.aa' % zone_file_name[:-3]
result = fabric_api.run('named-compilezone -F raw %s
-o %s %s %s' % (
zone_tool_arguments, zone_binary_file_name, zone_origin,
zone_file_name))
=======================================
--- /trunk/test/dnsconfigsync_test.py Fri Jul 19 13:56:34 2013
+++ /trunk/test/dnsconfigsync_test.py Fri Aug 2 10:46:36 2013
@@ -396,5 +396,31 @@
self.assertTrue(os.path.exists('%s/named/named.ca' % BINDDIR))
self.assertTrue(os.path.exists('%s/named/named.conf' % BINDDIR))

+ # Tests that zones with name ending with 'd' or 'b' are not improperly
named
+ self.core_instance.MakeZone(u'zoned', u'master', u'zoned.lcl.',
view_name=u'test_view')
+ output = os.popen('python %s -f test_data/test_zone.db '
+ '--view test_view -u %s --config-file %s '
+ '-z zoned' % (
+ ZONE_IMPORTER_EXEC, USERNAME, CONFIG_FILE))
+ self.assertEqual(output.read(),
+ 'Loading in test_data/test_zone.db\n'
+ '17 records loaded from zone test_data/test_zone.db\n'
+ '17 total records added\n')
+ output.close()
+
+ self.tree_exporter_instance.ExportAllBindTrees()
+ self.audit_id += 3
+ self.config_lib_instance.UnTarDnsTree(self.audit_id)
+ self.config_lib_instance.WriteDnsServerInfo(dns_server_info)
+ self.config_lib_instance.TarDnsTree(self.audit_id)
+
+ command = os.popen(self.command_string)
+ lines = command.read().split('\n')
+ command.close()
+ self.assertEqual(lines, [''])
+ zone_files = os.listdir('%s/named/test_view/' % BINDDIR.rstrip('/'))
+ self.assertTrue('zone.aa' not in zone_files)
+ self.assertTrue('zoned.aa' in zone_files)
+
if( __name__ == '__main__' ):
unittest.main()
Reply all
Reply to author
Forward
0 new messages