Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
16
Merge Requests
16
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
fa583d3f
Commit
fa583d3f
authored
Sep 13, 2018
by
Bryton Lacquement
🚪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
1a6702b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
15 deletions
+6
-15
slapos/format.py
slapos/format.py
+2
-8
slapos/slap/slap.py
slapos/slap/slap.py
+4
-7
No files found.
slapos/format.py
View file @
fa583d3f
...
...
@@ -28,10 +28,7 @@
#
##############################################################################
try
:
from
configparser
import
RawConfigParser
except
ImportError
:
from
ConfigParser
import
RawConfigParser
from
six.moves.configparser
import
RawConfigParser
import
errno
import
fcntl
import
grp
...
...
@@ -54,10 +51,7 @@ import time
import
traceback
import
zipfile
import
platform
try
:
from
urllib.request
import
urlopen
except
ImportError
:
from
urllib2
import
urlopen
from
six.moves.urllib.request
import
urlopen
import
lxml.etree
import
xml_marshaller.xml_marshaller
...
...
slapos/slap/slap.py
View file @
fa583d3f
...
...
@@ -40,10 +40,7 @@ import os
import
json
import
logging
import
re
try
:
from
urllib
import
parse
as
urlparse
except
ImportError
:
import
urlparse
from
six.moves.urllib
import
parse
import
hashlib
from
.util
import
xml2dict
...
...
@@ -680,7 +677,7 @@ def _addIpv6Brackets(url):
# if master_url contains an ipv6 without bracket, add it
# Note that this is mostly to limit specific issues with
# backward compatiblity, not to ensure generic detection.
api_scheme
,
api_netloc
,
api_path
,
api_query
,
api_fragment
=
url
parse
.
urlsplit
(
url
)
api_scheme
,
api_netloc
,
api_path
,
api_query
,
api_fragment
=
parse
.
urlsplit
(
url
)
try
:
ip
=
netaddr
.
IPAddress
(
api_netloc
)
port
=
None
...
...
@@ -694,7 +691,7 @@ def _addIpv6Brackets(url):
api_netloc
=
'[%s]'
%
ip
if
port
:
api_netloc
=
'%s:%s'
%
(
api_netloc
,
port
)
url
=
url
parse
.
urlunsplit
((
api_scheme
,
api_netloc
,
api_path
,
api_query
,
api_fragment
))
url
=
parse
.
urlunsplit
((
api_scheme
,
api_netloc
,
api_path
,
api_query
,
api_fragment
))
return
url
class
ConnectionHelper
:
...
...
@@ -738,7 +735,7 @@ class ConnectionHelper:
return
xml_marshaller
.
loads
(
xml
)
def
do_request
(
self
,
method
,
path
,
params
=
None
,
data
=
None
,
headers
=
None
):
url
=
url
parse
.
urljoin
(
self
.
slapgrid_uri
,
path
)
url
=
parse
.
urljoin
(
self
.
slapgrid_uri
,
path
)
if
headers
is
None
:
headers
=
{}
headers
.
setdefault
(
'Accept'
,
'*/*'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment