Tony Asleson
2014-04-08 18:03:28 UTC
In _iplugin.py my original intention was that we specify the interface and then
plug-in writers provide the implementation. However, in those cases where the
plug-in doesn't support one or more operations the plug-in writer was required
to provide an implementation which just raised an exception stating that the
operation wasn't supported. Instead of requiring every plug-in to do this I
changed the classes so that the classes that have an interface that isn't
mandatory to provide this default not implemented implementation.
This allows for a reduction in the overall code base without loss of
functionality. The base IPlugin class is still abstract thus the class that
derives from it will still need to implement all the methods contained in it.
Signed-off-by: Tony Asleson <***@redhat.com>
---
lsm/lsm/_iplugin.py | 171 +++++++++++++++++++++++++++-------------------------
lsm/lsm/nstor.py | 31 ----------
lsm/lsm/ontap.py | 17 ------
lsm/lsm/smis.py | 52 ----------------
lsm/lsm/targetd.py | 81 -------------------------
5 files changed, 88 insertions(+), 264 deletions(-)
diff --git a/lsm/lsm/_iplugin.py b/lsm/lsm/_iplugin.py
index 5326d4b..b1ff58f 100644
--- a/lsm/lsm/_iplugin.py
+++ b/lsm/lsm/_iplugin.py
@@ -17,6 +17,7 @@
from abc import ABCMeta as _ABCMeta
from abc import abstractmethod as _abstractmethod
+from lsm import LsmError, ErrorNumber, Pool
class IPlugin(object):
@@ -126,25 +127,68 @@ class IPlugin(object):
class IStorageAreaNetwork(IPlugin):
- @_abstractmethod
+
+ def pool_create(self, system_id, pool_name, size_bytes,
+ raid_type=Pool.RAID_TYPE_UNKNOWN,
+ member_type=Pool.MEMBER_TYPE_UNKNOWN, flags=0):
+ """
+ Creates a pool letting the array pick the specifics
+
+ Returns a tuple (job_id, re-sized_volume)
+ Note: Tuple return values are mutually exclusive, when one
+ is None the other must be valid.
+ """
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
+
+ def pool_create_from_disks(self, system_id, pool_name, member_ids,
+ raid_type, flags=0):
+ """
+ Creates a pool letting the user select the disks
+
+ Returns a tuple (job_id, re-sized_volume)
+ Note: Tuple return values are mutually exclusive, when one
+ is None the other must be valid.
+ """
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
+
+ def pool_create_from_volumes(self, system_id, pool_name, member_ids,
+ raid_type, flags=0):
+ """
+ Creates a pool from existing volumes
+
+ Returns a tuple (job_id, re-sized_volume)
+ Note: Tuple return values are mutually exclusive, when one
+ is None the other must be valid.
+ """
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
+
+ def pool_create_from_pool(self, system_id, pool_name, member_id,
+ size_bytes, flags=0):
+ """
+ Creates a pool from existing volumes
+
+ Returns a tuple (job_id, re-sized_volume)
+ Note: Tuple return values are mutually exclusive, when one
+ is None the other must be valid.
+ """
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
+
def volumes(self, flags=0):
"""
Returns an array of volume objects
Raises LsmError on error
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def initiators(self, flags=0):
"""
Return an array of initiator objects
Raises LsmError on error
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def volume_create(self, pool, volume_name, size_bytes, provisioning,
flags=0):
"""
@@ -154,18 +198,16 @@ class IStorageAreaNetwork(IPlugin):
Note: Tuple return values are mutually exclusive, when one
is None the other must be valid.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def volume_delete(self, volume, flags=0):
"""
Deletes a volume.
Returns Job id or None if completed, else raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def volume_resize(self, volume, new_size_bytes, flags=0):
"""
Re-sizes a volume.
@@ -174,10 +216,8 @@ class IStorageAreaNetwork(IPlugin):
Note: Tuple return values are mutually exclusive, when one
is None the other must be valid.
"""
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- pass
-
- @_abstractmethod
def volume_replicate(self, pool, rep_type, volume_src, name, flags=0):
"""
Replicates a volume from the specified pool. In this library, to
@@ -187,9 +227,8 @@ class IStorageAreaNetwork(IPlugin):
Note: Tuple return values are mutually exclusive, when one
is None the other must be valid.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def volume_replicate_range_block_size(self, system, flags=0):
"""
Returns the number of bytes per block for volume_replicate_range
@@ -200,9 +239,8 @@ class IStorageAreaNetwork(IPlugin):
Returns bytes per block, Raises LsmError on error
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def volume_replicate_range(self, rep_type, volume_src, volume_dest, ranges,
flags=0):
"""
@@ -212,27 +250,24 @@ class IStorageAreaNetwork(IPlugin):
Returns Job id or None if completed, else raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def volume_online(self, volume, flags=0):
"""
Makes a volume available to the host
Returns None on success, else raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def volume_offline(self, volume, flags=0):
"""
Makes a volume unavailable to the host
Returns None on success, else raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def iscsi_chap_auth(self, initiator, in_user, in_password, out_user,
out_password, flags):
"""
@@ -245,9 +280,8 @@ class IStorageAreaNetwork(IPlugin):
Raises LsmError on error
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def initiator_grant(self, initiator_id, initiator_type, volume, access,
flags=0):
"""
@@ -255,16 +289,15 @@ class IStorageAreaNetwork(IPlugin):
Returns None on success, else raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def initiator_revoke(self, initiator, volume, flags=0):
"""
Revokes access to a volume for the specified initiator
Returns None on success, else raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
def access_group_grant(self, group, volume, access, flags=0):
"""
@@ -272,7 +305,7 @@ class IStorageAreaNetwork(IPlugin):
Returns None on success, else raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
def access_group_revoke(self, group, volume, flags=0):
"""
@@ -280,71 +313,62 @@ class IStorageAreaNetwork(IPlugin):
Returns None on success, else raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def access_group_list(self, flags=0):
"""
Returns a list of access groups, raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def access_group_create(self, name, initiator_id, id_type, system_id,
flags=0):
"""
Returns a list of access groups, raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def access_group_del(self, group, flags=0):
"""
Deletes an access group, Raises LsmError on error
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def access_group_add_initiator(self, group, initiator_id, id_type,
flags=0):
"""
Adds an initiator to an access group, Raises LsmError on error
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def access_group_del_initiator(self, group, initiator_id, flags=0):
"""
Deletes an initiator from an access group, Raises LsmError on error
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def volumes_accessible_by_access_group(self, group, flags=0):
"""
Returns the list of volumes that access group has access to.
Raises LsmError on error
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def access_groups_granted_to_volume(self, volume, flags=0):
"""
Returns the list of access groups that have access to the specified,
Raises LsmError on error
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def volume_child_dependency(self, volume, flags=0):
"""
Returns True if this volume has other volumes which are dependant on
it. Implies that this volume cannot be deleted or possibly modified
because it would affect its children.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def volume_child_dependency_rm(self, volume, flags=0):
"""
If this volume has child dependency, this method call will fully
@@ -357,31 +381,27 @@ class IStorageAreaNetwork(IPlugin):
Returns None if complete else job id, raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def volumes_accessible_by_initiator(self, initiator, flags=0):
"""
Returns a list of volumes that the initiator has access to,
Raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def initiators_granted_to_volume(self, volume, flags=0):
"""
Returns a list of initiators that have access to the specified volume,
Raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
class INetworkAttachedStorage(IPlugin):
"""
Class the represents Network attached storage (Common NFS/CIFS operations)
"""
-
- @_abstractmethod
def fs(self, flags=0):
"""
Returns a list of file systems on the controller. Raises LsmError on
@@ -389,7 +409,6 @@ class INetworkAttachedStorage(IPlugin):
"""
pass
- @_abstractmethod
def fs_delete(self, fs, flags=0):
"""
WARNING: Destructive
@@ -397,9 +416,8 @@ class INetworkAttachedStorage(IPlugin):
Deletes a file system and everything it contains
Returns None on success, else job id
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def fs_resize(self, fs, new_size_bytes, flags=0):
"""
Re-size a file system
@@ -408,9 +426,8 @@ class INetworkAttachedStorage(IPlugin):
Note: Tuple return values are mutually exclusive, when one
is None the other must be valid.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def fs_create(self, pool, name, size_bytes, flags=0):
"""
Creates a file system given a pool, name and size.
@@ -421,9 +438,8 @@ class INetworkAttachedStorage(IPlugin):
Note: Tuple return values are mutually exclusive, when one
is None the other must be valid.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def fs_clone(self, src_fs, dest_fs_name, snapshot=None, flags=0):
"""
Creates a thin, point in time read/writable copy of src to dest.
@@ -433,9 +449,8 @@ class INetworkAttachedStorage(IPlugin):
Note: Tuple return values are mutually exclusive, when one
is None the other must be valid.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def file_clone(self, fs, src_file_name, dest_file_name, snapshot=None,
flags=0):
"""
@@ -444,17 +459,15 @@ class INetworkAttachedStorage(IPlugin):
Returns Job id or None if completed, else raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def fs_snapshots(self, fs, flags=0):
"""
Returns a list of snapshots for the supplied file system,
Raises LsmError on error
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def fs_snapshot_create(self, fs, snapshot_name, files, flags=0):
"""
Snapshot is a point in time read-only copy
@@ -474,18 +487,16 @@ class INetworkAttachedStorage(IPlugin):
Note: Snapshot name may not match
what was passed in (depends on array implementation)
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def fs_snapshot_delete(self, fs, snapshot, flags=0):
"""
Frees the re-sources for the given snapshot on the supplied filesystem.
Returns Job id or None if completed, else raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def fs_snapshot_revert(self, fs, snapshot, files, restore_files,
all_files=False, flags=0):
"""
@@ -502,9 +513,8 @@ class INetworkAttachedStorage(IPlugin):
Returns None on success, else job id, LsmError exception on error
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def fs_child_dependency(self, fs, files, flags=0):
"""
Returns True if the specified filesystem or specified file on this
@@ -512,9 +522,8 @@ class INetworkAttachedStorage(IPlugin):
or specified file on this file system cannot be deleted or possibly
modified because it would affect its children.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def fs_child_dependency_rm(self, fs, files, flags=0):
"""
If this filesystem or specified file on this filesystem has child
@@ -527,35 +536,31 @@ class INetworkAttachedStorage(IPlugin):
Returns Job id or None if completed, else raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
class INfs(INetworkAttachedStorage):
- @_abstractmethod
def export_auth(self, flags=0):
"""
Returns the types of authentication that are available for NFS
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def exports(self, flags=0):
"""
Get a list of all exported file systems on the controller.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def export_fs(self, fs_id, export_path, root_list, rw_list, ro_list,
anon_uid, anon_gid, auth_type, options, flags=0):
"""
Exports a filesystem as specified in the export
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def export_remove(self, export, flags=0):
"""
Removes the specified export
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
diff --git a/lsm/lsm/nstor.py b/lsm/lsm/nstor.py
index 172fe43..10f5525 100644
--- a/lsm/lsm/nstor.py
+++ b/lsm/lsm/nstor.py
@@ -590,37 +590,6 @@ class NexentaStor(INfs, IStorageAreaNetwork):
# return
- def volume_replicate_range_block_size(self, system, flags=0):
- """
- Returns the number of bytes per block for volume_replicate_range
- call. Callers of volume_replicate_range need to use this when
- calculating start and block lengths.
-
- Note: bytes per block may not match volume blocksize.
-
- Returns bytes per block.
- """
- raise LsmError(ErrorNumber.NO_SUPPORT, "This operation is not "
- "supported")
-
- def volume_replicate_range(self, rep_type, volume_src, volume_dest, ranges,
- flags=0):
- """
- Replicates a portion of a volume to itself or another volume. The src,
- dest and number of blocks values change with vendor, call
- volume_replicate_range_block_size to get block unit size.
-
- Returns Job id or None if completed, else raises LsmError on errors.
- """
- raise LsmError(ErrorNumber.NO_SUPPORT, "Replicate range operation is"
- " not supported")
-
- def volume_online(self, volume, flags=0):
- return
-
- def volume_offline(self, volume, flags=0):
- return
-
def iscsi_chap_auth(self, initiator, in_user, in_password, out_user,
out_password, flags=0):
"""
diff --git a/lsm/lsm/ontap.py b/lsm/lsm/ontap.py
index d52b3e4..5321c95 100644
--- a/lsm/lsm/ontap.py
+++ b/lsm/lsm/ontap.py
@@ -818,23 +818,6 @@ class Ontap(IStorageAreaNetwork, INfs):
self.f.iscsi_initiator_add_auth(initiator.id, in_user, in_password,
out_user, out_password)
- @handle_ontap_errors
- def initiator_grant(self, initiator_id, initiator_type, volume, access,
- flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_ontap_errors
- def initiator_revoke(self, initiator, volume, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_ontap_errors
- def volumes_accessible_by_initiator(self, initiator, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_ontap_errors
- def initiators_granted_to_volume(self, volume, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
@staticmethod
def _rpercent(total, current):
p = 1 - (current / float(total))
diff --git a/lsm/lsm/smis.py b/lsm/lsm/smis.py
index 4164381..2050fe7 100644
--- a/lsm/lsm/smis.py
+++ b/lsm/lsm/smis.py
@@ -1844,14 +1844,6 @@ class Smis(IStorageAreaNetwork):
raise LsmError(ErrorNumber.NO_SUPPORT,
"volume-replicate not supported")
- def volume_replicate_range_block_size(self, system, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- def volume_replicate_range(self, rep_type, volume_src, volume_dest,
- ranges,
- flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
@handle_cim_errors
def volume_online(self, volume, flags=0):
return None
@@ -2117,23 +2109,6 @@ class Smis(IStorageAreaNetwork):
cim_spcs = self._get_access_groups(property_list=cim_spc_pros)
return [self._new_access_group(cim_spc) for cim_spc in cim_spcs]
- @handle_cim_errors
- def access_group_create(self, name, initiator_id, id_type, system_id,
- flags=0):
- # page 880 1.5 spec. CreateMaskingView
- #
- # No access to a provider that implements this at this time,
- # so unable to develop and test.
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_cim_errors
- def access_group_del(self, group, flags=0):
- # page 880 1.5 spec. DeleteMaskingView
- #
- # No access to a provider that implements this at this time,
- # so unable to develop and test.
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
def _initiator_lookup(self, initiator_id):
"""
Looks up an initiator by initiator id
@@ -2182,27 +2157,6 @@ class Smis(IStorageAreaNetwork):
*(self._c.InvokeMethod('HidePaths', ccs.path,
**hide_params)))[0]
- @handle_cim_errors
- def iscsi_chap_auth(self, initiator, in_user, in_password, out_user,
- out_password, flags):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_cim_errors
- def initiator_grant(self, initiator_id, initiator_type, volume, access,
- flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_cim_errors
- def initiator_revoke(self, initiator, volume, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_cim_errors
- def volumes_accessible_by_initiator(self, initiator, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_cim_errors
- def initiators_granted_to_volume(self, volume, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
@handle_cim_errors
def job_free(self, job_id, flags=0):
@@ -2218,12 +2172,6 @@ class Smis(IStorageAreaNetwork):
except CIMError:
pass
- def volume_child_dependency(self, volume, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- def volume_child_dependency_rm(self, volume, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
@handle_cim_errors
def disks(self, flags=0):
"""
diff --git a/lsm/lsm/targetd.py b/lsm/lsm/targetd.py
index 3f0a5cf..8b5c235 100644
--- a/lsm/lsm/targetd.py
+++ b/lsm/lsm/targetd.py
@@ -235,15 +235,6 @@ class TargetdStorage(IStorageAreaNetwork, INfs):
return None, self._get_volume(pool_id, name)
@handle_errors
- def volume_replicate_range_block_size(self, system, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def volume_replicate_range(self, rep_type, volume_src, volume_dest,
- ranges, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
def volume_online(self, volume, flags=0):
vol_list = self._jsonrequest("vol_list", dict(pool=volume.pool_id))
@@ -254,48 +245,6 @@ class TargetdStorage(IStorageAreaNetwork, INfs):
return not self.volume_online(volume)
@handle_errors
- def volume_resize(self, volume, new_size_bytes, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def access_group_grant(self, group, volume, access, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def access_group_revoke(self, group, volume, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def access_group_list(self, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def access_group_create(self, name, initiator_id, id_type, system_id,
- flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def access_group_del(self, group, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def access_group_add_initiator(self, group, initiator_id, id_type,
- flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def access_group_del_initiator(self, group, initiator, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def volumes_accessible_by_access_group(self, group, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def access_groups_granted_to_volume(self, volume, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
def iscsi_chap_auth(self, initiator, in_user, in_password, out_user,
out_password, flags=0):
self._jsonrequest("initiator_set_auth",
@@ -362,14 +311,6 @@ class TargetdStorage(IStorageAreaNetwork, INfs):
return inits
@handle_errors
- def volume_child_dependency(self, volume, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def volume_child_dependency_rm(self, volume, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
def fs(self, flags=0):
rc = []
for fs in self._jsonrequest("fs_list"):
@@ -384,10 +325,6 @@ class TargetdStorage(IStorageAreaNetwork, INfs):
self._jsonrequest("fs_destroy", dict(uuid=fs.id))
@handle_errors
- def fs_resize(self, fs, new_size_bytes, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
def fs_create(self, pool, name, size_bytes, flags=0):
self._jsonrequest("fs_create", dict(pool_name=pool.id, name=name,
size_bytes=size_bytes))
@@ -408,11 +345,6 @@ class TargetdStorage(IStorageAreaNetwork, INfs):
return None, self._get_fs(src_fs.pool_id, dest_fs_name)
@handle_errors
- def file_clone(self, fs, src_file_name, dest_file_name, snapshot=None,
- flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
def fs_snapshots(self, fs, flags=0):
rc = []
for ss in self._jsonrequest("ss_list", dict(fs_uuid=fs.id)):
@@ -434,19 +366,6 @@ class TargetdStorage(IStorageAreaNetwork, INfs):
ss_uuid=snapshot.id))
@handle_errors
- def fs_snapshot_revert(self, fs, snapshot, files, restore_files,
- all_files=False, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def fs_child_dependency(self, fs, files, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def fs_child_dependency_rm(self, fs, files, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
def export_auth(self, flags=0):
exports = self._jsonrequest("nfs_export_auth_list")
return exports
plug-in writers provide the implementation. However, in those cases where the
plug-in doesn't support one or more operations the plug-in writer was required
to provide an implementation which just raised an exception stating that the
operation wasn't supported. Instead of requiring every plug-in to do this I
changed the classes so that the classes that have an interface that isn't
mandatory to provide this default not implemented implementation.
This allows for a reduction in the overall code base without loss of
functionality. The base IPlugin class is still abstract thus the class that
derives from it will still need to implement all the methods contained in it.
Signed-off-by: Tony Asleson <***@redhat.com>
---
lsm/lsm/_iplugin.py | 171 +++++++++++++++++++++++++++-------------------------
lsm/lsm/nstor.py | 31 ----------
lsm/lsm/ontap.py | 17 ------
lsm/lsm/smis.py | 52 ----------------
lsm/lsm/targetd.py | 81 -------------------------
5 files changed, 88 insertions(+), 264 deletions(-)
diff --git a/lsm/lsm/_iplugin.py b/lsm/lsm/_iplugin.py
index 5326d4b..b1ff58f 100644
--- a/lsm/lsm/_iplugin.py
+++ b/lsm/lsm/_iplugin.py
@@ -17,6 +17,7 @@
from abc import ABCMeta as _ABCMeta
from abc import abstractmethod as _abstractmethod
+from lsm import LsmError, ErrorNumber, Pool
class IPlugin(object):
@@ -126,25 +127,68 @@ class IPlugin(object):
class IStorageAreaNetwork(IPlugin):
- @_abstractmethod
+
+ def pool_create(self, system_id, pool_name, size_bytes,
+ raid_type=Pool.RAID_TYPE_UNKNOWN,
+ member_type=Pool.MEMBER_TYPE_UNKNOWN, flags=0):
+ """
+ Creates a pool letting the array pick the specifics
+
+ Returns a tuple (job_id, re-sized_volume)
+ Note: Tuple return values are mutually exclusive, when one
+ is None the other must be valid.
+ """
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
+
+ def pool_create_from_disks(self, system_id, pool_name, member_ids,
+ raid_type, flags=0):
+ """
+ Creates a pool letting the user select the disks
+
+ Returns a tuple (job_id, re-sized_volume)
+ Note: Tuple return values are mutually exclusive, when one
+ is None the other must be valid.
+ """
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
+
+ def pool_create_from_volumes(self, system_id, pool_name, member_ids,
+ raid_type, flags=0):
+ """
+ Creates a pool from existing volumes
+
+ Returns a tuple (job_id, re-sized_volume)
+ Note: Tuple return values are mutually exclusive, when one
+ is None the other must be valid.
+ """
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
+
+ def pool_create_from_pool(self, system_id, pool_name, member_id,
+ size_bytes, flags=0):
+ """
+ Creates a pool from existing volumes
+
+ Returns a tuple (job_id, re-sized_volume)
+ Note: Tuple return values are mutually exclusive, when one
+ is None the other must be valid.
+ """
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
+
def volumes(self, flags=0):
"""
Returns an array of volume objects
Raises LsmError on error
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def initiators(self, flags=0):
"""
Return an array of initiator objects
Raises LsmError on error
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def volume_create(self, pool, volume_name, size_bytes, provisioning,
flags=0):
"""
@@ -154,18 +198,16 @@ class IStorageAreaNetwork(IPlugin):
Note: Tuple return values are mutually exclusive, when one
is None the other must be valid.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def volume_delete(self, volume, flags=0):
"""
Deletes a volume.
Returns Job id or None if completed, else raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def volume_resize(self, volume, new_size_bytes, flags=0):
"""
Re-sizes a volume.
@@ -174,10 +216,8 @@ class IStorageAreaNetwork(IPlugin):
Note: Tuple return values are mutually exclusive, when one
is None the other must be valid.
"""
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- pass
-
- @_abstractmethod
def volume_replicate(self, pool, rep_type, volume_src, name, flags=0):
"""
Replicates a volume from the specified pool. In this library, to
@@ -187,9 +227,8 @@ class IStorageAreaNetwork(IPlugin):
Note: Tuple return values are mutually exclusive, when one
is None the other must be valid.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def volume_replicate_range_block_size(self, system, flags=0):
"""
Returns the number of bytes per block for volume_replicate_range
@@ -200,9 +239,8 @@ class IStorageAreaNetwork(IPlugin):
Returns bytes per block, Raises LsmError on error
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def volume_replicate_range(self, rep_type, volume_src, volume_dest, ranges,
flags=0):
"""
@@ -212,27 +250,24 @@ class IStorageAreaNetwork(IPlugin):
Returns Job id or None if completed, else raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def volume_online(self, volume, flags=0):
"""
Makes a volume available to the host
Returns None on success, else raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def volume_offline(self, volume, flags=0):
"""
Makes a volume unavailable to the host
Returns None on success, else raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def iscsi_chap_auth(self, initiator, in_user, in_password, out_user,
out_password, flags):
"""
@@ -245,9 +280,8 @@ class IStorageAreaNetwork(IPlugin):
Raises LsmError on error
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def initiator_grant(self, initiator_id, initiator_type, volume, access,
flags=0):
"""
@@ -255,16 +289,15 @@ class IStorageAreaNetwork(IPlugin):
Returns None on success, else raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def initiator_revoke(self, initiator, volume, flags=0):
"""
Revokes access to a volume for the specified initiator
Returns None on success, else raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
def access_group_grant(self, group, volume, access, flags=0):
"""
@@ -272,7 +305,7 @@ class IStorageAreaNetwork(IPlugin):
Returns None on success, else raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
def access_group_revoke(self, group, volume, flags=0):
"""
@@ -280,71 +313,62 @@ class IStorageAreaNetwork(IPlugin):
Returns None on success, else raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def access_group_list(self, flags=0):
"""
Returns a list of access groups, raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def access_group_create(self, name, initiator_id, id_type, system_id,
flags=0):
"""
Returns a list of access groups, raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def access_group_del(self, group, flags=0):
"""
Deletes an access group, Raises LsmError on error
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def access_group_add_initiator(self, group, initiator_id, id_type,
flags=0):
"""
Adds an initiator to an access group, Raises LsmError on error
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def access_group_del_initiator(self, group, initiator_id, flags=0):
"""
Deletes an initiator from an access group, Raises LsmError on error
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def volumes_accessible_by_access_group(self, group, flags=0):
"""
Returns the list of volumes that access group has access to.
Raises LsmError on error
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def access_groups_granted_to_volume(self, volume, flags=0):
"""
Returns the list of access groups that have access to the specified,
Raises LsmError on error
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def volume_child_dependency(self, volume, flags=0):
"""
Returns True if this volume has other volumes which are dependant on
it. Implies that this volume cannot be deleted or possibly modified
because it would affect its children.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def volume_child_dependency_rm(self, volume, flags=0):
"""
If this volume has child dependency, this method call will fully
@@ -357,31 +381,27 @@ class IStorageAreaNetwork(IPlugin):
Returns None if complete else job id, raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def volumes_accessible_by_initiator(self, initiator, flags=0):
"""
Returns a list of volumes that the initiator has access to,
Raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def initiators_granted_to_volume(self, volume, flags=0):
"""
Returns a list of initiators that have access to the specified volume,
Raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
class INetworkAttachedStorage(IPlugin):
"""
Class the represents Network attached storage (Common NFS/CIFS operations)
"""
-
- @_abstractmethod
def fs(self, flags=0):
"""
Returns a list of file systems on the controller. Raises LsmError on
@@ -389,7 +409,6 @@ class INetworkAttachedStorage(IPlugin):
"""
pass
- @_abstractmethod
def fs_delete(self, fs, flags=0):
"""
WARNING: Destructive
@@ -397,9 +416,8 @@ class INetworkAttachedStorage(IPlugin):
Deletes a file system and everything it contains
Returns None on success, else job id
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def fs_resize(self, fs, new_size_bytes, flags=0):
"""
Re-size a file system
@@ -408,9 +426,8 @@ class INetworkAttachedStorage(IPlugin):
Note: Tuple return values are mutually exclusive, when one
is None the other must be valid.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def fs_create(self, pool, name, size_bytes, flags=0):
"""
Creates a file system given a pool, name and size.
@@ -421,9 +438,8 @@ class INetworkAttachedStorage(IPlugin):
Note: Tuple return values are mutually exclusive, when one
is None the other must be valid.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def fs_clone(self, src_fs, dest_fs_name, snapshot=None, flags=0):
"""
Creates a thin, point in time read/writable copy of src to dest.
@@ -433,9 +449,8 @@ class INetworkAttachedStorage(IPlugin):
Note: Tuple return values are mutually exclusive, when one
is None the other must be valid.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def file_clone(self, fs, src_file_name, dest_file_name, snapshot=None,
flags=0):
"""
@@ -444,17 +459,15 @@ class INetworkAttachedStorage(IPlugin):
Returns Job id or None if completed, else raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def fs_snapshots(self, fs, flags=0):
"""
Returns a list of snapshots for the supplied file system,
Raises LsmError on error
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def fs_snapshot_create(self, fs, snapshot_name, files, flags=0):
"""
Snapshot is a point in time read-only copy
@@ -474,18 +487,16 @@ class INetworkAttachedStorage(IPlugin):
Note: Snapshot name may not match
what was passed in (depends on array implementation)
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def fs_snapshot_delete(self, fs, snapshot, flags=0):
"""
Frees the re-sources for the given snapshot on the supplied filesystem.
Returns Job id or None if completed, else raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def fs_snapshot_revert(self, fs, snapshot, files, restore_files,
all_files=False, flags=0):
"""
@@ -502,9 +513,8 @@ class INetworkAttachedStorage(IPlugin):
Returns None on success, else job id, LsmError exception on error
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def fs_child_dependency(self, fs, files, flags=0):
"""
Returns True if the specified filesystem or specified file on this
@@ -512,9 +522,8 @@ class INetworkAttachedStorage(IPlugin):
or specified file on this file system cannot be deleted or possibly
modified because it would affect its children.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def fs_child_dependency_rm(self, fs, files, flags=0):
"""
If this filesystem or specified file on this filesystem has child
@@ -527,35 +536,31 @@ class INetworkAttachedStorage(IPlugin):
Returns Job id or None if completed, else raises LsmError on errors.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
class INfs(INetworkAttachedStorage):
- @_abstractmethod
def export_auth(self, flags=0):
"""
Returns the types of authentication that are available for NFS
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def exports(self, flags=0):
"""
Get a list of all exported file systems on the controller.
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def export_fs(self, fs_id, export_path, root_list, rw_list, ro_list,
anon_uid, anon_gid, auth_type, options, flags=0):
"""
Exports a filesystem as specified in the export
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
- @_abstractmethod
def export_remove(self, export, flags=0):
"""
Removes the specified export
"""
- pass
+ raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
diff --git a/lsm/lsm/nstor.py b/lsm/lsm/nstor.py
index 172fe43..10f5525 100644
--- a/lsm/lsm/nstor.py
+++ b/lsm/lsm/nstor.py
@@ -590,37 +590,6 @@ class NexentaStor(INfs, IStorageAreaNetwork):
# return
- def volume_replicate_range_block_size(self, system, flags=0):
- """
- Returns the number of bytes per block for volume_replicate_range
- call. Callers of volume_replicate_range need to use this when
- calculating start and block lengths.
-
- Note: bytes per block may not match volume blocksize.
-
- Returns bytes per block.
- """
- raise LsmError(ErrorNumber.NO_SUPPORT, "This operation is not "
- "supported")
-
- def volume_replicate_range(self, rep_type, volume_src, volume_dest, ranges,
- flags=0):
- """
- Replicates a portion of a volume to itself or another volume. The src,
- dest and number of blocks values change with vendor, call
- volume_replicate_range_block_size to get block unit size.
-
- Returns Job id or None if completed, else raises LsmError on errors.
- """
- raise LsmError(ErrorNumber.NO_SUPPORT, "Replicate range operation is"
- " not supported")
-
- def volume_online(self, volume, flags=0):
- return
-
- def volume_offline(self, volume, flags=0):
- return
-
def iscsi_chap_auth(self, initiator, in_user, in_password, out_user,
out_password, flags=0):
"""
diff --git a/lsm/lsm/ontap.py b/lsm/lsm/ontap.py
index d52b3e4..5321c95 100644
--- a/lsm/lsm/ontap.py
+++ b/lsm/lsm/ontap.py
@@ -818,23 +818,6 @@ class Ontap(IStorageAreaNetwork, INfs):
self.f.iscsi_initiator_add_auth(initiator.id, in_user, in_password,
out_user, out_password)
- @handle_ontap_errors
- def initiator_grant(self, initiator_id, initiator_type, volume, access,
- flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_ontap_errors
- def initiator_revoke(self, initiator, volume, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_ontap_errors
- def volumes_accessible_by_initiator(self, initiator, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_ontap_errors
- def initiators_granted_to_volume(self, volume, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
@staticmethod
def _rpercent(total, current):
p = 1 - (current / float(total))
diff --git a/lsm/lsm/smis.py b/lsm/lsm/smis.py
index 4164381..2050fe7 100644
--- a/lsm/lsm/smis.py
+++ b/lsm/lsm/smis.py
@@ -1844,14 +1844,6 @@ class Smis(IStorageAreaNetwork):
raise LsmError(ErrorNumber.NO_SUPPORT,
"volume-replicate not supported")
- def volume_replicate_range_block_size(self, system, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- def volume_replicate_range(self, rep_type, volume_src, volume_dest,
- ranges,
- flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
@handle_cim_errors
def volume_online(self, volume, flags=0):
return None
@@ -2117,23 +2109,6 @@ class Smis(IStorageAreaNetwork):
cim_spcs = self._get_access_groups(property_list=cim_spc_pros)
return [self._new_access_group(cim_spc) for cim_spc in cim_spcs]
- @handle_cim_errors
- def access_group_create(self, name, initiator_id, id_type, system_id,
- flags=0):
- # page 880 1.5 spec. CreateMaskingView
- #
- # No access to a provider that implements this at this time,
- # so unable to develop and test.
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_cim_errors
- def access_group_del(self, group, flags=0):
- # page 880 1.5 spec. DeleteMaskingView
- #
- # No access to a provider that implements this at this time,
- # so unable to develop and test.
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
def _initiator_lookup(self, initiator_id):
"""
Looks up an initiator by initiator id
@@ -2182,27 +2157,6 @@ class Smis(IStorageAreaNetwork):
*(self._c.InvokeMethod('HidePaths', ccs.path,
**hide_params)))[0]
- @handle_cim_errors
- def iscsi_chap_auth(self, initiator, in_user, in_password, out_user,
- out_password, flags):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_cim_errors
- def initiator_grant(self, initiator_id, initiator_type, volume, access,
- flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_cim_errors
- def initiator_revoke(self, initiator, volume, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_cim_errors
- def volumes_accessible_by_initiator(self, initiator, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_cim_errors
- def initiators_granted_to_volume(self, volume, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
@handle_cim_errors
def job_free(self, job_id, flags=0):
@@ -2218,12 +2172,6 @@ class Smis(IStorageAreaNetwork):
except CIMError:
pass
- def volume_child_dependency(self, volume, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- def volume_child_dependency_rm(self, volume, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
@handle_cim_errors
def disks(self, flags=0):
"""
diff --git a/lsm/lsm/targetd.py b/lsm/lsm/targetd.py
index 3f0a5cf..8b5c235 100644
--- a/lsm/lsm/targetd.py
+++ b/lsm/lsm/targetd.py
@@ -235,15 +235,6 @@ class TargetdStorage(IStorageAreaNetwork, INfs):
return None, self._get_volume(pool_id, name)
@handle_errors
- def volume_replicate_range_block_size(self, system, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def volume_replicate_range(self, rep_type, volume_src, volume_dest,
- ranges, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
def volume_online(self, volume, flags=0):
vol_list = self._jsonrequest("vol_list", dict(pool=volume.pool_id))
@@ -254,48 +245,6 @@ class TargetdStorage(IStorageAreaNetwork, INfs):
return not self.volume_online(volume)
@handle_errors
- def volume_resize(self, volume, new_size_bytes, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def access_group_grant(self, group, volume, access, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def access_group_revoke(self, group, volume, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def access_group_list(self, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def access_group_create(self, name, initiator_id, id_type, system_id,
- flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def access_group_del(self, group, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def access_group_add_initiator(self, group, initiator_id, id_type,
- flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def access_group_del_initiator(self, group, initiator, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def volumes_accessible_by_access_group(self, group, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def access_groups_granted_to_volume(self, volume, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
def iscsi_chap_auth(self, initiator, in_user, in_password, out_user,
out_password, flags=0):
self._jsonrequest("initiator_set_auth",
@@ -362,14 +311,6 @@ class TargetdStorage(IStorageAreaNetwork, INfs):
return inits
@handle_errors
- def volume_child_dependency(self, volume, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def volume_child_dependency_rm(self, volume, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
def fs(self, flags=0):
rc = []
for fs in self._jsonrequest("fs_list"):
@@ -384,10 +325,6 @@ class TargetdStorage(IStorageAreaNetwork, INfs):
self._jsonrequest("fs_destroy", dict(uuid=fs.id))
@handle_errors
- def fs_resize(self, fs, new_size_bytes, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
def fs_create(self, pool, name, size_bytes, flags=0):
self._jsonrequest("fs_create", dict(pool_name=pool.id, name=name,
size_bytes=size_bytes))
@@ -408,11 +345,6 @@ class TargetdStorage(IStorageAreaNetwork, INfs):
return None, self._get_fs(src_fs.pool_id, dest_fs_name)
@handle_errors
- def file_clone(self, fs, src_file_name, dest_file_name, snapshot=None,
- flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
def fs_snapshots(self, fs, flags=0):
rc = []
for ss in self._jsonrequest("ss_list", dict(fs_uuid=fs.id)):
@@ -434,19 +366,6 @@ class TargetdStorage(IStorageAreaNetwork, INfs):
ss_uuid=snapshot.id))
@handle_errors
- def fs_snapshot_revert(self, fs, snapshot, files, restore_files,
- all_files=False, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def fs_child_dependency(self, fs, files, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
- def fs_child_dependency_rm(self, fs, files, flags=0):
- raise LsmError(ErrorNumber.NO_SUPPORT, "Not supported")
-
- @handle_errors
def export_auth(self, flags=0):
exports = self._jsonrequest("nfs_export_auth_list")
return exports
--
1.8.2.1
1.8.2.1