File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 24
24
import io
25
25
import os
26
26
from cProfile import Profile
27
- from pstats import SortKey , Stats
27
+ try :
28
+ # Optional dependency
29
+ from pstats import SortKey
30
+ except ImportError as e :
31
+ SortKey = e
32
+ from pstats import Stats
28
33
from metaclasses import Singleton
29
34
30
35
31
36
class Profiler (metaclass = Singleton ):
32
37
exposed = True
33
38
34
39
def __init__ (self , path = None ):
40
+ if isinstance (SortKey , ImportError ):
41
+ raise SortKey
35
42
if not path :
36
43
path = os .path .join (os .path .dirname (__file__ ), 'profile' )
37
44
self .path = path
Original file line number Diff line number Diff line change @@ -208,6 +208,17 @@ def main(argv):
208
208
print (msg )
209
209
return
210
210
211
+ if sys .version < '3.8' :
212
+ print (f'\n Yor system running { sys .version } \n \n The IBM Storage Scale bridge for Grafana requires Python3.8 or above. \
213
+ \n Read the following instructions for possible solution: \
214
+ \n https://github.com/IBM/ibm-spectrum-scale-bridge-for-grafana/wiki/What-to-do-if-your-system-is-on-a-Python-version-lower-than-3.8' )
215
+ return
216
+
217
+ if __version__ .endswith ('-dev' ):
218
+ print ('\n Warning: You are running a Development version of the IBM Storage Scale bridge for Grafana. \
219
+ \n It is recommended to use the latest released version, published on: \
220
+ \n https://github.com/IBM/ibm-spectrum-scale-bridge-for-grafana/releases \n ' )
221
+
211
222
registered_apps = []
212
223
213
224
if args .get ('enabled' , False ):
You can’t perform that action at this time.
0 commit comments