Skip to content

Commit

Permalink
Merge pull request #223 from Helene/required_python
Browse files Browse the repository at this point in the history
Disable running grafana-bridge 8.0.x with Python <3.8
  • Loading branch information
Helene authored Jun 5, 2024
2 parents 7d24dc7 + 3fc4463 commit a95968b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
9 changes: 8 additions & 1 deletion source/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,21 @@
import io
import os
from cProfile import Profile
from pstats import SortKey, Stats
try:
# Optional dependency
from pstats import SortKey
except ImportError as e:
SortKey = e
from pstats import Stats
from metaclasses import Singleton


class Profiler(metaclass=Singleton):
exposed = True

def __init__(self, path=None):
if isinstance(SortKey, ImportError):
raise SortKey
if not path:
path = os.path.join(os.path.dirname(__file__), 'profile')
self.path = path
Expand Down
11 changes: 11 additions & 0 deletions source/zimonGrafanaIntf.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,17 @@ def main(argv):
print(msg)
return

if sys.version < '3.8':
print(f'\nYor system running {sys.version} \n\nThe IBM Storage Scale bridge for Grafana requires Python3.8 or above. \
\nRead the following instructions for possible solution: \
\nhttps://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')
return

if __version__.endswith('-dev'):
print('\n Warning: You are running a Development version of the IBM Storage Scale bridge for Grafana. \
\n It is recommended to use the latest released version, published on: \
\n https://github.com/IBM/ibm-spectrum-scale-bridge-for-grafana/releases \n')

registered_apps = []

if args.get('enabled', False):
Expand Down

0 comments on commit a95968b

Please sign in to comment.