|
|
|
@ -13,6 +13,7 @@
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
|
# limitations under the License.
|
|
|
|
|
from __future__ import print_function
|
|
|
|
|
import os
|
|
|
|
|
import cl_base
|
|
|
|
|
import cl_utils
|
|
|
|
@ -30,7 +31,7 @@ class fillVars(object, cl_base.glob_attr):
|
|
|
|
|
res = self._runos(runStr)
|
|
|
|
|
if res:
|
|
|
|
|
return res.strip()
|
|
|
|
|
print "Error generate hash (slappasswd)"
|
|
|
|
|
print("Error generate hash (slappasswd)")
|
|
|
|
|
exit(1)
|
|
|
|
|
|
|
|
|
|
def get_cl_profile_path(self):
|
|
|
|
@ -230,7 +231,7 @@ class fillVars(object, cl_base.glob_attr):
|
|
|
|
|
for replServer in replServers:
|
|
|
|
|
if replServer:
|
|
|
|
|
md5hex = hashlib.md5(replServer).hexdigest()
|
|
|
|
|
data8bit = "".join(map(lambda x: str(int(x,16)/2),list(md5hex)))
|
|
|
|
|
data8bit = "".join((str(int(x,16)/2) for x in list(md5hex)))
|
|
|
|
|
dStart = 0
|
|
|
|
|
dEnd = 3
|
|
|
|
|
dMax = 32
|
|
|
|
@ -470,13 +471,13 @@ class fillVars(object, cl_base.glob_attr):
|
|
|
|
|
netAllow = self.Get("sr_proxy_net_allow")
|
|
|
|
|
if netAllow:
|
|
|
|
|
netAllow = netAllow.split(",")
|
|
|
|
|
netAllow = map(lambda x: "acl localnet src %s"%x,netAllow)
|
|
|
|
|
netAllow = ["acl localnet src %s" % x for x in netAllow]
|
|
|
|
|
netAllow = "\n".join(netAllow)
|
|
|
|
|
return netAllow
|
|
|
|
|
netAllow = self.Get("os_net_allow")
|
|
|
|
|
if netAllow:
|
|
|
|
|
netAllow = netAllow.split(",")
|
|
|
|
|
netAllow = map(lambda x: "acl localnet src %s"%x,netAllow)
|
|
|
|
|
netAllow = ["acl localnet src %s" % x for x in netAllow]
|
|
|
|
|
netAllow = "\n".join(netAllow)
|
|
|
|
|
return netAllow
|
|
|
|
|
return "acl localnet src 127.0.0.1/32"
|
|
|
|
@ -543,14 +544,14 @@ class fillVars(object, cl_base.glob_attr):
|
|
|
|
|
"""Текст в ejabberd.cfg - имена хостов с которыми работает сервис"""
|
|
|
|
|
jabberHosts = self.Get("sr_jabber_hosts")
|
|
|
|
|
if jabberHosts:
|
|
|
|
|
return ", ".join(map(lambda x: '"'+x+'"', jabberHosts.split(",")))
|
|
|
|
|
return ", ".join(('"'+x+'"' for x in jabberHosts.split(",")))
|
|
|
|
|
return ""
|
|
|
|
|
|
|
|
|
|
def get_sr_jabber_hosts_yml(self):
|
|
|
|
|
"""Текст в ejabberd.cfg - имена хостов с которыми работает сервис"""
|
|
|
|
|
jabberHosts = self.Get("sr_jabber_hosts")
|
|
|
|
|
if jabberHosts:
|
|
|
|
|
return "\n".join(map(lambda x: ' - "%s"' % x, jabberHosts.split(",")))
|
|
|
|
|
return "\n".join((' - "%s"' % x for x in jabberHosts.split(",")))
|
|
|
|
|
return ""
|
|
|
|
|
|
|
|
|
|
def get_sr_jabber_user_name(self):
|
|
|
|
@ -591,7 +592,7 @@ class fillVars(object, cl_base.glob_attr):
|
|
|
|
|
break
|
|
|
|
|
if not foundLoc:
|
|
|
|
|
netAllow.append("127.0.0.1")
|
|
|
|
|
netAllow = map(lambda x: "%s;"%x,netAllow)
|
|
|
|
|
netAllow = ["%s;" % x for x in netAllow]
|
|
|
|
|
netAllow = " ".join(netAllow)
|
|
|
|
|
return "listen-on { %s };"%netAllow
|
|
|
|
|
netAllow = self.Get("sr_dns_net_allow")
|
|
|
|
|