File tree Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 33
33
if platform == 'darwin' :
34
34
install_requires += ['readline' ]
35
35
36
+ # Optional PySocks support
37
+ extras_require = dict (Socks = ['PySocks >= 1.5.0' ])
38
+
36
39
setup (
37
40
name = 'cm_api' ,
38
41
version = '11.0.0' , # Compatible with API v11 (CM 5.5)
43
46
# Project uses simplejson, so ensure that it gets installed or upgraded
44
47
# on the target machine
45
48
install_requires = install_requires ,
49
+ extras_require = extras_require ,
46
50
47
51
author = 'Cloudera, Inc.' ,
48
52
author_email = 'scm-users@cloudera.org' ,
Original file line number Diff line number Diff line change 14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
16
17
+ import os
17
18
import cookielib
18
19
import logging
19
20
import posixpath
20
21
import types
21
22
import urllib
23
+
24
+ try :
25
+ import socks
26
+ import socket
27
+ socks_server = os .environ .get ("SOCKS_SERVER" , None )
28
+ if socks_server :
29
+ host , port = socks_server .split (":" )
30
+ socks .setdefaultproxy (socks .PROXY_TYPE_SOCKS5 , host , int (port ))
31
+ socket .socket = socks .socksocket
32
+ except ImportError :
33
+ pass
34
+
22
35
import urllib2
23
36
24
37
__docformat__ = "epytext"
Original file line number Diff line number Diff line change 14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
16
17
+ import os
17
18
try :
18
19
import json
19
20
except ImportError :
22
23
import posixpath
23
24
import time
24
25
import socket
26
+ try :
27
+ import socks
28
+ socks_server = os .environ .get ("SOCKS_SERVER" , None )
29
+ if socks_server :
30
+ host , port = socks_server .split (":" )
31
+ socks .setdefaultproxy (socks .PROXY_TYPE_SOCKS5 , host , int (port ))
32
+ socket .socket = socks .socksocket
33
+ except ImportError :
34
+ pass
25
35
import urllib2
26
36
27
37
LOG = logging .getLogger (__name__ )
You can’t perform that action at this time.
0 commit comments