Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Siputils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
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
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
Siputils
Commits
4745b7f2
Commit
4745b7f2
authored
4 years ago
by
Mattia Mancini
Browse files
Options
Downloads
Patches
Plain Diff
PEP8 formatting
parent
d17f634b
No related branches found
No related tags found
1 merge request
!1
Make xmlrpc use socks proxy
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/query.py
+43
-44
43 additions, 44 deletions
lib/query.py
with
43 additions
and
44 deletions
lib/query.py
+
43
−
44
View file @
4745b7f2
...
@@ -8,8 +8,6 @@ import xml.etree.ElementTree as ET
...
@@ -8,8 +8,6 @@ import xml.etree.ElementTree as ET
import
xmlrpc.client
import
xmlrpc.client
import
uuid
import
uuid
import
copy
import
copy
import
logging
logger
=
logging
.
getLogger
(
__name__
)
path
=
expanduser
(
"
~/.siplibrc
"
)
path
=
expanduser
(
"
~/.siplibrc
"
)
user
=
None
user
=
None
...
@@ -25,7 +23,7 @@ if not exists(path):
...
@@ -25,7 +23,7 @@ if not exists(path):
file
.
write
(
"
host=
\n
"
)
file
.
write
(
"
host=
\n
"
)
with
open
(
path
,
'
r
'
)
as
file
:
with
open
(
path
,
'
r
'
)
as
file
:
logger
.
info
(
"
Parsing user credentials from
%s
"
%
path
)
print
(
"
Parsing user credentials from
"
,
path
)
for
line
in
file
:
for
line
in
file
:
if
line
.
startswith
(
"
user
"
):
if
line
.
startswith
(
"
user
"
):
user
=
line
.
split
(
'
=
'
)[
1
].
strip
()
user
=
line
.
split
(
'
=
'
)[
1
].
strip
()
...
@@ -42,16 +40,17 @@ login_data = {
...
@@ -42,16 +40,17 @@ login_data = {
url
=
'
https://
'
+
user
+
'
:
'
+
passw
+
'
@
'
+
host
url
=
'
https://
'
+
user
+
'
:
'
+
passw
+
'
@
'
+
host
client
=
xmlrpc
.
client
.
ServerProxy
(
url
)
client
=
xmlrpc
.
client
.
ServerProxy
(
url
)
# id_cache = {}
# id_cache = {}
def
_call_idservice
(
source
,
userlabel
=
None
):
def
_call_idservice
(
source
,
userlabel
=
None
):
if
userlabel
is
not
None
:
if
userlabel
is
not
None
:
response
=
client
.
GetUniqueIDForLabel
(
source
,
userlabel
)
response
=
client
.
GetUniqueIDForLabel
(
source
,
userlabel
)
else
:
else
:
response
=
client
.
GetUniqueID
(
source
)
response
=
client
.
GetUniqueID
(
source
)
return
response
return
response
# for testing:
# for testing:
# if userlabel in id_cache:
# if userlabel in id_cache:
# print "using existing", userlabel
# print "using existing", userlabel
...
@@ -103,9 +102,9 @@ def get_unique_id(source, userlabel):
...
@@ -103,9 +102,9 @@ def get_unique_id(source, userlabel):
return
response
.
get
(
'
id
'
)
return
response
.
get
(
'
id
'
)
def
get_dataproduct_sip
(
projectname
,
dataproductid
):
def
get_dataproduct_sip
(
projectname
,
dataproductid
):
return
client
.
GetSip
(
projectname
,
dataproductid
).
get
(
"
sip
"
)
return
client
.
GetSip
(
projectname
,
dataproductid
).
get
(
"
sip
"
)
def
get_dataproduct_ids
(
projectname
,
sasid
):
def
get_dataproduct_ids
(
projectname
,
sasid
):
return
client
.
GetDataProductIDS
(
projectname
,
sasid
).
get
(
"
ids
"
)
return
client
.
GetDataProductIDS
(
projectname
,
sasid
).
get
(
"
ids
"
)
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