Skip to content
Snippets Groups Projects
Commit 36f6514a authored by sveseli's avatar sveseli
Browse files

remove generic username/password from base rest api class

parent 15ae97a1
No related branches found
No related tags found
No related merge requests found
...@@ -15,13 +15,6 @@ class DmRestApi(DmApi): ...@@ -15,13 +15,6 @@ class DmRestApi(DmApi):
def __init__(self, username=None, password=None, host=None, port=None, protocol=None): def __init__(self, username=None, password=None, host=None, port=None, protocol=None):
DmApi.__init__(self) DmApi.__init__(self)
self.configurationManager = ConfigurationManager.getInstance() self.configurationManager = ConfigurationManager.getInstance()
if username == None and password == None:
username = self.configurationManager.getServiceUsername()
password = self.configurationManager.getServicePassword()
if host == None:
host = self.configurationManager.getServiceHost()
if port == None:
port = self.configurationManager.getServicePort()
if protocol == None: if protocol == None:
protocol = self.configurationManager.getServiceProtocol() protocol = self.configurationManager.getServiceProtocol()
self.username = username self.username = username
...@@ -94,10 +87,10 @@ class DmRestApi(DmApi): ...@@ -94,10 +87,10 @@ class DmRestApi(DmApi):
""" Send authorized session request. """ """ Send authorized session request. """
sm = self.getSessionManager() sm = self.getSessionManager()
if not sm.hasSession(): if not sm.hasSession():
if self.username == None: #if self.username == None:
raise AuthorizationError('Username not supplied.') # raise AuthorizationError('Username not supplied.')
if self.password == None: #if self.password == None:
raise AuthorizationError('Password not supplied.') # raise AuthorizationError('Password not supplied.')
wsUrl = self.__getWebServiceUrl(url) wsUrl = self.__getWebServiceUrl(url)
# establishSession() sets the 'wsUrl' so the explicit call # establishSession() sets the 'wsUrl' so the explicit call
# to setHost() is not required # to setHost() is not required
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment