Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chenhao Ma
core
Commits
c6ab1614
Commit
c6ab1614
authored
11 years ago
by
Kevin S. Hahn
Browse files
Options
Downloads
Patches
Plain Diff
minor style and readability corrections
parent
e613dbc2
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
internimsclient.py
+4
-4
4 additions, 4 deletions
internimsclient.py
nimsapi.py
+1
-2
1 addition, 2 deletions
nimsapi.py
with
5 additions
and
6 deletions
internimsclient.py
+
4
−
4
View file @
c6ab1614
...
...
@@ -4,7 +4,6 @@
import
json
import
base64
import
pymongo
import
datetime
import
requests
import
Crypto.Hash.SHA
...
...
@@ -13,12 +12,14 @@ import Crypto.Signature.PKCS1_v1_5
import
logging
import
logging.config
log
=
logging
.
getLogger
(
'
nims
api
'
)
log
=
logging
.
getLogger
(
'
inter
nims
'
)
logging
.
getLogger
(
'
requests
'
).
setLevel
(
logging
.
WARNING
)
def
update
(
db
,
api_uri
,
site_id
,
privkey
,
internims_url
):
"""
sends is-alive signal to internims central.
"""
db
.
remotes
.
ensure_index
(
'
UTC
'
,
expireAfterSeconds
=
120
)
exp_userlist
=
[
exp
[
'
permissions
'
].
viewkeys
()
for
exp
in
db
.
experiments
.
find
({},
{
'
_id
'
:
False
,
'
permissions
'
:
True
})]
col_userlist
=
[
col
[
'
permissions
'
].
viewkeys
()
for
col
in
db
.
collections
.
find
({},
{
'
_id
'
:
False
,
'
permissions
'
:
True
})]
userlists
=
exp_userlist
+
col_userlist
...
...
@@ -55,6 +56,7 @@ if __name__ == '__main__':
import
os
import
sys
import
time
import
pymongo
import
argparse
import
ConfigParser
...
...
@@ -70,9 +72,7 @@ if __name__ == '__main__':
config
=
ConfigParser
.
ConfigParser
({
'
here
'
:
os
.
path
.
dirname
(
os
.
path
.
abspath
(
args
.
configfile
))})
config
.
read
(
args
.
configfile
)
logging
.
config
.
fileConfig
(
args
.
configfile
,
disable_existing_loggers
=
False
)
log
=
logging
.
getLogger
(
'
nimsapi
'
)
privkey_file
=
args
.
ssl_key
or
config
.
get
(
'
nims
'
,
'
ssl_key
'
)
if
privkey_file
:
...
...
This diff is collapsed.
Click to expand it.
nimsapi.py
+
1
−
2
View file @
c6ab1614
...
...
@@ -7,7 +7,6 @@ import re
import
json
import
uuid
import
hashlib
import
pymongo
import
tarfile
import
webapp2
import
zipfile
...
...
@@ -414,6 +413,7 @@ app.config = dict(stage_path='', site_id=None, ssl_key=None)
if
__name__
==
'
__main__
'
:
import
sys
import
pymongo
import
argparse
import
ConfigParser
import
paste.httpserver
...
...
@@ -428,7 +428,6 @@ if __name__ == '__main__':
config
=
ConfigParser
.
ConfigParser
({
'
here
'
:
os
.
path
.
dirname
(
os
.
path
.
abspath
(
args
.
config_file
))})
config
.
read
(
args
.
config_file
)
logging
.
config
.
fileConfig
(
args
.
config_file
,
disable_existing_loggers
=
False
)
if
args
.
ssl_key
:
...
...
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