summaryrefslogtreecommitdiff
path: root/nova/virt
diff options
context:
space:
mode:
authorDavanum Srinivas <dims@linux.vnet.ibm.com>2014-07-31 22:14:09 -0400
committerDavanum Srinivas (dims) <davanum@gmail.com>2014-08-08 22:07:04 +0000
commit07c9c1ba3ae310b725112804dbc2398630ec27a5 (patch)
tree9aa141cb9b9289e7e779729f0115d489f601ce7c /nova/virt
parent168484aba7acb31e69ce3bfecf5b145c13e71f15 (diff)
downloadnova-07c9c1ba3ae310b725112804dbc2398630ec27a5.tar.gz
docs - Fix docstring issues in virt tree
Fix the following errors in several files. ERROR: Unexpected indentation. ERROR: Unknown interpreted text role "paramref". WARNING: Block quote ends without a blank line; unexpected unindent. WARNING: Definition list ends without a blank line; unexpected unindent. WARNING: Enumerated list ends without a blank line; unexpected unindent. WARNING: Field list ends without a blank line; unexpected unindent. Specifically the "Unknown interpreted text role" was fixed by adding a separate import instead of importing 'text' directly. Others were indentation, new lines, or adding lists. Change-Id: I241ce1ca9831d9df00d022297ea622953a6fdc60
Diffstat (limited to 'nova/virt')
-rw-r--r--nova/virt/baremetal/db/sqlalchemy/migrate_repo/versions/010_add_preserve_ephemeral.py6
-rw-r--r--nova/virt/baremetal/pxe.py2
-rw-r--r--nova/virt/baremetal/tilera.py11
-rw-r--r--nova/virt/driver.py29
-rw-r--r--nova/virt/hyperv/vhdutils.py30
-rw-r--r--nova/virt/libvirt/driver.py4
-rw-r--r--nova/virt/libvirt/imagebackend.py6
-rw-r--r--nova/virt/vmwareapi/ds_util.py42
-rw-r--r--nova/virt/vmwareapi/vm_util.py23
-rw-r--r--nova/virt/vmwareapi/vmops.py31
-rw-r--r--nova/virt/xenapi/client/objects.py2
-rw-r--r--nova/virt/xenapi/driver.py6
-rw-r--r--nova/virt/xenapi/vm_utils.py4
13 files changed, 108 insertions, 88 deletions
diff --git a/nova/virt/baremetal/db/sqlalchemy/migrate_repo/versions/010_add_preserve_ephemeral.py b/nova/virt/baremetal/db/sqlalchemy/migrate_repo/versions/010_add_preserve_ephemeral.py
index c95c66d168..2cd5745327 100644
--- a/nova/virt/baremetal/db/sqlalchemy/migrate_repo/versions/010_add_preserve_ephemeral.py
+++ b/nova/virt/baremetal/db/sqlalchemy/migrate_repo/versions/010_add_preserve_ephemeral.py
@@ -13,7 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from sqlalchemy import Column, MetaData, Boolean, Table, text
+from sqlalchemy import Column, MetaData, Boolean, Table
+from sqlalchemy.sql import expression
COLUMN_NAME = 'preserve_ephemeral'
@@ -25,7 +26,8 @@ def upgrade(migrate_engine):
meta.bind = migrate_engine
t = Table(TABLE_NAME, meta, autoload=True)
- default = text('0') if migrate_engine.name == 'sqlite' else text('false')
+ default = (expression.text('0') if migrate_engine.name == 'sqlite'
+ else expression.text('false'))
preserve_ephemeral_col = Column(COLUMN_NAME, Boolean,
server_default=default)
t.create_column(preserve_ephemeral_col)
diff --git a/nova/virt/baremetal/pxe.py b/nova/virt/baremetal/pxe.py
index 72d5a02169..0266d347ee 100644
--- a/nova/virt/baremetal/pxe.py
+++ b/nova/virt/baremetal/pxe.py
@@ -195,7 +195,7 @@ def get_tftp_image_info(instance, flavor):
Raises NovaException if
- instance does not contain kernel_id or ramdisk_id
- deploy_kernel_id or deploy_ramdisk_id can not be read from
- flavor['extra_specs'] and defaults are not set
+ flavor['extra_specs'] and defaults are not set
"""
image_info = {
diff --git a/nova/virt/baremetal/tilera.py b/nova/virt/baremetal/tilera.py
index 6bd96c716a..fa324782bf 100644
--- a/nova/virt/baremetal/tilera.py
+++ b/nova/virt/baremetal/tilera.py
@@ -233,12 +233,13 @@ class Tilera(base.NodeDriver):
This method writes the instances config file, and then creates
symlinks for each MAC address in the instance.
- By default, the complete layout looks like this:
+ By default, the complete layout looks like this::
+
+ /tftpboot/
+ ./{uuid}/
+ kernel
+ ./fs_node_id/
- /tftpboot/
- ./{uuid}/
- kernel
- ./fs_node_id/
"""
get_tftp_image_info(instance)
(root_mb, swap_mb) = get_partition_sizes(instance)
diff --git a/nova/virt/driver.py b/nova/virt/driver.py
index b64459e2ad..035714c780 100644
--- a/nova/virt/driver.py
+++ b/nova/virt/driver.py
@@ -1035,11 +1035,13 @@ class ComputeDriver(object):
"""Get the currently known host CPU stats.
:returns: a dict containing the CPU stat info, eg:
- {'kernel': kern,
- 'idle': idle,
- 'user': user,
- 'iowait': wait,
- 'frequency': freq},
+
+ | {'kernel': kern,
+ | 'idle': idle,
+ | 'user': user,
+ | 'iowait': wait,
+ | 'frequency': freq},
+
where kern and user indicate the cumulative CPU time
(nanoseconds) spent by kernel and user processes
respectively, idle indicates the cumulative idle CPU time
@@ -1047,6 +1049,7 @@ class ComputeDriver(object):
time (nanoseconds), since the host is booting up; freq
indicates the current CPU frequency (MHz). All values are
long integers.
+
"""
raise NotImplementedError()
@@ -1135,13 +1138,15 @@ class ComputeDriver(object):
client API.
:return: None, or a set of DHCP options, eg:
- [{'opt_name': 'bootfile-name',
- 'opt_value': '/tftpboot/path/to/config'},
- {'opt_name': 'server-ip-address',
- 'opt_value': '1.2.3.4'},
- {'opt_name': 'tftp-server',
- 'opt_value': '1.2.3.4'}
- ]
+
+ | [{'opt_name': 'bootfile-name',
+ | 'opt_value': '/tftpboot/path/to/config'},
+ | {'opt_name': 'server-ip-address',
+ | 'opt_value': '1.2.3.4'},
+ | {'opt_name': 'tftp-server',
+ | 'opt_value': '1.2.3.4'}
+ | ]
+
"""
pass
diff --git a/nova/virt/hyperv/vhdutils.py b/nova/virt/hyperv/vhdutils.py
index af611efb6a..55c3a45658 100644
--- a/nova/virt/hyperv/vhdutils.py
+++ b/nova/virt/hyperv/vhdutils.py
@@ -118,21 +118,21 @@ class VHDUtils(object):
def get_internal_vhd_size_by_file_size(self, vhd_path, new_vhd_file_size):
"""Fixed VHD size = Data Block size + 512 bytes
- Dynamic_VHD_size = Dynamic Disk Header
- + Copy of hard disk footer
- + Hard Disk Footer
- + Data Block
- + BAT
- Dynamic Disk header fields
- Copy of hard disk footer (512 bytes)
- Dynamic Disk Header (1024 bytes)
- BAT (Block Allocation table)
- Data Block 1
- Data Block 2
- Data Block n
- Hard Disk Footer (512 bytes)
- Default block size is 2M
- BAT entry size is 4byte
+ | Dynamic_VHD_size = Dynamic Disk Header
+ | + Copy of hard disk footer
+ | + Hard Disk Footer
+ | + Data Block
+ | + BAT
+ | Dynamic Disk header fields
+ | Copy of hard disk footer (512 bytes)
+ | Dynamic Disk Header (1024 bytes)
+ | BAT (Block Allocation table)
+ | Data Block 1
+ | Data Block 2
+ | Data Block n
+ | Hard Disk Footer (512 bytes)
+ | Default block size is 2M
+ | BAT entry size is 4byte
"""
base_vhd_info = self.get_vhd_info(vhd_path)
vhd_type = base_vhd_info['Type']
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py
index 1675a92c4a..7699a88231 100644
--- a/nova/virt/libvirt/driver.py
+++ b/nova/virt/libvirt/driver.py
@@ -1851,8 +1851,8 @@ class LibvirtDriver(driver.ComputeDriver):
- snapshot_id : ID of snapshot
- type : qcow2 / <other>
- new_file : qcow2 file created by Cinder which
- becomes the VM's active image after
- the snapshot is complete
+ becomes the VM's active image after
+ the snapshot is complete
"""
LOG.debug("volume_snapshot_create: create_info: %(c_info)s",
diff --git a/nova/virt/libvirt/imagebackend.py b/nova/virt/libvirt/imagebackend.py
index 184d7fe742..d13dc2a695 100644
--- a/nova/virt/libvirt/imagebackend.py
+++ b/nova/virt/libvirt/imagebackend.py
@@ -110,9 +110,10 @@ class Image(object):
Contains specific behavior for each image type.
:prepare_template: function, that creates template.
- Should accept `target` argument.
+ Should accept `target` argument.
:base: Template name
:size: Size of created image in bytes
+
"""
pass
@@ -656,7 +657,8 @@ class Backend(object):
:instance: Instance name.
:name: Image name.
:image_type: Image type.
- Optional, is CONF.libvirt.images_type by default.
+ Optional, is CONF.libvirt.images_type by default.
+
"""
backend = self.backend(image_type)
return backend(instance=instance, disk_name=disk_name)
diff --git a/nova/virt/vmwareapi/ds_util.py b/nova/virt/vmwareapi/ds_util.py
index 8db0e665b0..1cf523a917 100644
--- a/nova/virt/vmwareapi/ds_util.py
+++ b/nova/virt/vmwareapi/ds_util.py
@@ -94,12 +94,14 @@ class DatastorePath(object):
file path to a virtual disk.
Note:
- - Datastore path representations always uses forward slash as separator
+
+ * Datastore path representations always uses forward slash as separator
(hence the use of the posixpath module).
- - Datastore names are enclosed in square brackets.
- - Path part of datastore path is relative to the root directory
+ * Datastore names are enclosed in square brackets.
+ * Path part of datastore path is relative to the root directory
of the datastore, and is always separated from the [ds_name] part with
a single space.
+
"""
VMDK_EXTENSION = "vmdk"
@@ -338,22 +340,24 @@ def file_move(session, dc_ref, src_file, dst_file):
The list of possible faults that the server can return on error
include:
- - CannotAccessFile: Thrown if the source file or folder cannot be
- moved because of insufficient permissions.
- - FileAlreadyExists: Thrown if a file with the given name already
- exists at the destination.
- - FileFault: Thrown if there is a generic file error
- - FileLocked: Thrown if the source file or folder is currently
- locked or in use.
- - FileNotFound: Thrown if the file or folder specified by sourceName
- is not found.
- - InvalidDatastore: Thrown if the operation cannot be performed on
- the source or destination datastores.
- - NoDiskSpace: Thrown if there is not enough space available on the
- destination datastore.
- - RuntimeFault: Thrown if any type of runtime fault is thrown that
- is not covered by the other faults; for example,
- a communication error.
+
+ * CannotAccessFile: Thrown if the source file or folder cannot be
+ moved because of insufficient permissions.
+ * FileAlreadyExists: Thrown if a file with the given name already
+ exists at the destination.
+ * FileFault: Thrown if there is a generic file error
+ * FileLocked: Thrown if the source file or folder is currently
+ locked or in use.
+ * FileNotFound: Thrown if the file or folder specified by sourceName
+ is not found.
+ * InvalidDatastore: Thrown if the operation cannot be performed on
+ the source or destination datastores.
+ * NoDiskSpace: Thrown if there is not enough space available on the
+ destination datastore.
+ * RuntimeFault: Thrown if any type of runtime fault is thrown that
+ is not covered by the other faults; for example,
+ a communication error.
+
"""
LOG.debug("Moving file from %(src)s to %(dst)s.",
{'src': src_file, 'dst': dst_file})
diff --git a/nova/virt/vmwareapi/vm_util.py b/nova/virt/vmwareapi/vm_util.py
index 0f90ab8a44..868a8bf6ba 100644
--- a/nova/virt/vmwareapi/vm_util.py
+++ b/nova/virt/vmwareapi/vm_util.py
@@ -1048,9 +1048,9 @@ def propset_dict(propset):
that are returned by the VMware API.
You can read more about these at:
- http://pubs.vmware.com/vsphere-51/index.jsp
- #com.vmware.wssdk.apiref.doc/
- vmodl.query.PropertyCollector.ObjectContent.html
+ | http://pubs.vmware.com/vsphere-51/index.jsp
+ | #com.vmware.wssdk.apiref.doc/
+ | vmodl.query.PropertyCollector.ObjectContent.html
:param propset: a property "set" from ObjectContent
:return: dictionary representing property set
@@ -1186,14 +1186,15 @@ def get_dict_mor(session, list_obj):
{ value = "domain-1002", _type = "ClusterComputeResource" }
Output data format:
- dict_mors = {
- 'respool-1001': { 'cluster_mor': clusterMor,
- 'res_pool_mor': resourcePoolMor,
- 'name': display_name },
- 'domain-1002': { 'cluster_mor': clusterMor,
- 'res_pool_mor': resourcePoolMor,
- 'name': display_name },
- }
+ | dict_mors = {
+ | 'respool-1001': { 'cluster_mor': clusterMor,
+ | 'res_pool_mor': resourcePoolMor,
+ | 'name': display_name },
+ | 'domain-1002': { 'cluster_mor': clusterMor,
+ | 'res_pool_mor': resourcePoolMor,
+ | 'name': display_name },
+ | }
+
"""
dict_mors = {}
for obj_ref, path in list_obj:
diff --git a/nova/virt/vmwareapi/vmops.py b/nova/virt/vmwareapi/vmops.py
index 324137de24..15af1feb35 100644
--- a/nova/virt/vmwareapi/vmops.py
+++ b/nova/virt/vmwareapi/vmops.py
@@ -168,20 +168,25 @@ class VMwareVMOps(object):
Steps followed are:
- 1. Create a VM with no disk and the specifics in the instance object
+ #. Create a VM with no disk and the specifics in the instance object
like RAM size.
- 2. For flat disk
- 2.1. Create a dummy vmdk of the size of the disk file that is to be
- uploaded. This is required just to create the metadata file.
- 2.2. Delete the -flat.vmdk file created in the above step and retain
- the metadata .vmdk file.
- 2.3. Upload the disk file.
- 3. For sparse disk
- 3.1. Upload the disk file to a -sparse.vmdk file.
- 3.2. Copy/Clone the -sparse.vmdk file to a thin vmdk.
- 3.3. Delete the -sparse.vmdk file.
- 4. Attach the disk to the VM by reconfiguring the same.
- 5. Power on the VM.
+ #. For flat disk
+
+ #. Create a dummy vmdk of the size of the disk file that is to be
+ uploaded. This is required just to create the metadata file.
+ #. Delete the -flat.vmdk file created in the above step and retain
+ the metadata .vmdk file.
+ #. Upload the disk file.
+
+ #. For sparse disk
+
+ #. Upload the disk file to a -sparse.vmdk file.
+ #. Copy/Clone the -sparse.vmdk file to a thin vmdk.
+ #. Delete the -sparse.vmdk file.
+
+ #. Attach the disk to the VM by reconfiguring the same.
+ #. Power on the VM.
+
"""
ebs_root = False
if block_device_info:
diff --git a/nova/virt/xenapi/client/objects.py b/nova/virt/xenapi/client/objects.py
index a358d41b8e..5cc91eb4c7 100644
--- a/nova/virt/xenapi/client/objects.py
+++ b/nova/virt/xenapi/client/objects.py
@@ -46,7 +46,7 @@ class XenAPISessionObject(object):
to use get_all(), but this often leads to races as objects
get deleted under your feet. It is preferable to use the undocumented:
* vms = session.VM.get_all_records_where(
- 'field "is_control_domain"="true"')
+ 'field "is_control_domain"="true"')
"""
diff --git a/nova/virt/xenapi/driver.py b/nova/virt/xenapi/driver.py
index 9cd6fd4be2..3019aad7ec 100644
--- a/nova/virt/xenapi/driver.py
+++ b/nova/virt/xenapi/driver.py
@@ -584,7 +584,8 @@ class XenAPIDriver(driver.ComputeDriver):
nova.db.sqlalchemy.models.Instance object
instance object that is migrated.
:param network_info: instance network information
- :param : block_migration: if true, post operation of block_migration.
+ :param block_migration: if true, post operation of block_migration.
+
"""
self._vmops.post_live_migration_at_destination(context, instance,
network_info, block_device_info, block_device_info)
@@ -677,7 +678,6 @@ class XenAPIDriver(driver.ComputeDriver):
def get_per_instance_usage(self):
"""Get information about instance resource usage.
- :returns: dict of nova uuid => dict of usage
- info
+ :returns: dict of nova uuid => dict of usage info
"""
return self._vmops.get_per_instance_usage()
diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py
index d22d1e07ce..e7106197dc 100644
--- a/nova/virt/xenapi/vm_utils.py
+++ b/nova/virt/xenapi/vm_utils.py
@@ -1718,8 +1718,8 @@ def lookup_vm_vdis(session, vm_ref):
def lookup(session, name_label, check_rescue=False):
"""Look the instance up and return it if available.
- :param check_rescue: if True will return the 'name'-rescue vm if it
- exists, instead of just 'name'
+ :param:check_rescue: if True will return the 'name'-rescue vm if it
+ exists, instead of just 'name'
"""
if check_rescue:
result = lookup(session, name_label + '-rescue', False)