summaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorQian Lei <qianlei90@gmail.com>2017-03-16 12:38:27 +0800
committerQian Lei <qianlei90@gmail.com>2017-03-16 12:38:27 +0800
commitefc27f156c146727e8e4de391b242174e6afcd8f (patch)
tree36c284330f17fc034247584e726e0674aa0cb023 /example
parenta0c510af7aa620a4c500d538bed44995084f389f (diff)
downloadpysaml2-efc27f156c146727e8e4de391b242174e6afcd8f.tar.gz
fix(example): using a default value to -p parameter in idp service
No configuration file is specified when we start idp service without -p parameter and the value of args.path will be None in function metadata and staticfile, which can not be used in list comprehension and startwith function. Signed-off-by: Qian Lei <qianlei90@gmail.com>
Diffstat (limited to 'example')
-rwxr-xr-xexample/idp2/idp.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/example/idp2/idp.py b/example/idp2/idp.py
index 41059b15..c54b7d8f 100755
--- a/example/idp2/idp.py
+++ b/example/idp2/idp.py
@@ -937,7 +937,7 @@ NON_AUTHN_URLS = [
def metadata(environ, start_response):
try:
- path = args.path
+ path = args.path[:]
if path is None or len(path) == 0:
path = os.path.dirname(os.path.abspath(__file__))
if path[-1] != "/":
@@ -1037,7 +1037,7 @@ def application(environ, start_response):
if __name__ == '__main__':
parser = argparse.ArgumentParser()
- parser.add_argument('-p', dest='path', help='Path to configuration file.')
+ parser.add_argument('-p', dest='path', help='Path to configuration file.', default='./idp_conf.py')
parser.add_argument('-v', dest='valid',
help="How long, in days, the metadata is valid from "
"the time of creation")