diff options
author | Simo Sorce <simo@redhat.com> | 2014-04-18 00:16:12 -0400 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2014-04-21 00:05:05 -0400 |
commit | 47ff8363b7961188084f05c55558a166b06decb4 (patch) | |
tree | 64b9f5b443b1a4182f17ca346a87b819cc3ae69e /ipsilon/install/ipsilon-client-install | |
parent | a20178b055e783b4146925596e815a05d82b0ac6 (diff) | |
download | ipsilon-47ff8363b7961188084f05c55558a166b06decb4.tar.gz ipsilon-47ff8363b7961188084f05c55558a166b06decb4.tar.xz ipsilon-47ff8363b7961188084f05c55558a166b06decb4.zip |
Move templatized file creation to tools
Signed-off-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'ipsilon/install/ipsilon-client-install')
-rwxr-xr-x | ipsilon/install/ipsilon-client-install | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/ipsilon/install/ipsilon-client-install b/ipsilon/install/ipsilon-client-install index f49e351..b9cc4b6 100755 --- a/ipsilon/install/ipsilon-client-install +++ b/ipsilon/install/ipsilon-client-install @@ -21,7 +21,7 @@ from ipsilon.tools.saml2metadata import Metadata from ipsilon.tools.saml2metadata import SAML2_NAMEID_MAP from ipsilon.tools.saml2metadata import SAML2_SERVICE_MAP from ipsilon.tools.certs import Certificate -from string import Template +from ipsilon.tools import files import argparse import logging import os @@ -118,20 +118,15 @@ def saml2(): # default location, enable the default page psp = '' - with open(SAML2_TEMPLATE) as f: - template = f.read() - t = Template(template) - hunk = t.substitute(saml_base=args['saml_base'], - saml_protect=saml_protect, - saml_sp_key=c.key, - saml_sp_cert=c.cert, - saml_sp_meta=sp_metafile, - saml_idp_meta=idp_metafile, - saml_sp=args['saml_sp'], - saml_auth=saml_auth, sp=psp) - - with open(SAML2_CONFFILE, 'w+') as f: - f.write(hunk) + samlopts = {'saml_base': args['saml_base'], + 'saml_protect': saml_protect, + 'saml_sp_key': c.key, + 'saml_sp_cert': c.cert, + 'saml_sp_meta': sp_metafile, + 'saml_idp_meta': idp_metafile, + 'saml_sp': args['saml_sp'], + 'saml_auth': saml_auth, sp=psp} + files.write_from_template(SAML2_CONFFILE, SAML2_TEMPLATE, samlopts) files.fix_user_dirs(SAML2_HTTPDIR, args['httpd_user']) |