Changeset 1905 for n4d-proxy/trunk/fuentes/install.n4d-proxy/usr/share/n4d/python-plugins/ProxyManager.py
- Timestamp:
- Jun 14, 2016, 1:45:42 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
n4d-proxy/trunk/fuentes/install.n4d-proxy/usr/share/n4d/python-plugins/ProxyManager.py
r1148 r1905 88 88 89 89 return [False,"Backup file not found"] 90 90 91 91 if os.path.exists(file_path): 92 92 … … 96 96 tar.close() 97 97 98 #FIX squid dir from backups <= 15.05 99 version=objects["ServerBackupManager"].restoring_version 100 majorBackupVersion=int(version[0:version.find('.')]) 98 101 for f in self.proxy_file_list: 99 tmp_path=tmp_dir+f 102 auxFile=f 103 if auxFile == "/etc/squid/squid.conf" : 104 if majorBackupVersion<=15: 105 auxFile='/etc/squid3/squid.conf' 106 107 # tmp_path=tmp_dir+f 108 tmp_path=tmp_dir+auxFile 100 109 shutil.copy(tmp_path,f) 101 110 102 103 111 for d in self.proxy_dirs: 104 tmp_path=tmp_dir+d 112 auxDir=d 113 if auxDir == "/etc/squid/lliurex/" : 114 if majorBackupVersion<=15: 115 auxDir='/etc/squid3/lliurex/' 116 117 # tmp_path=tmp_dir+d 118 tmp_path=tmp_dir+auxDir 105 119 if os.path.exists(tmp_path): 106 120 cmd="cp -r " + tmp_path +"/* " + d … … 108 122 os.makedirs(d) 109 123 os.system(cmd) 110 111 112 124 113 125 try: 114 if objects["ServerBackupManager"].restoring_version=="14.06": 115 126 if majorBackupVersion<=15 : 127 128 # if objects["ServerBackupManager"].restoring_version=="14.06": 129 116 130 print("[ProxyManager] Fixing squid.conf ...") 117 131 … … 123 137 for line in lines: 124 138 if "acl manager proto cache_object" not in line: 125 139 #FIX squid dir from backups <= 15.05 140 line=line.replace ("squid3","squid") 141 if "dns_nameservers" in line: 142 line="dns_nameservers 127.0.0.1\n" 143 126 144 f.write(line) 127 145
Note: See TracChangeset
for help on using the changeset viewer.