mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Don't require the full requirements.txt If we do that we are likely to send users back to the python2 support branch when new dependencies arise.
27 lines
435 B
Python
Executable File
27 lines
435 B
Python
Executable File
#! /usr/bin/env python3
|
|
import os
|
|
import sys
|
|
import pkg_resources
|
|
from pkg_resources import DistributionNotFound, VersionConflict
|
|
|
|
args = sys.argv
|
|
|
|
# verbose flag
|
|
verbose = '-v' in args
|
|
|
|
requirements = [
|
|
'PyMySQL'
|
|
]
|
|
|
|
try:
|
|
pkg_resources.require(requirements)
|
|
except DistributionNotFound as req:
|
|
if verbose:
|
|
print(req)
|
|
exit(1)
|
|
except VersionConflict as req:
|
|
if verbose:
|
|
print(req)
|
|
exit(2)
|
|
exit(0)
|