Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
34a8ccf
py3k: change all print statements to be functions
Ormod Aug 24, 2015
3ee58a7
py3k: Change exception syntax from old style commas to use the as syntax
Ormod Aug 24, 2015
a4572f3
tests: import Mock and patch from the test base file
Ormod Aug 24, 2015
a741895
py3k: add a pycompat helper file for imports
Ormod Aug 26, 2015
8e898fd
tests: import exception types through a relative import
Ormod Aug 24, 2015
c21a510
py3k: replace all dict.iteritems() with .items()
Ormod Aug 24, 2015
3afd21b
test: make filter iterators into lists for py3k compatibility
Ormod Aug 24, 2015
8bd1acf
py3k: replace xrange with range for compatibility
Ormod Aug 24, 2015
f28b235
py3k: Replace all uses of basestring with isinstance(x, str)
Ormod Aug 24, 2015
0ed4d81
py3k: use string.ascii_letters since it also exists in py3k
Ormod Aug 24, 2015
9addc26
py3k: Replace the obsolete use of string.replace with .replace()
Ormod Aug 24, 2015
d0e46bd
py3k: Replace some more uses of call and magicmock from the one in ba…
Ormod Aug 24, 2015
4cb8a4c
tests: import StringIO from the base test file
Ormod Aug 24, 2015
3618170
py3k: Change tests mock patching to use a variable from test base file
Ormod Aug 24, 2015
bee85ad
py3k: import urllib from a common pycompat file
Ormod Aug 24, 2015
00a7340
py3k: Fix cpickle import to have a fallback
Ormod Aug 24, 2015
23a7971
py3k: import Queue related functionality from pycompat
Ormod Aug 24, 2015
b4186e6
py3k: Move http client to a file with a different name to unmask the …
Ormod Aug 24, 2015
b01d6e3
py3k: Change xmlrpclib imports to work with both py3k and 2.x
Ormod Aug 24, 2015
fba635e
py3k: Since py3k no longer has a long type, mock int as its replacement
Ormod Aug 24, 2015
cbd98e3
py3k: subprocess returns bytes not strings on py3k, convert to unicode
Ormod Aug 24, 2015
9ec08f1
py3k: Fix test class to work with different type of __next__/next met…
Ormod Aug 25, 2015
01e3b81
py3k: Makefile/setup.py changes to support building both py2.x and py3k
Ormod Aug 26, 2015
d35960b
Makefile: get distribution name by asking python itself
Ormod Aug 26, 2015
3d1f143
pep8: Fix pep8 issues created during py3k work
Ormod Aug 26, 2015
55c7d56
py3k: Replace file() calls with open()
Ormod Aug 26, 2015
35510ed
py3k: Change imports to be relative imports for Handlers
Ormod Aug 26, 2015
40ee747
Add python 3 to Travis testing
shortdudey123 Mar 11, 2017
dfbe06e
Install python34 in Vagrant centos7-test host
shortdudey123 Mar 11, 2017
f0fadc5
More compatability changes
shortdudey123 Mar 11, 2017
1bdf771
Switch from izip to zip
shortdudey123 Mar 11, 2017
be0e557
Update urllib compat more
shortdudey123 Mar 11, 2017
73207d0
Fix several pep8 errors
shortdudey123 Mar 11, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
py3k: Change xmlrpclib imports to work with both py3k and 2.x
  • Loading branch information
Ormod authored and shortdudey123 committed Mar 11, 2017
commit b01d6e30b5bd86bcc858806a43a289f17d694ecd
9 changes: 6 additions & 3 deletions src/collectors/supervisord/supervisord.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@

"""

import xmlrpclib
try:
from xmlrpclib import Server, ServerProxy
except ImportError:
from xmlrpc.client import Server, ServerProxy

try:
import supervisor.xmlrpc
Expand Down Expand Up @@ -66,13 +69,13 @@ def getAllProcessInfo(self):
'Attempting to connect to XML-RPC server "%s"', uri)

if protocol == 'unix':
server = xmlrpclib.ServerProxy(
server = ServerProxy(
'http://127.0.0.1',
supervisor.xmlrpc.SupervisorTransport(None, None, uri)
).supervisor

elif protocol == 'http':
server = xmlrpclib.Server(uri).supervisor
server = Server(uri).supervisor

else:
self.log.debug(
Expand Down