summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Hedberg <roland.hedberg@adm.umu.se>2014-09-01 22:14:54 +0200
committerRoland Hedberg <roland.hedberg@adm.umu.se>2014-09-01 22:14:54 +0200
commit8c27f69b60349ba53a6b5367d62aeec20840f664 (patch)
tree21536ccb3126646158374414e0c1527fd38aa9cf
parent801427ada40323b38bf183554b2c4defd53c480a (diff)
downloadpysaml2-8c27f69b60349ba53a6b5367d62aeec20840f664.tar.gz
Endpoint index when given must be an integer but stored as a character.
-rw-r--r--src/saml2/metadata.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/saml2/metadata.py b/src/saml2/metadata.py
index 3491bef5..8d81f371 100644
--- a/src/saml2/metadata.py
+++ b/src/saml2/metadata.py
@@ -423,9 +423,18 @@ def do_endpoints(conf, endpoints):
args = {"location": args[0], "binding": args[1],
"index": args[2]}
- if indexed and "index" not in args:
- args["index"] = "%d" % i
- i += 1
+ if indexed:
+ if "index" not in args:
+ args["index"] = "%d" % i
+ i += 1
+ else:
+ try:
+ int(args["index"])
+ except ValueError:
+ raise
+ else:
+ args["index"] = str(args["index"])
+
servs.append(factory(eclass, **args))
service[endpoint] = servs
except KeyError: