Fix tox errors and warnings in the devref

Formatting errors have crept into the manila devref
and have been accumulating over time. It would
be nice to fix these as part of the devref cleanup.

Closes-Bug: #1583850
Partially-implements: bp improve-manila-developer-docs
Change-Id: I7ec954e720b4b88a21e265cd71ea598ea9a5213b
This commit is contained in:
Goutham Pacha Ravi 2016-05-19 21:01:46 -04:00
parent e9776762a4
commit e4e61905ed
10 changed files with 94 additions and 78 deletions

View File

@ -170,7 +170,7 @@ Result::
+-------------+----------------------------------+ +-------------+----------------------------------+
4) Create the Share Filesystems service API endpoints:: 4) Create the Share Filesystems service API endpoints:
.. code-block:: console .. code-block:: console

View File

@ -185,7 +185,7 @@ Known Restrictions
- The library does not support network segmented multi-tenancy model but - The library does not support network segmented multi-tenancy model but
instead works over a flat network, where the tenants share a network. instead works over a flat network, where the tenants share a network.
.. _ganesha_known_issues .. _ganesha_known_issues:
Known Issues Known Issues
------------ ------------

View File

@ -14,7 +14,7 @@
under the License. under the License.
HPE 3PAR Driver HPE 3PAR Driver
============== ===============
The HPE 3PAR manila driver provides NFS and CIFS shared file systems to The HPE 3PAR manila driver provides NFS and CIFS shared file systems to
OpenStack using HPE 3PAR's File Persona capabilities. OpenStack using HPE 3PAR's File Persona capabilities.
@ -69,7 +69,7 @@ On the HPE 3PAR array:
- The array class and hardware configuration must support File Persona - The array class and hardware configuration must support File Persona
Pre-Configuration on the HPE 3PAR Pre-Configuration on the HPE 3PAR
-------------------------------- ---------------------------------
- HPE 3PAR File Persona must be initialized and started (:code:`startfs`) - HPE 3PAR File Persona must be initialized and started (:code:`startfs`)
- A File Provisioning Group (FPG) must be created for use with manila - A File Provisioning Group (FPG) must be created for use with manila
@ -232,7 +232,7 @@ the original functionality is honored and the file tree remains untouched.
be specified to create further customization. be specified to create further customization.
The :mod:`manila.share.drivers.hpe.hpe_3par_driver` Module The :mod:`manila.share.drivers.hpe.hpe_3par_driver` Module
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: manila.share.drivers.hpe.hpe_3par_driver .. automodule:: manila.share.drivers.hpe.hpe_3par_driver
:noindex: :noindex:

View File

@ -49,10 +49,10 @@ The :mod:`manila.scheduler.host_manager` Module
:show-inheritance: :show-inheritance:
The :mod:`manila.scheduler.rcpapi` Module The :mod:`manila.scheduler.rpcapi` Module
----------------------------------------- -----------------------------------------
.. automodule:: manila.scheduler.rcpapi .. automodule:: manila.scheduler.rpcapi
:noindex: :noindex:
:members: :members:
:undoc-members: :undoc-members:

View File

@ -27,13 +27,15 @@ class ShareReplicationFilter(base_host.BaseHostFilter):
"""Return True if 'active' replica's host can replicate with host. """Return True if 'active' replica's host can replicate with host.
Design of this filter: Design of this filter:
- Share replication is symmetric. All backends that can - Share replication is symmetric. All backends that can
replicate between each other must share the same replicate between each other must share the same
'replication_domain'. 'replication_domain'.
- For scheduling a share that can be replicated in the future, - For scheduling a share that can be replicated in the future,
this filter checks for 'replication_domain' capability. this filter checks for 'replication_domain' capability.
- For scheduling a replica, it checks for the - For scheduling a replica, it checks for the
'replication_domain' compatibility. 'replication_domain' compatibility.
""" """
active_replica_host = filter_properties.get('request_spec', {}).get( active_replica_host = filter_properties.get('request_spec', {}).get(
'active_replica_host') 'active_replica_host')

View File

@ -149,46 +149,47 @@ class HostState(object):
"""Update information about a host from its share_node info. """Update information about a host from its share_node info.
'capability' is the status info reported by share backend, a typical 'capability' is the status info reported by share backend, a typical
capability looks like this: capability looks like this::
capability = { capability = {
'share_backend_name': 'Local NFS', #\ 'share_backend_name': 'Local NFS', #\
'vendor_name': 'OpenStack', # backend level 'vendor_name': 'OpenStack', # backend level
'driver_version': '1.0', # mandatory/fixed 'driver_version': '1.0', # mandatory/fixed
'storage_protocol': 'NFS', #/ stats&capabilities 'storage_protocol': 'NFS', #/ stats&capabilities
'active_shares': 10, #\ 'active_shares': 10, #\
'IOPS_provisioned': 30000, # optional custom 'IOPS_provisioned': 30000, # optional custom
'fancy_capability_1': 'eat', # stats & capabilities 'fancy_capability_1': 'eat', # stats & capabilities
'fancy_capability_2': 'drink', #/ 'fancy_capability_2': 'drink', #/
'pools': [ 'pools':[
{'pool_name': '1st pool', #\ {
'total_capacity_gb': 500, # mandatory stats for 'pool_name': '1st pool', #\
'free_capacity_gb': 230, # pools 'total_capacity_gb': 500, # mandatory stats
'allocated_capacity_gb': 270, # | 'free_capacity_gb': 230, # for pools
'qos': 'False', # | 'allocated_capacity_gb': 270, # |
'reserved_percentage': 0, #/ 'qos': 'False', # |
'reserved_percentage': 0, #/
'dying_disks': 100, #\ 'dying_disks': 100, #\
'super_hero_1': 'spider-man', # optional custom 'super_hero_1': 'spider-man', # optional custom
'super_hero_2': 'flash', # stats & capabilities 'super_hero_2': 'flash', # stats &
'super_hero_3': 'neoncat' #/ 'super_hero_3': 'neoncat', # capabilities
}, 'super_hero_4': 'green lantern', #/
{'pool_name': '2nd pool', },
'total_capacity_gb': 1024, {
'free_capacity_gb': 1024, 'pool_name': '2nd pool',
'allocated_capacity_gb': 0, 'total_capacity_gb': 1024,
'qos': 'False', 'free_capacity_gb': 1024,
'reserved_percentage': 0, 'allocated_capacity_gb': 0,
'qos': 'False',
'reserved_percentage': 0,
'dying_disks': 200, 'dying_disks': 200,
'super_hero_1': 'superman', 'super_hero_1': 'superman',
'super_hero_2': ' ', 'super_hero_2': 'Hulk',
'super_hero_2': 'Hulk', }]
} }
]
}
""" """
self.update_capabilities(capability, service) self.update_capabilities(capability, service)

View File

@ -32,8 +32,8 @@ class SchedulerAPI(object):
1.0 - Initial version. 1.0 - Initial version.
1.1 - Add get_pools method 1.1 - Add get_pools method
1.2 - Introduce Share Instances: 1.2 - Introduce Share Instances. Replace ``create_share()`` with
Replace create_share() - > create_share_instance() ``create_share_instance()``
1.3 - Add create_consistency_group method 1.3 - Add create_consistency_group method
1.4 - Add migrate_share_to_host method 1.4 - Add migrate_share_to_host method
1.5 - Add create_share_replica 1.5 - Add create_share_replica

View File

@ -680,14 +680,27 @@ class ShareDriver(object):
the failure. the failure.
:param snapshot: ShareSnapshotInstance model with ShareSnapshot data. :param snapshot: ShareSnapshotInstance model with ShareSnapshot data.
Example:
{'id': <instance id>, 'snapshot_id': < snapshot id>, Example::
'provider_location': <location>, ......} {
'id': <instance id>,
'snapshot_id': < snapshot id>,
'provider_location': <location>,
...
}
:param driver_options: Optional driver-specific options provided :param driver_options: Optional driver-specific options provided
by admin. Example: by admin.
{'key': 'value', ......}
Example::
{
'key': 'value',
...
}
:return: model_update dictionary with required key 'size', :return: model_update dictionary with required key 'size',
which should contain size of the share snapshot. which should contain size of the share snapshot.
""" """
raise NotImplementedError() raise NotImplementedError()

View File

@ -140,15 +140,15 @@ class HDSHNASDriver(driver.ShareDriver):
:param context: The `context.RequestContext` object for the request :param context: The `context.RequestContext` object for the request
:param share: Share that will have its access rules updated. :param share: Share that will have its access rules updated.
:param access_rules: All access rules for given share. This list :param access_rules: All access rules for given share. This list
is enough to update the access rules for given share. is enough to update the access rules for given share.
:param add_rules: Empty List or List of access rules which should be :param add_rules: Empty List or List of access rules which should be
added. access_rules already contains these rules. Not used by this added. access_rules already contains these rules. Not used by this
driver. driver.
:param delete_rules: Empty List or List of access rules which should be :param delete_rules: Empty List or List of access rules which should be
removed. access_rules doesn't contain these rules. Not used by removed. access_rules doesn't contain these rules. Not used by
this driver. this driver.
:param share_server: Data structure with share server information. :param share_server: Data structure with share server information.
Not used by this driver. Not used by this driver.
""" """
try: try:
@ -186,9 +186,9 @@ class HDSHNASDriver(driver.ShareDriver):
:param context: The `context.RequestContext` object for the request :param context: The `context.RequestContext` object for the request
:param share: Share that will be created. :param share: Share that will be created.
:param share_server: Data structure with share server information. :param share_server: Data structure with share server information.
Not used by this driver. Not used by this driver.
:returns: Returns a path of EVS IP concatenate with the path :returns: Returns a path of EVS IP concatenate with the path
of share in the filesystem (e.g. ['172.24.44.10:/shares/id']). of share in the filesystem (e.g. ['172.24.44.10:/shares/id']).
""" """
LOG.debug("Creating share in HNAS: %(shr)s.", LOG.debug("Creating share in HNAS: %(shr)s.",
{'shr': share['id']}) {'shr': share['id']})
@ -210,7 +210,7 @@ class HDSHNASDriver(driver.ShareDriver):
:param context: The `context.RequestContext` object for the request :param context: The `context.RequestContext` object for the request
:param share: Share that will be deleted. :param share: Share that will be deleted.
:param share_server: Data structure with share server information. :param share_server: Data structure with share server information.
Not used by this driver. Not used by this driver.
""" """
share_id = self._get_hnas_share_id(share['id']) share_id = self._get_hnas_share_id(share['id'])
@ -225,7 +225,7 @@ class HDSHNASDriver(driver.ShareDriver):
:param context: The `context.RequestContext` object for the request :param context: The `context.RequestContext` object for the request
:param snapshot: Snapshot that will be created. :param snapshot: Snapshot that will be created.
:param share_server: Data structure with share server information. :param share_server: Data structure with share server information.
Not used by this driver. Not used by this driver.
""" """
share_id = self._get_hnas_share_id(snapshot['share_id']) share_id = self._get_hnas_share_id(snapshot['share_id'])
@ -242,8 +242,8 @@ class HDSHNASDriver(driver.ShareDriver):
:param context: The `context.RequestContext` object for the request :param context: The `context.RequestContext` object for the request
:param snapshot: Snapshot that will be deleted. :param snapshot: Snapshot that will be deleted.
:param share_server:Data structure with share server information. :param share_server: Data structure with share server information.
Not used by this driver. Not used by this driver.
""" """
share_id = self._get_hnas_share_id(snapshot['share_id']) share_id = self._get_hnas_share_id(snapshot['share_id'])
@ -262,11 +262,11 @@ class HDSHNASDriver(driver.ShareDriver):
:param context: The `context.RequestContext` object for the request :param context: The `context.RequestContext` object for the request
:param share: Information about the new share. :param share: Information about the new share.
:param snapshot: Information about the snapshot that will be copied :param snapshot: Information about the snapshot that will be copied
to new share. to new share.
:param share_server: Data structure with share server information. :param share_server: Data structure with share server information.
Not used by this driver. Not used by this driver.
:returns: Returns a path of EVS IP concatenate with the path :returns: Returns a path of EVS IP concatenate with the path
of new share in the filesystem (e.g. ['172.24.44.10:/shares/id']). of new share in the filesystem (e.g. ['172.24.44.10:/shares/id']).
""" """
LOG.debug("Creating a new share from snapshot: %(ss_id)s.", LOG.debug("Creating a new share from snapshot: %(ss_id)s.",
{'ss_id': snapshot['id']}) {'ss_id': snapshot['id']})
@ -284,9 +284,9 @@ class HDSHNASDriver(driver.ShareDriver):
:param context: The `context.RequestContext` object for the request :param context: The `context.RequestContext` object for the request
:param share: Share that will be checked. :param share: Share that will be checked.
:param share_server: Data structure with share server information. :param share_server: Data structure with share server information.
Not used by this driver. Not used by this driver.
:returns: Returns a list of EVS IP concatenated with the path :returns: Returns a list of EVS IP concatenated with the path
of share in the filesystem (e.g. ['172.24.44.10:/shares/id']). of share in the filesystem (e.g. ['172.24.44.10:/shares/id']).
""" """
LOG.debug("Ensuring share in HNAS: %(shr)s.", LOG.debug("Ensuring share in HNAS: %(shr)s.",
{'shr': share['id']}) {'shr': share['id']})
@ -308,7 +308,7 @@ class HDSHNASDriver(driver.ShareDriver):
:param share: Share that will be extended. :param share: Share that will be extended.
:param new_size: New size of share. :param new_size: New size of share.
:param share_server: Data structure with share server information. :param share_server: Data structure with share server information.
Not used by this driver. Not used by this driver.
""" """
share_id = self._get_hnas_share_id(share['id']) share_id = self._get_hnas_share_id(share['id'])
@ -365,7 +365,7 @@ class HDSHNASDriver(driver.ShareDriver):
:param share: Share that will be managed. :param share: Share that will be managed.
:param driver_options: Empty dict or dict with 'volume_id' option. :param driver_options: Empty dict or dict with 'volume_id' option.
:returns: Returns a dict with size of share managed :returns: Returns a dict with size of share managed
and its location (your path in file-system). and its location (your path in file-system).
""" """
share_id = self._get_hnas_share_id(share['id']) share_id = self._get_hnas_share_id(share['id'])
@ -426,7 +426,7 @@ class HDSHNASDriver(driver.ShareDriver):
:param share: Share that will be shrunk. :param share: Share that will be shrunk.
:param new_size: New size of share. :param new_size: New size of share.
:param share_server: Data structure with share server information. :param share_server: Data structure with share server information.
Not used by this driver. Not used by this driver.
""" """
share_id = self._get_hnas_share_id(share['id']) share_id = self._get_hnas_share_id(share['id'])
@ -453,7 +453,7 @@ class HDSHNASDriver(driver.ShareDriver):
:param share_id: ID of share that will be created. :param share_id: ID of share that will be created.
:param share_size: Size limit of share. :param share_size: Size limit of share.
:returns: Returns a path of /shares/share_id if the export was :returns: Returns a path of /shares/share_id if the export was
created successfully. created successfully.
""" """
path = '/shares/' + share_id path = '/shares/' + share_id
@ -559,7 +559,7 @@ class HDSHNASDriver(driver.ShareDriver):
:param share_id: ID of share that will be managed. :param share_id: ID of share that will be managed.
:returns: Returns a dict with size of share managed :returns: Returns a dict with size of share managed
and its location (your path in file-system). and its location (your path in file-system).
""" """
self._ensure_share(share_id) self._ensure_share(share_id)
@ -619,7 +619,7 @@ class HDSHNASDriver(driver.ShareDriver):
set a quota limit for it and export. set a quota limit for it and export.
:param share: a dict from new share. :param share: a dict from new share.
:param snapshot: a dict from snapshot that will be copied to :param snapshot: a dict from snapshot that will be copied to
new share. new share.
:returns: Returns the path for new share. :returns: Returns the path for new share.
""" """
dest_path = '/shares/' + share['id'] dest_path = '/shares/' + share['id']

View File

@ -43,7 +43,7 @@ class HuaweiNasDriver(driver.ShareDriver):
"""Huawei Share Driver. """Huawei Share Driver.
Executes commands relating to Shares. Executes commands relating to Shares.
API version history: API version history::
1.0 - Initial version. 1.0 - Initial version.
1.1 - Add shrink share. 1.1 - Add shrink share.