diff options
-rwxr-xr-x | osdfapp.py | 11 | ||||
-rw-r--r-- | pom.xml | 2 |
2 files changed, 6 insertions, 7 deletions
@@ -31,7 +31,6 @@ import json import osdf.adapters.policy.interface import osdf.config.credentials import osdf.config.loader -# import osdf.datasources.aai.aai_local_cached_data import osdf.operation.error_handling import osdf.operation.responses import traceback @@ -131,17 +130,16 @@ def internal_failure(error): def getOptions(argv): program_version_string = '%%prog %s' % ("v1.0") - #program_usage = '''usage: spam two eggs''' # optional - will be autogenerated by optparse program_longdesc = "" program_license = "" - # setup option parser parser = OptionParser(version=program_version_string, epilog=program_longdesc, description=program_license) parser.add_option("-l", "--local", dest="local", help="run locally", action="store_true", default=False) parser.add_option("-t", "--devtest", dest="devtest", help="run in dev/test environment", action="store_true", default=False) parser.add_option("-d", "--debughost", dest="debughost", help="IP Address of host running debug server", default='') parser.add_option("-p", "--debugport", dest="debugport", help="Port number of debug server", type=int, default=5678) (opts, args) = parser.parse_args(argv) + if (opts.debughost != ''): print('pydevd.settrace(%s, port=%s)' % (opts.debughost, opts.debugport)) pydevd.settrace(opts.debughost, port=opts.debugport) @@ -154,12 +152,13 @@ if __name__ == "__main__": ports = sys_conf['osdf_ports'] internal_port, external_port = ports['internal'], ports['external'] ssl_context = tuple(sys_conf['ssl_context']) + local_host = "0.0.0.0" - common_app_opts = dict(host='0.0.0.0', threaded=True, use_reloader=False) + common_app_opts = dict(host=local_host, threaded=True, use_reloader=False) opts = getOptions(sys.argv) - if (opts.local == False and opts.devtest == False): # normal deployment + if (not opts.local and not opts.devtest): # normal deployment app.run(port=internal_port, ssl_context=ssl_context, debug=False, **common_app_opts) else: - port = internal_port if opts.local == True else external_port + port = internal_port if opts.local else external_port app.run(port=port, debug=True, **common_app_opts) @@ -39,7 +39,7 @@ <sonar.python.coverage.reportPath>coverage.xml</sonar.python.coverage.reportPath> <sonar.language>py</sonar.language> <sonar.pluginname>python</sonar.pluginname> - <sonar.inclusions>**/**.py</sonar.inclusions> + <sonar.inclusions>**/**.py,osdfapp.py</sonar.inclusions> <sonar.exclusions>test/**.py</sonar.exclusions> </properties> |