Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dm-docs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hammonds
dm-docs
Commits
c2ea1622
Commit
c2ea1622
authored
9 years ago
by
sveseli
Browse files
Options
Downloads
Patches
Plain Diff
fixed issue with invalid session after restart
parent
111ad734
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/python/dm/common/client/sessionManager.py
+8
-2
8 additions, 2 deletions
src/python/dm/common/client/sessionManager.py
with
8 additions
and
2 deletions
src/python/dm/common/client/sessionManager.py
+
8
−
2
View file @
c2ea1622
...
@@ -13,6 +13,7 @@ import types
...
@@ -13,6 +13,7 @@ import types
from
dm.common.constants
import
dmServiceConstants
from
dm.common.constants
import
dmServiceConstants
from
dm.common.exceptions.configurationError
import
ConfigurationError
from
dm.common.exceptions.configurationError
import
ConfigurationError
from
dm.common.exceptions.authorizationError
import
AuthorizationError
from
dm.common.exceptions.authorizationError
import
AuthorizationError
from
dm.common.exceptions.invalidSession
import
InvalidSession
from
dm.common.exceptions.urlError
import
UrlError
from
dm.common.exceptions.urlError
import
UrlError
from
dm.common.utility.loggingManager
import
LoggingManager
from
dm.common.utility.loggingManager
import
LoggingManager
from
dm.common.utility.configurationManager
import
ConfigurationManager
from
dm.common.utility.configurationManager
import
ConfigurationManager
...
@@ -196,7 +197,12 @@ class SessionManager:
...
@@ -196,7 +197,12 @@ class SessionManager:
"""
Send session request.
"""
"""
Send session request.
"""
if
self
.
sessionCookie
is
None
:
if
self
.
sessionCookie
is
None
:
self
.
establishSession
(
self
.
host
,
self
.
username
,
self
.
password
)
self
.
establishSession
(
self
.
host
,
self
.
username
,
self
.
password
)
return
self
.
sendRequest
(
url
,
method
,
contentType
,
data
)
try
:
return
self
.
sendRequest
(
url
,
method
,
contentType
,
data
)
except
InvalidSession
,
ex
:
self
.
clearSessionFile
()
self
.
establishSession
(
self
.
host
,
self
.
username
,
self
.
password
)
return
self
.
sendRequest
(
url
,
method
,
contentType
,
data
)
def
checkResponseHeadersForErrorsAndSaveSession
(
self
,
responseHeaders
):
def
checkResponseHeadersForErrorsAndSaveSession
(
self
,
responseHeaders
):
try
:
try
:
...
@@ -204,7 +210,7 @@ class SessionManager:
...
@@ -204,7 +210,7 @@ class SessionManager:
sessionCookie
=
responseHeaders
.
get
(
'
Set-Cookie
'
)
sessionCookie
=
responseHeaders
.
get
(
'
Set-Cookie
'
)
self
.
saveSession
(
sessionCookie
)
self
.
saveSession
(
sessionCookie
)
return
sessionCookie
return
sessionCookie
except
AuthorizationError
,
ex
:
except
(
AuthorizationError
,
InvalidSession
),
ex
:
self
.
clearSessionFile
()
self
.
clearSessionFile
()
raise
raise
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment