Revision: 1158
Author:
J.S.P...@gmail.com
Date: Thu Aug 8 09:36:06 2013
Log: Update to r1157. Fixing a bug that would not tar a view if it did
not have any zones in the view. (e..g a single slave zone)
http://code.google.com/p/roster-dns-management/source/detail?r=1158
Modified:
/trunk/roster-config-manager/roster_config_manager/config_lib.py
/trunk/test/config_lib_test.py
=======================================
--- /trunk/roster-config-manager/roster_config_manager/config_lib.py Thu
Aug 8 03:27:50 2013
+++ /trunk/roster-config-manager/roster_config_manager/config_lib.py Thu
Aug 8 09:36:06 2013
@@ -600,9 +600,9 @@
raise ExporterListFileError('Can not list files in %s/%s/%s.' %
(self.root_config_dir, dns_server, server_file))
for view in named_files:
+ self.__AddToTarFile__('%s/%s' % (server_file, view),
+ '%s/%s' % (self.root_config_dir, dns_server), dns_tar_file)
if( view == '
named.ca' ):
- self.__AddToTarFile__('%s/%s' % (server_file, view),
- '%s/%s' % (self.root_config_dir, dns_server),
dns_tar_file)
continue
try:
view_files = os.listdir('%s/%s/%s/%s' %
(self.root_config_dir,
=======================================
--- /trunk/test/config_lib_test.py Thu Aug 8 03:27:50 2013
+++ /trunk/test/config_lib_test.py Thu Aug 8 09:36:06 2013
@@ -137,9 +137,24 @@
tree_exporter_instance.ExportAllBindTrees()
config_lib_instance = config_lib.ConfigLib(CONFIG_FILE)
config_lib_instance.UnTarDnsTree()
+ #Make sure we exported the empty 'external' folder
self.assertTrue(os.path.exists(os.path.join(self.root_config_dir,
'server1/named/external')))
+ config_lib_instance.TarDnsBindFiles(u'server1')
+
+ try:
+ untarred_path =
os.path.join(self.root_config_dir, 'server1_untarred')
+ tar_file = tarfile.open(
+ os.path.join(self.root_config_dir, 'server1', 'server1.tar.bz2'),
+ 'r:bz2')
+ tar_file.extractall(path=untarred_path)
+ #Make sure we tarred the empty 'external' folder
+ self.assertTrue(os.path.exists(os.path.join(untarred_path,
+ 'named/external')))
+ finally:
+ tar_file.close()
+
def testFindDnsTreeFilename(self):
config_lib_instance = config_lib.ConfigLib(CONFIG_FILE)
tree_exporter_instance = tree_exporter.BindTreeExport(CONFIG_FILE)