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
f5677709
Commit
f5677709
authored
9 years ago
by
sveseli
Browse files
Options
Downloads
Patches
Plain Diff
fixed env variable issue for protocol
parent
fd6748d2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/python/dm/common/cli/dmRestCli.py
+4
-0
4 additions, 0 deletions
src/python/dm/common/cli/dmRestCli.py
src/python/dm/common/utility/configurationManager.py
+15
-0
15 additions, 0 deletions
src/python/dm/common/utility/configurationManager.py
with
19 additions
and
0 deletions
src/python/dm/common/cli/dmRestCli.py
+
4
−
0
View file @
f5677709
#!/usr/bin/env python
from
dm.common.cli.dmCli
import
DmCli
from
dm.common.utility.configurationManager
import
ConfigurationManager
class
DmRestCli
(
DmCli
):
"""
Base dm REST cli class.
"""
...
...
@@ -8,3 +9,6 @@ class DmRestCli(DmCli):
def
__init__
(
self
,
validArgCount
=
0
):
DmCli
.
__init__
(
self
,
validArgCount
)
def
getDefaultServiceProtocol
(
self
):
return
ConfigurationManager
.
getInstance
().
getWebServiceProtocol
()
This diff is collapsed.
Click to expand it.
src/python/dm/common/utility/configurationManager.py
+
15
−
0
View file @
f5677709
...
...
@@ -40,6 +40,7 @@ DEFAULT_DM_SERVICE_PORT = 22236 # 222DM
DEFAULT_DM_SERVICE_HOST
=
'
0.0.0.0
'
DEFAULT_DM_SERVICE_PROTOCOL
=
dmServiceConstants
.
DM_SERVICE_PROTOCOL_HTTP
DEFAULT_DM_WEB_SERVICE_PROTOCOL
=
DEFAULT_DM_SERVICE_PROTOCOL
DEFAULT_DM_DS_WEB_SERVICE_PORT
=
22236
# 222DM
DEFAULT_DM_DS_WEB_SERVICE_HOST
=
'
127.0.0.1
'
DEFAULT_DM_DAQ_WEB_SERVICE_PORT
=
33336
# 333DM
...
...
@@ -125,6 +126,7 @@ class ConfigurationManager(UserDict.UserDict):
self
[
'
defaultServiceHost
'
]
=
DEFAULT_DM_SERVICE_HOST
self
[
'
defaultServiceProtocol
'
]
=
DEFAULT_DM_SERVICE_PROTOCOL
self
[
'
defaultWebServiceProtocol
'
]
=
DEFAULT_DM_WEB_SERVICE_PROTOCOL
self
[
'
defaultDaqWebServicePort
'
]
=
DEFAULT_DM_DAQ_WEB_SERVICE_PORT
self
[
'
defaultDaqWebServiceHost
'
]
=
DEFAULT_DM_DAQ_WEB_SERVICE_HOST
self
[
'
defaultDsWebServicePort
'
]
=
DEFAULT_DM_DS_WEB_SERVICE_PORT
...
...
@@ -158,6 +160,7 @@ class ConfigurationManager(UserDict.UserDict):
self
.
__setFromEnvVar
(
'
servicePort
'
,
'
DM_SERVICE_PORT
'
)
self
.
__setFromEnvVar
(
'
serviceProtocol
'
,
'
DM_SERVICE_PROTOCOL
'
)
self
.
__setFromEnvVar
(
'
webServiceProtocol
'
,
'
DM_WEB_SERVICE_PROTOCOL
'
)
self
.
__setFromEnvVar
(
'
daqWebServiceHost
'
,
'
DM_DAQ_WEB_SERVICE_HOST
'
)
self
.
__setFromEnvVar
(
'
daqWebServicePort
'
,
'
DM_DAQ_WEB_SERVICE_PORT
'
)
self
.
__setFromEnvVar
(
'
dsWebServiceHost
'
,
'
DM_DS_WEB_SERVICE_HOST
'
)
...
...
@@ -513,6 +516,18 @@ class ConfigurationManager(UserDict.UserDict):
def
hasServiceHost
(
self
):
return
self
.
has_key
(
'
serviceHost
'
)
def
getDefaultWebServiceProtocol
(
self
):
return
self
[
'
defaultWebServiceProtocol
'
]
def
setWebServiceProtocol
(
self
,
webServiceProtocol
):
self
[
'
webServiceProtocol
'
]
=
webServiceProtocol
def
getWebServiceProtocol
(
self
,
default
=
'
__dm_default__
'
):
return
self
.
__getKeyValue
(
'
webServiceProtocol
'
,
default
)
def
hasWebServiceProtocol
(
self
):
return
self
.
has_key
(
'
webServiceProtocol
'
)
def
getDefaultDaqWebServicePort
(
self
):
return
self
[
'
defaultDaqWebServicePort
'
]
...
...
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