Last active
July 14, 2016 19:36
-
-
Save cholcombe973/6c828e322080454063dd1decc7d7ad25 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VERSION_TABLE = { | |
0.80: 'firefly', # LTS | |
0.87: 'giant', | |
0.94: 'hammer', # LTS | |
9.2: 'infernalis', | |
10.2: 'jewel', # LTS | |
} | |
def import_ceph_api(): | |
""" | |
This will import the correct ceph_api version that matches the | |
running ceph version. | |
""" | |
ceph_version = get_version() | |
if ceph_version in VERSION_TABLE: | |
version = VERSION_TABLE[ceph_version] | |
log("Importing module ceph_api.{version}.ceph_command".format( | |
version=version), level=DEBUG) | |
importlib.import_module( | |
"ceph_api.{version}.ceph_command".format(version=version)) | |
else: | |
log("Unable to import ceph_api library for version: {}".format( | |
ceph_version), level=ERROR) | |
raise ImportError |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment