Merge "[DOC BLD FIX] Fix docstring issues for Hitachi HNAS driver"

This commit is contained in:
Jenkins 2017-07-24 23:50:03 +00:00 committed by Gerrit Code Review
commit 31a2ea5880
3 changed files with 58 additions and 32 deletions

View File

@ -96,12 +96,17 @@ class HNASSSHBackend(object):
"""Gets version information from the storage unit. """Gets version information from the storage unit.
:returns: dictionary with HNAS information :returns: dictionary with HNAS information
.. code:: python
storage_version={ storage_version={
'mac': HNAS MAC ID, 'mac': HNAS MAC ID,
'model': HNAS model, 'model': HNAS model,
'version': the software version, 'version': the software version,
'hardware': the hardware version, 'hardware': the hardware version,
'serial': HNAS serial number} 'serial': HNAS serial number
}
""" """
if not self.storage_version: if not self.storage_version:
version_info = {} version_info = {}
@ -131,11 +136,15 @@ class HNASSSHBackend(object):
"""Gets the IP addresses of all EVSs in HNAS. """Gets the IP addresses of all EVSs in HNAS.
:returns: dictionary with EVS information :returns: dictionary with EVS information
.. code:: python
evs_info={ evs_info={
<IP1>: {evs_number: number identifying the EVS1 on HNAS}, <IP1>: {evs_number: number identifying the EVS1 on HNAS},
<IP2>: {evs_number: number identifying the EVS2 on HNAS}, <IP2>: {evs_number: number identifying the EVS2 on HNAS},
... ...
} }
""" """
evs_info = {} evs_info = {}
out, err = self._run_cmd("evsipaddr", "-l") out, err = self._run_cmd("evsipaddr", "-l")
@ -154,6 +163,9 @@ class HNASSSHBackend(object):
:param fs_label: Label of the filesystem :param fs_label: Label of the filesystem
:returns: dictionary with FS information :returns: dictionary with FS information
.. code:: python
fs_info={ fs_info={
'id': a Logical Unit ID, 'id': a Logical Unit ID,
'label': a Logical Unit name, 'label': a Logical Unit name,
@ -163,6 +175,7 @@ class HNASSSHBackend(object):
'used_size': the size that is already used (in GB), 'used_size': the size that is already used (in GB),
'available_size': the free space (in GB) 'available_size': the free space (in GB)
} }
""" """
def _convert_size(param): def _convert_size(param):
size = float(param) * units.Mi size = float(param) * units.Mi
@ -401,7 +414,8 @@ class HNASSSHBackend(object):
:param file_path: path of the cloned file :param file_path: path of the cloned file
:param fs_label: filesystem of the cloned file :param fs_label: filesystem of the cloned file
:param raise_except: If True exception will be raised for files that :param raise_except: If True exception will be raised for files that
aren't clones. If False, only an error message is logged. aren't clones. If False, only an error message
is logged.
:returns: list with names of the related files :returns: list with names of the related files
""" """
relatives = [] relatives = []

View File

@ -319,6 +319,9 @@ class HNASNFSDriver(nfs.NfsDriver):
:param refresh: if it is True, update the stats first. :param refresh: if it is True, update the stats first.
:returns: dictionary with the stats from HNAS :returns: dictionary with the stats from HNAS
.. code:: python
_stats['pools'] = { _stats['pools'] = {
'total_capacity_gb': total size of the pool, 'total_capacity_gb': total size of the pool,
'free_capacity_gb': the available size, 'free_capacity_gb': the available size,
@ -327,6 +330,7 @@ class HNASNFSDriver(nfs.NfsDriver):
'max_over_subscription_ratio': oversubscription rate, 'max_over_subscription_ratio': oversubscription rate,
'thin_provisioning_support': thin support (True), 'thin_provisioning_support': thin support (True),
} }
""" """
LOG.info("Getting volume stats") LOG.info("Getting volume stats")

View File

@ -175,9 +175,17 @@ def read_xml_config(xml_config_file, svc_params, optional_params):
:param xml_config_file: string filename containing XML configuration :param xml_config_file: string filename containing XML configuration
:param svc_params: parameters to configure the services :param svc_params: parameters to configure the services
.. code:: python
['volume_type', 'hdp'] ['volume_type', 'hdp']
:param optional_params: parameters to configure that are not mandatory :param optional_params: parameters to configure that are not mandatory
.. code:: python
['ssc_cmd', 'cluster_admin_ip0', 'chap_enabled'] ['ssc_cmd', 'cluster_admin_ip0', 'chap_enabled']
""" """
if not os.access(xml_config_file, os.R_OK): if not os.access(xml_config_file, os.R_OK):