Fix sonarcloud coverage reports issue 45/101745/1
authorvrvarma <vv8305@att.com>
Fri, 14 Feb 2020 14:41:35 +0000 (09:41 -0500)
committervrvarma <vv8305@att.com>
Fri, 14 Feb 2020 14:41:45 +0000 (09:41 -0500)
Change-Id: Ieaf2aac8ed425bdf547f6893262a3285470519d4
Signed-off-by: vrvarma <vv8305@att.com>
Issue-ID: OPTFRA-698

osdf/utils/mdc_utils.py
osdf/webapp/appcontroller.py
pom.xml

index b98cbf0..bcd0615 100644 (file)
@@ -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)
index 9714fb5..e48e93f 100644 (file)
@@ -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
diff --git a/pom.xml b/pom.xml
index 895147d..61c47c3 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -34,7 +34,7 @@
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <sonar.sources>.</sonar.sources>
         <sonar.junit.reportsPath>xunit-results.xml</sonar.junit.reportsPath>
-        <sonar.python.coverage.reportPath>coverage.xml</sonar.python.coverage.reportPath>
+        <sonar.python.coverage.reportPaths>coverage.xml</sonar.python.coverage.reportPaths>
         <sonar.language>py</sonar.language>
         <sonar.pluginname>python</sonar.pluginname>
         <sonar.inclusions>**/**.py,osdfapp.py</sonar.inclusions>