Package rtslib :: Module node :: Class CFSNode
[hide private]
[frames] | no frames]

Class CFSNode

object --+
         |
        CFSNode
Known Subclasses:

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
 
__eq__(self, other)
 
__ne__(self, other)
 
_get_path(self)
 
_create_in_cfs_ine(self, mode)
Creates the configFS node if it does not already exist, depending on the mode.
 
_exists(self)
 
_check_self(self)
 
_list_files(self, path, writable=None)
List files under a path depending on their owner's write permissions.
 
list_parameters(self, writable=None)
Returns: The list of existing RFC-3720 parameter names.
 
list_attributes(self, writable=None)
Returns: A list of existing attribute names as strings.
 
set_attribute(self, attribute, value)
Sets the value of a named attribute.
 
get_attribute(self, attribute)
Returns: The named attribute's value, as a string.
 
set_parameter(self, parameter, value)
Sets the value of a named RFC-3720 parameter.
 
get_parameter(self, parameter)
Returns: The named parameter value as a string.
 
delete(self)
If the underlying configFS object does not exist, this method does nothing.
 
dump(self)

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

Class Variables [hide private]
  configfs_dir = '/sys/kernel/config/target'
Properties [hide private]
  path
Get the configFS object path.
  exists
Is True as long as the underlying configFS object exists.

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

_create_in_cfs_ine(self, mode)

 

Creates the configFS node if it does not already exist, depending on the mode. any -> makes sure it exists, also works if the node already does exist lookup -> make sure it does NOT exist create -> create the node which must not exist beforehand

_list_files(self, path, writable=None)

 

List files under a path depending on their owner's write permissions.

Parameters:
  • path (str) - The path under which the files are expected to be. If the path itself is not a directory, an empty list will be returned.
  • writable (bool or None) - If None (default), returns all parameters, if True, returns read-write parameters, if False, returns just the read-only parameters.
Returns:
List of file names filtered according to their write perms.

list_parameters(self, writable=None)

 
Parameters:
  • writable (bool or None) - If None (default), returns all parameters, if True, returns read-write parameters, if False, returns just the read-only parameters.
Returns:
The list of existing RFC-3720 parameter names.

list_attributes(self, writable=None)

 
Parameters:
  • writable (bool or None) - If None (default), returns all attributes, if True, returns read-write attributes, if False, returns just the read-only attributes.
Returns:
A list of existing attribute names as strings.

set_attribute(self, attribute, value)

 

Sets the value of a named attribute. The attribute must exist in configFS.

Parameters:
  • attribute (string) - The attribute's name. It is case-sensitive.
  • value (string) - The attribute's value.

get_attribute(self, attribute)

 
Parameters:
  • attribute - The attribute's name. It is case-sensitive.
Returns:
The named attribute's value, as a string.

set_parameter(self, parameter, value)

 

Sets the value of a named RFC-3720 parameter. The parameter must exist in configFS.

Parameters:
  • parameter (string) - The RFC-3720 parameter's name. It is case-sensitive.
  • value (string) - The parameter's value.

get_parameter(self, parameter)

 
Parameters:
  • parameter (string) - The RFC-3720 parameter's name. It is case-sensitive.
Returns:
The named parameter value as a string.

delete(self)

 

If the underlying configFS object does not exist, this method does nothing. If the underlying configFS object exists, this method attempts to delete it.


Property Details [hide private]

path

Get the configFS object path.

Get Method:
_get_path(self)

exists

Is True as long as the underlying configFS object exists. If the underlying configFS objects gets deleted either by calling the delete() method, or by any other means, it will be False.

Get Method:
_exists(self)