Changeset 2007
- Timestamp:
- Jun 24, 2016, 12:30:30 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
n4d-dnsmasq/trunk/fuentes/install-dnsmasq/usr/share/n4d/python-plugins/DnsmasqManager.py
r1987 r2007 104 104 tmp_path=tmp_dir+d 105 105 if os.path.exists(tmp_path): 106 self.makedir(d) 106 107 #FIX for centralized services in Xenial 107 108 version=objects["ServerBackupManager"].restoring_version 108 109 majorBackupVersion=int(version[0:version.find('.')]) 109 if majorBackupVersion<=15 and objects['VariablesManager'].getvalues('MASTER_SERVER_IP'):110 if majorBackupVersion<=15: 110 111 #Read tmpdir and exclude centralized services 111 centralizedServices = objects['VariablesManager'].getvalues('SLAVE_BLACKLIST') 112 for cnameFile in listdir(tmp_path): 113 if cnameFile in centralizedServices.values(): 114 restore_as_centralized(cnameFile,d,tmp_path) 115 self.makedir(d) 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: 116 serviceStr=str(service) 117 if cnameFile in serviceStr: 118 self.restore_as_centralized(cnameFile,d,tmp_path) 116 119 cmd="cp -r " + tmp_path +"/* " + d 117 120 os.system(cmd) … … 128 131 return [False,str(e)] 129 132 130 def restore_as_centralized (self,cnameFile ,backup_dir,tmp_path):131 cnameRealPath= backup_dir+ '/' + cnameFile133 def restore_as_centralized (self,cnameFile=None,dest_dir=None,tmp_path=None): 134 cnameRealPath=d + '/' + cnameFile 132 135 if os.path.isfile(cnameRealPath): 133 136 cmd="cp " + cnameRealPath + " tmp_path" 134 137 os.system(cmd) 135 el se:138 elif objects["VariablesManager"].get_variable("MASTER_SERVER_IP"): 136 139 os.remove(cnameFile) 137 140
Note: See TracChangeset
for help on using the changeset viewer.