aboutsummaryrefslogtreecommitdiffstats
path: root/osdf
diff options
context:
space:
mode:
Diffstat (limited to 'osdf')
-rw-r--r--osdf/utils/mdc_utils.py2
-rw-r--r--osdf/webapp/appcontroller.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/osdf/utils/mdc_utils.py b/osdf/utils/mdc_utils.py
index b98cbf0..bcd0615 100644
--- a/osdf/utils/mdc_utils.py
+++ b/osdf/utils/mdc_utils.py
@@ -36,7 +36,7 @@ def default_server_info():
MDC.put('server', server)
if MDC.get('serverIPAddress') is None:
try:
- server_ip_address = socket.gethostbyname(self._fields['server'])
+ server_ip_address = socket.gethostbyname(MDC.get('server'))
except Exception:
server_ip_address = ""
MDC.put('serverIPAddress', server_ip_address)
diff --git a/osdf/webapp/appcontroller.py b/osdf/webapp/appcontroller.py
index 9714fb5..e48e93f 100644
--- a/osdf/webapp/appcontroller.py
+++ b/osdf/webapp/appcontroller.py
@@ -35,6 +35,7 @@ error_body = {
unauthorized_message = json.dumps(error_body)
+
@auth_basic.get_password
def get_pw(username):
end_point = request.url.split('/')[-1]
@@ -42,6 +43,7 @@ def get_pw(username):
return cfg_base.http_basic_auth_credentials[auth_group].get(
username) if auth_group else None
+
@auth_basic.error_handler
def auth_error():
response = Response(unauthorized_message, content_type='application/json; charset=utf-8')
@@ -58,4 +60,3 @@ def verify_pw(username, password):
else:
pw = get_pw(username)
return pw == password
- return False \ No newline at end of file