fix for ipsec service reading file as bytes
This commit is contained in:
parent
c3224251b7
commit
3a45e9ec7a
1 changed files with 2 additions and 3 deletions
|
@ -84,12 +84,11 @@ class IPsec(CoreService):
|
||||||
cfg += "# set up static tunnel mode security assocation for service "
|
cfg += "# set up static tunnel mode security assocation for service "
|
||||||
cfg += "(security.py)\n"
|
cfg += "(security.py)\n"
|
||||||
fname = "%s/examples/services/sampleIPsec" % constants.CORE_DATA_DIR
|
fname = "%s/examples/services/sampleIPsec" % constants.CORE_DATA_DIR
|
||||||
|
|
||||||
try:
|
try:
|
||||||
cfg += open(fname, "rb").read()
|
with open(fname, "r") as f:
|
||||||
|
cfg += f.read()
|
||||||
except IOError:
|
except IOError:
|
||||||
logging.exception("Error opening IPsec configuration template (%s)", fname)
|
logging.exception("Error opening IPsec configuration template (%s)", fname)
|
||||||
|
|
||||||
return cfg
|
return cfg
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue