Package rtslib :: Module fabric :: Class _BaseFabricModule
[hide private]
[frames] | no frames]

Class _BaseFabricModule

  object --+    
           |    
node.CFSNode --+
               |
              _BaseFabricModule

Abstract Base clase for Fabric Modules. It can load modules, provide information about them and handle the configfs housekeeping. After instantiation, whether or not the fabric module is loaded depends on if a method requiring it (i.e. accessing configfs) is used. This helps limit loaded kernel modules to just the fabrics in use.

Instance Methods [hide private]
 
__init__(self, name)
Instantiate a FabricModule object, according to the provided name.
 
_check_self(self)
 
has_feature(self, feature)
 
_list_targets(self)
 
_get_version(self)
 
to_normalized_wwn(self, wwn)
Checks whether or not the provided WWN is valid for this fabric module according to the spec, and returns a tuple of our preferred string representation of the wwn, and what type it turned out to be.
 
to_fabric_wwn(self, wwn)
Some fabrics need WWNs in a format different than rtslib's internal format.
 
from_fabric_wwn(self, wwn)
Converts from WWN format used in this fabric's LIO configfs to canonical format.
 
needs_wwn(self)
This fabric requires wwn to be specified when creating a target, it cannot be autogenerated.
 
_assert_feature(self, feature)
 
clear_discovery_auth_settings(self)
 
_get_discovery_enable_auth(self)
 
_set_discovery_enable_auth(self, enable)
 
_get_discovery_authenticate_target(self)
 
_get_wwns(self)
Returns either iterable or None.
 
_get_disc_attr(self, *args, **kwargs)
 
_set_disc_attr(self, *args, **kwargs)
 
setup(self, fm, err_func)
Setup fabricmodule with settings from fm dict.
 
dump(self)

Inherited from node.CFSNode: __eq__, __ne__, delete, get_attribute, get_parameter, list_attributes, list_parameters, set_attribute, set_parameter

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  discovery_enable_auth = property(_get_discovery_enable_auth, _...
  discovery_authenticate_target = property(_get_discovery_authen...
  discovery_userid = property(partial(_get_disc_attr, attribute=...
  discovery_password = property(partial(_get_disc_attr, attribut...
  discovery_mutual_userid = property(partial(_get_disc_attr, att...
  discovery_mutual_password = property(partial(_get_disc_attr, a...
  targets = property(_list_targets, doc= "Get the list of target...
  version = property(_get_version, doc= "Get the fabric module v...
  wwns = property(_get_wwns, doc= "iterable of WWNs present for ...

Inherited from node.CFSNode: configfs_dir, exists, path

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, name)
(Constructor)

 

Instantiate a FabricModule object, according to the provided name.

Parameters:
  • name (str) - the name of the FabricModule object. It must match an existing target fabric module specfile (name.spec).
Overrides: object.__init__

_check_self(self)

 
Overrides: node.CFSNode._check_self

to_fabric_wwn(self, wwn)

 

Some fabrics need WWNs in a format different than rtslib's internal format. These fabrics should override this method.

from_fabric_wwn(self, wwn)

 

Converts from WWN format used in this fabric's LIO configfs to canonical format. Note: Do not call from wwns(). There's no guarantee fabric wwn format is the same as wherever wwns() is reading from.

_get_wwns(self)

 

Returns either iterable or None. None means fabric allows arbitrary WWNs.

dump(self)

 
Overrides: node.CFSNode.dump

Class Variable Details [hide private]

discovery_enable_auth

Value:
property(_get_discovery_enable_auth, _set_discovery_enable_auth, doc= \
"Set or get the discovery enable_auth flag.")

discovery_authenticate_target

Value:
property(_get_discovery_authenticate_target, doc= "Get the boolean dis\
covery authenticate target flag.")

discovery_userid

Value:
property(partial(_get_disc_attr, attribute= 'discovery_auth/userid'), \
partial(_set_disc_attr, attribute= 'discovery_auth/userid'), doc= "Set\
 or get the initiator discovery userid.")

discovery_password

Value:
property(partial(_get_disc_attr, attribute= 'discovery_auth/password')\
, partial(_set_disc_attr, attribute= 'discovery_auth/password'), doc= \
"Set or get the initiator discovery password.")

discovery_mutual_userid

Value:
property(partial(_get_disc_attr, attribute= 'discovery_auth/userid_mut\
ual'), partial(_set_disc_attr, attribute= 'discovery_auth/userid_mutua\
l'), doc= "Set or get the mutual discovery userid.")

discovery_mutual_password

Value:
property(partial(_get_disc_attr, attribute= 'discovery_auth/password_m\
utual'), partial(_set_disc_attr, attribute= 'discovery_auth/password_m\
utual'), doc= "Set or get the mutual discovery password.")

targets

Value:
property(_list_targets, doc= "Get the list of target objects.")

version

Value:
property(_get_version, doc= "Get the fabric module version string.")

wwns

Value:
property(_get_wwns, doc= "iterable of WWNs present for this fabric")