Changeset 2010
- Timestamp:
- Jun 24, 2016, 2:53:44 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
n4d-dnsmasq/trunk/fuentes/install-dnsmasq/usr/share/n4d/python-plugins/DnsmasqManager.py
r2007 r2010 101 101 shutil.copy(tmp_path,f) 102 102 103 #FIX for centralized services in Xenial 104 version=objects["ServerBackupManager"].restoring_version 105 majorBackupVersion=int(version[0:version.find('.')]) 103 106 for d in self.backup_dirs: 104 107 tmp_path=tmp_dir+d 105 108 if os.path.exists(tmp_path): 106 109 self.makedir(d) 107 #FIX for centralized services in Xenial 108 version=objects["ServerBackupManager"].restoring_version 109 majorBackupVersion=int(version[0:version.find('.')]) 110 if majorBackupVersion<=15: 110 if d == self.dynamicconfpath and majorBackupVersion<=15: 111 111 #Read tmpdir and exclude centralized services 112 112 centralizedServices=objects["VariablesManager"].get_variable('SLAVE_BLACKLIST') 113 listServices=list(centralizedServices.values()) 114 for cnameFile in os.listdir(tmp_path): 115 for service in listServices: 113 configTmpDir=tmp_path+"config" 114 configDir=d+"config" 115 for cnameFile in os.listdir(configDir): 116 for service in list(centralizedServices.values()): 116 117 serviceStr=str(service) 117 118 if cnameFile in serviceStr: 118 self.restore_as_centralized(cnameFile, d,tmp_path)119 self.restore_as_centralized(cnameFile,configDir,configTmpDir) 119 120 cmd="cp -r " + tmp_path +"/* " + d 120 121 os.system(cmd) … … 132 133 133 134 def restore_as_centralized (self,cnameFile=None,dest_dir=None,tmp_path=None): 134 cnameRealPath=d + '/' + cnameFile135 cnameRealPath=dest_dir + '/' + cnameFile 135 136 if os.path.isfile(cnameRealPath): 136 cmd="cp " + cnameRealPath + " tmp_path"137 cmd="cp " + cnameRealPath + " " + tmp_path 137 138 os.system(cmd) 138 139 elif objects["VariablesManager"].get_variable("MASTER_SERVER_IP"):
Note: See TracChangeset
for help on using the changeset viewer.