Skip to content

Commit

Permalink
Merge pull request #51 from mikechristie/gw-mgmt-fix-and-feat
Browse files Browse the repository at this point in the history
Gateway management fixes and features

Reviewed-by: Jason Dillaman <[email protected]>
  • Loading branch information
Jason Dillaman authored Mar 19, 2019
2 parents 9bd0cd0 + 8beeee5 commit ff19e96
Show file tree
Hide file tree
Showing 7 changed files with 1,295 additions and 1,107 deletions.
11 changes: 11 additions & 0 deletions ceph_iscsi_config/backstore.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
from rtslib_fb import UserBackedStorageObject
from rtslib_fb.utils import RTSLibError

from ceph_iscsi_config.utils import CephiSCSIError

USER_RBD = 'user:rbd'


def lookup_storage_object_by_disk(config, disk):
backstore = config.config["disks"][disk]["backstore"]
backstore_object_name = config.config["disks"][disk]["backstore_object_name"]

try:
return lookup_storage_object(backstore_object_name, backstore)
except (RTSLibError, CephiSCSIError):
return None


def lookup_storage_object(name, backstore):
if backstore == USER_RBD:
return UserBackedStorageObject(name=name)
Expand Down
Loading

0 comments on commit ff19e96

Please sign in to comment.