Skip to content

Commit bc670b4

Browse files
author
Roland Hedberg
committed
Merge branch 'master' of github.com:rohe/pysaml2
2 parents 5518bd6 + 80f6969 commit bc670b4

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/saml2/metadata.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ def metadata_tostring_fix(desc, nspair, xmlstring=""):
7373
return xmlstring
7474

7575

76-
def create_metadata_string(configfile, config, valid, cert, keyfile, mid, name,
77-
sign):
76+
def create_metadata_string(configfile, config=None, valid=None, cert=None,
77+
keyfile=None, mid=None, name=None, sign=None):
7878
valid_for = 0
7979
nspair = {"xs": "http://www.w3.org/2001/XMLSchema"}
8080
#paths = [".", "/opt/local/bin"]
@@ -83,17 +83,15 @@ def create_metadata_string(configfile, config, valid, cert, keyfile, mid, name,
8383
valid_for = int(valid) # Hours
8484

8585
eds = []
86-
if config is not None:
87-
eds.append(entity_descriptor(config))
88-
else:
86+
if config is None:
8987
if configfile.endswith(".py"):
9088
configfile = configfile[:-3]
9189
config = Config().load_file(configfile, metadata_construction=True)
92-
eds.append(entity_descriptor(config))
90+
eds.append(entity_descriptor(config))
9391

9492
conf = Config()
95-
conf.key_file = keyfile
96-
conf.cert_file = cert
93+
conf.key_file = config.key_file or keyfile
94+
conf.cert_file = config.cert_file or cert
9795
conf.debug = 1
9896
conf.xmlsec_binary = config.xmlsec_binary
9997
secc = security_context(conf)

tools/make_metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,4 @@
8181

8282
valid_instance(eid)
8383
xmldoc = metadata_tostring_fix(eid, nspair, xmldoc)
84-
print(xmldoc)
84+
print(xmldoc.decode("utf-8"))

0 commit comments

Comments
 (0)