File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 1+ from __future__ import print_function
12import struct
2- import urllib2
33import sys
44import os
55
6+ try :
7+ from urllib .request import urlopen
8+ except ImportError :
9+ from urllib2 import urlopen
10+
611__author__ = 'Igor Seletskiy'
712__copyright__ = "Copyright (c) Cloud Linux GmbH & Cloud Linux Software, Inc"
813__credits__ = 'Igor Seletskiy'
@@ -62,11 +67,11 @@ def inside_lxc_container():
6267
6368
6469def is_compat ():
65- url = 'http://patches.kernelcare.com/' + get_kernel_hash ()+ '/version'
70+ url = 'http://patches.kernelcare.com/' + get_kernel_hash () + '/version'
6671 try :
67- urllib2 . urlopen (url )
72+ urlopen (url )
6873 return True
69- except :
74+ except Exception :
7075 return False
7176
7277
@@ -95,5 +100,6 @@ def main():
95100 myprint (silent , "UNSUPPORTED" )
96101 return 1
97102
103+
98104if __name__ == "__main__" :
99105 exit (main ())
You can’t perform that action at this time.
0 commit comments