diff --git a/doc/source/deploy/drivers.rst b/doc/source/deploy/drivers.rst index 52a72195a3..427aa2b3d1 100644 --- a/doc/source/deploy/drivers.rst +++ b/doc/source/deploy/drivers.rst @@ -35,7 +35,7 @@ Software Requirements ^^^^^^^^^^^^^^^^^^^^^ - The PySNMP package must be installed, variously referred to as ``pysnmp`` -or ``python-pysnmp`` + or ``python-pysnmp`` Enabling the SNMP Power Driver ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -52,12 +52,12 @@ added to ``driver_info``: - ``snmp_address``: the IPv4 address of the PDU controlling this node. - ``snmp_port``: (optional) A non-standard UDP port to use for SNMP operations. -If not specified, the default port (161) is used. + If not specified, the default port (161) is used. - ``snmp_outlet``: The power outlet on the PDU (1-based indexing). - ``snmp_protocol``: (optional) SNMP protocol version -(permitted values ``1``, ``2c`` or ``3``). If not specified, SNMPv1 is chosen. + (permitted values ``1``, ``2c`` or ``3``). If not specified, SNMPv1 is chosen. - ``snmp_community``: (Required for SNMPv1 and SNMPv2c) SNMP community -parameter for reads and writes to the PDU. + parameter for reads and writes to the PDU. - ``snmp_security``: (Required for SNMPv3) SNMP security string. PDU Configuration diff --git a/doc/source/dev/api.rst b/doc/source/dev/api.rst index 43c67dc04b..ebbea25431 100644 --- a/doc/source/dev/api.rst +++ b/doc/source/dev/api.rst @@ -1,8 +1,8 @@ .. _api: -=========== +=================== Ironic's API Server -=========== +=================== .. toctree:: ../api/ironic.api.hooks diff --git a/ironic/common/dhcp_factory.py b/ironic/common/dhcp_factory.py index bca51989da..56892d3235 100644 --- a/ironic/common/dhcp_factory.py +++ b/ironic/common/dhcp_factory.py @@ -80,12 +80,15 @@ class DHCPFactory(object): :param task: A TaskManager instance. :param dhcp_opts: this will be a list of dicts, e.g. - [{'opt_name': 'bootfile-name', - 'opt_value': 'pxelinux.0'}, - {'opt_name': 'server-ip-address', - 'opt_value': '123.123.123.456'}, - {'opt_name': 'tftp-server', - 'opt_value': '123.123.123.123'}] + + :: + + [{'opt_name': 'bootfile-name', + 'opt_value': 'pxelinux.0'}, + {'opt_name': 'server-ip-address', + 'opt_value': '123.123.123.456'}, + {'opt_name': 'tftp-server', + 'opt_value': '123.123.123.123'}] """ self.provider.update_dhcp_opts(task, dhcp_opts) diff --git a/ironic/common/glance_service/v2/image_service.py b/ironic/common/glance_service/v2/image_service.py index 030dbc3e8f..5d30dd1074 100644 --- a/ironic/common/glance_service/v2/image_service.py +++ b/ironic/common/glance_service/v2/image_service.py @@ -110,17 +110,17 @@ class GlanceImageService(base_image_service.BaseImageService, an auth_token. :param image_info: The return from a GET request to Glance for a - certain image_id. Should be a dictionary, with keys like 'name' and - 'checksum'. See - http://docs.openstack.org/developer/glance/glanceapi.html for - examples. + certain image_id. Should be a dictionary, with keys like 'name' and + 'checksum'. See + http://docs.openstack.org/developer/glance/glanceapi.html for + examples. :returns: A signed Swift URL from which an image can be downloaded, - without authentication. + without authentication. :raises: InvalidParameterValue if Swift config options are not set - correctly. + correctly. :raises: ImageUnacceptable if the image info from Glance does not - have a image ID. + have a image ID. """ self._validate_temp_url_config() diff --git a/ironic/common/hash_ring.py b/ironic/common/hash_ring.py index 6c8de3f3b6..a79ff344df 100644 --- a/ironic/common/hash_ring.py +++ b/ironic/common/hash_ring.py @@ -56,7 +56,8 @@ CONF.register_opts(hash_opts) class HashRing(object): """A stable hash ring. - We map item N to a host Y based on the closest lower hash + We map item N to a host Y based on the closest lower hash: + - hash(item) -> partition - hash(host) -> divider - closest lower divider is the host to use diff --git a/ironic/conductor/rpcapi.py b/ironic/conductor/rpcapi.py index 303442a63e..b2019ff8d4 100644 --- a/ironic/conductor/rpcapi.py +++ b/ironic/conductor/rpcapi.py @@ -35,29 +35,29 @@ class ConductorAPI(object): API version history: - 1.0 - Initial version. - Included get_node_power_status - 1.1 - Added update_node and start_power_state_change. - 1.2 - Added vendor_passhthru. - 1.3 - Rename start_power_state_change to change_node_power_state. - 1.4 - Added do_node_deploy and do_node_tear_down. - 1.5 - Added validate_driver_interfaces. - 1.6 - change_node_power_state, do_node_deploy and do_node_tear_down - accept node id instead of node object. - 1.7 - Added topic parameter to RPC methods. - 1.8 - Added change_node_maintenance_mode. - 1.9 - Added destroy_node. - 1.10 - Remove get_node_power_state - 1.11 - Added get_console_information, set_console_mode. - 1.12 - validate_vendor_action, do_vendor_action replaced by single - vendor_passthru method. - 1.13 - Added update_port. - 1.14 - Added driver_vendor_passthru. - 1.15 - Added rebuild parameter to do_node_deploy. - 1.16 - Added get_driver_properties. - 1.17 - Added set_boot_device, get_boot_device and - get_supported_boot_devices. - 1.18 - Remove change_node_maintenance_mode. + | 1.0 - Initial version. + | Included get_node_power_status + | 1.1 - Added update_node and start_power_state_change. + | 1.2 - Added vendor_passhthru. + | 1.3 - Rename start_power_state_change to change_node_power_state. + | 1.4 - Added do_node_deploy and do_node_tear_down. + | 1.5 - Added validate_driver_interfaces. + | 1.6 - change_node_power_state, do_node_deploy and do_node_tear_down + | accept node id instead of node object. + | 1.7 - Added topic parameter to RPC methods. + | 1.8 - Added change_node_maintenance_mode. + | 1.9 - Added destroy_node. + | 1.10 - Remove get_node_power_state + | 1.11 - Added get_console_information, set_console_mode. + | 1.12 - validate_vendor_action, do_vendor_action replaced by single + | vendor_passthru method. + | 1.13 - Added update_port. + | 1.14 - Added driver_vendor_passthru. + | 1.15 - Added rebuild parameter to do_node_deploy. + | 1.16 - Added get_driver_properties. + | 1.17 - Added set_boot_device, get_boot_device and + | get_supported_boot_devices. + | 1.18 - Remove change_node_maintenance_mode. """ diff --git a/ironic/conductor/task_manager.py b/ironic/conductor/task_manager.py index 79e4d6d308..f19a916866 100644 --- a/ironic/conductor/task_manager.py +++ b/ironic/conductor/task_manager.py @@ -41,16 +41,23 @@ determine whether their invocation requires an exclusive lock. The TaskManager instance exposes certain node resources and properties as attributes that you may access: - task.context -- The context passed to TaskManager() - task.shared -- False if Node is locked, True if it is not locked. (The - 'shared' kwarg arg of TaskManager()) - task.node -- The Node object - task.ports -- Ports belonging to the Node - task.driver -- The Driver for the Node, or the Driver based on the - 'driver_name' kwarg of TaskManager(). + task.context + The context passed to TaskManager() + task.shared + False if Node is locked, True if it is not locked. (The + 'shared' kwarg arg of TaskManager()) + task.node + The Node object + task.ports + Ports belonging to the Node + task.driver + The Driver for the Node, or the Driver based on the + 'driver_name' kwarg of TaskManager(). Example usage: +:: + with task_manager.acquire(context, node_id) as task: task.driver.power.power_on(task.node) @@ -59,6 +66,8 @@ TaskManager instance provides an interface to handle this for you, making sure to release resources when exceptions occur or when the thread finishes. Common use of this is within the Manager like so: +:: + with task_manager.acquire(context, node_id) as task: task.spawn_after(self._spawn_worker, @@ -72,6 +81,8 @@ with a try..exception block (like the API cases where we return after the spawn_after()) the task allows you to set a hook to execute custom code when the spawned task generates an exception: +:: + def on_error(e): if isinstance(e, Exception): ... diff --git a/ironic/db/api.py b/ironic/db/api.py index c038bb71df..9b2bf22e04 100644 --- a/ironic/db/api.py +++ b/ironic/db/api.py @@ -51,14 +51,16 @@ class Connection(object): :param columns: List of column names to return. Defaults to 'id' column when columns == None. :param filters: Filters to apply. Defaults to None. - 'associated': True | False - 'reserved': True | False - 'maintenance': True | False - 'chassis_uuid': uuid of chassis - 'driver': driver's name - 'provision_state': provision state of node - 'provisioned_before': nodes with provision_updated_at - field before this interval in seconds + + :associated: True | False + :reserved: True | False + :maintenance: True | False + :chassis_uuid: uuid of chassis + :driver: driver's name + :provision_state: provision state of node + :provisioned_before: + nodes with provision_updated_at field before this + interval in seconds :param limit: Maximum number of nodes to return. :param marker: the last item of the previous page; we return the next result set. @@ -74,14 +76,16 @@ class Connection(object): """Return a list of nodes. :param filters: Filters to apply. Defaults to None. - 'associated': True | False - 'reserved': True | False - 'maintenance': True | False - 'chassis_uuid': uuid of chassis - 'driver': driver's name - 'provision_state': provision state of node - 'provisioned_before': nodes with provision_updated_at - field before this interval in seconds + + :associated: True | False + :reserved: True | False + :maintenance: True | False + :chassis_uuid: uuid of chassis + :driver: driver's name + :provision_state: provision state of node + :provisioned_before: + nodes with provision_updated_at field before this + interval in seconds :param limit: Maximum number of nodes to return. :param marker: the last item of the previous page; we return the next result set. @@ -124,6 +128,8 @@ class Connection(object): and track the node, and several dicts which are passed into the Drivers when managing this node. For example: + :: + { 'uuid': utils.generate_uuid(), 'instance_uuid': None, @@ -177,13 +183,15 @@ class Connection(object): May be a partial list, eg. when setting the properties for a driver. For example: - { - 'driver_info': - { - 'my-field-1': val1, - 'my-field-2': val2, - } - } + :: + + { + 'driver_info': + { + 'my-field-1': val1, + 'my-field-2': val2, + } + } :returns: A node. :raises: NodeAssociated :raises: NodeNotFound @@ -321,11 +329,14 @@ class Connection(object): """Register an active conductor with the cluster. :param values: A dict of values which must contain the following: - { - 'hostname': the unique hostname which identifies - this Conductor service. - 'drivers': a list of supported drivers. - } + + :: + + { + 'hostname': the unique hostname which identifies + this Conductor service. + 'drivers': a list of supported drivers. + } :param update_existing: When false, registration will raise an exception when a conflicting online record is found. When true, will overwrite the @@ -366,6 +377,9 @@ class Connection(object): :param interval: Seconds since last check-in of a conductor. :returns: A dict which maps driver names to the set of hosts which support them. For example: + + :: + {driverA: set([host1, host2]), driverB: set([host2, host3])} """ diff --git a/ironic/dhcp/base.py b/ironic/dhcp/base.py index 8c15704eca..624a8901c3 100644 --- a/ironic/dhcp/base.py +++ b/ironic/dhcp/base.py @@ -33,12 +33,15 @@ class BaseDHCP(object): :param port_id: designate which port these attributes will be applied to. :param dhcp_options: this will be a list of dicts, e.g. - [{'opt_name': 'bootfile-name', - 'opt_value': 'pxelinux.0'}, - {'opt_name': 'server-ip-address', - 'opt_value': '123.123.123.456'}, - {'opt_name': 'tftp-server', - 'opt_value': '123.123.123.123'}] + + :: + + [{'opt_name': 'bootfile-name', + 'opt_value': 'pxelinux.0'}, + {'opt_name': 'server-ip-address', + 'opt_value': '123.123.123.456'}, + {'opt_name': 'tftp-server', + 'opt_value': '123.123.123.123'}] :raises: FailedToUpdateDHCPOptOnPort """ @@ -58,12 +61,15 @@ class BaseDHCP(object): :param task: A TaskManager instance. :param options: this will be a list of dicts, e.g. - [{'opt_name': 'bootfile-name', - 'opt_value': 'pxelinux.0'}, - {'opt_name': 'server-ip-address', - 'opt_value': '123.123.123.456'}, - {'opt_name': 'tftp-server', - 'opt_value': '123.123.123.123'}] + + :: + + [{'opt_name': 'bootfile-name', + 'opt_value': 'pxelinux.0'}, + {'opt_name': 'server-ip-address', + 'opt_value': '123.123.123.456'}, + {'opt_name': 'tftp-server', + 'opt_value': '123.123.123.123'}] :raises: FailedToUpdateDHCPOptOnPort """ diff --git a/ironic/dhcp/neutron.py b/ironic/dhcp/neutron.py index c5dae49c28..4c0012b95d 100644 --- a/ironic/dhcp/neutron.py +++ b/ironic/dhcp/neutron.py @@ -98,12 +98,15 @@ class NeutronDHCPApi(base.BaseDHCP): :param port_id: designate which port these attributes will be applied to. :param dhcp_options: this will be a list of dicts, e.g. - [{'opt_name': 'bootfile-name', - 'opt_value': 'pxelinux.0'}, - {'opt_name': 'server-ip-address', - 'opt_value': '123.123.123.456'}, - {'opt_name': 'tftp-server', - 'opt_value': '123.123.123.123'}] + + :: + + [{'opt_name': 'bootfile-name', + 'opt_value': 'pxelinux.0'}, + {'opt_name': 'server-ip-address', + 'opt_value': '123.123.123.456'}, + {'opt_name': 'tftp-server', + 'opt_value': '123.123.123.123'}] :param token: optional auth token. :raises: FailedToUpdateDHCPOptOnPort @@ -136,12 +139,15 @@ class NeutronDHCPApi(base.BaseDHCP): :param task: A TaskManager instance. :param dhcp_opts: this will be a list of dicts, e.g. - [{'opt_name': 'bootfile-name', - 'opt_value': 'pxelinux.0'}, - {'opt_name': 'server-ip-address', - 'opt_value': '123.123.123.456'}, - {'opt_name': 'tftp-server', - 'opt_value': '123.123.123.123'}] + + :: + + [{'opt_name': 'bootfile-name', + 'opt_value': 'pxelinux.0'}, + {'opt_name': 'server-ip-address', + 'opt_value': '123.123.123.456'}, + {'opt_name': 'tftp-server', + 'opt_value': '123.123.123.123'}] """ vifs = network.get_node_vif_ids(task) if not vifs: diff --git a/ironic/drivers/base.py b/ironic/drivers/base.py index ea2c075033..7b597fe37b 100644 --- a/ironic/drivers/base.py +++ b/ironic/drivers/base.py @@ -470,10 +470,13 @@ class ManagementInterface(object): :param task: a task from TaskManager. :raises: MissingParameterValue if a required parameter is missing :returns: a dictionary containing: - :boot_device: the boot device, one of - :mod:`ironic.common.boot_devices` or None if it is unknown. - :persistent: Whether the boot device will persist to all - future boots or not, None if it is unknown. + + :boot_device: + the boot device, one of :mod:`ironic.common.boot_devices` or + None if it is unknown. + :persistent: + Whether the boot device will persist to all future boots or + not, None if it is unknown. """ @@ -486,7 +489,11 @@ class ManagementInterface(object): :raises: FailedToParseSensorData when parsing sensor data fails. :returns: returns a consistent format dict of sensor data grouped by sensor type, which can be processed by Ceilometer. - eg, { + eg, + + :: + + { 'Sensor Type 1': { 'Sensor ID 1': { 'Sensor Reading': 'current value', diff --git a/ironic/drivers/pxe.py b/ironic/drivers/pxe.py index e0d9ee2b13..1e454b5dfc 100644 --- a/ironic/drivers/pxe.py +++ b/ironic/drivers/pxe.py @@ -97,9 +97,9 @@ class PXEAndSeaMicroDriver(base.BaseDriver): """PXE + SeaMicro driver. This driver implements the `core` functionality, combining - :class:ironic.drivers.modules.seamicro.Power for power + :class:`ironic.drivers.modules.seamicro.Power` for power on/off and reboot with - :class:ironic.driver.modules.pxe.PXE for image deployment. + :class:`ironic.driver.modules.pxe.PXE` for image deployment. Implementations are in those respective classes; this class is merely the glue between them. """ @@ -124,9 +124,9 @@ class PXEAndIBootDriver(base.BaseDriver): """PXE + IBoot PDU driver. This driver implements the `core` functionality, combining - :class:ironic.drivers.modules.iboot.IBootPower for power + :class:`ironic.drivers.modules.iboot.IBootPower` for power on/off and reboot with - :class:ironic.driver.modules.pxe.PXE for image deployment. + :class:`ironic.driver.modules.pxe.PXE` for image deployment. Implementations are in those respective classes; this class is merely the glue between them. """ @@ -145,11 +145,10 @@ class PXEAndIloDriver(base.BaseDriver): """PXE + Ilo Driver using IloClient interface. This driver implements the `core` functionality using - :class:ironic.drivers.modules.ilo.power.IloPower for power management - :class:ironic.drivers.modules.ilo.deploy.IloPXEDeploy(pxe.PXEDeploy) - :class:ironic.drivers.modules.ilo.deply.IloManagement( - ipmitool.IPMIManagement) - for image deployment. + :class:`ironic.drivers.modules.ilo.power.IloPower` for power management + :class:`ironic.drivers.modules.ilo.deploy.IloPXEDeploy` + :class:`ironic.drivers.modules.ilo.deploy.IloManagement` for image + deployment. """ @@ -169,8 +168,8 @@ class PXEAndSNMPDriver(base.BaseDriver): """PXE + SNMP driver. This driver implements the 'core' functionality, combining - :class:ironic.drivers.snmp.SNMP for power on/off and reboot with - :class:ironic.drivers.pxe.PXE for image deployment. Implentations are in + :class:`ironic.drivers.snmp.SNMP` for power on/off and reboot with + :class:`ironic.drivers.pxe.PXE` for image deployment. Implentations are in those respective classes; this class is merely the glue between them. """ diff --git a/ironic/tests/db/sqlalchemy/test_migrations.py b/ironic/tests/db/sqlalchemy/test_migrations.py index 74d02aa327..1326b7ef1e 100644 --- a/ironic/tests/db/sqlalchemy/test_migrations.py +++ b/ironic/tests/db/sqlalchemy/test_migrations.py @@ -31,10 +31,12 @@ The test will then use that db and u/p combo to run the tests. For postgres on Ubuntu this can be done with the following commands: -sudo -u postgres psql -postgres=# create user openstack_citest with createdb login password +:: + + sudo -u postgres psql + postgres=# create user openstack_citest with createdb login password 'openstack_citest'; -postgres=# create database openstack_citest with owner openstack_citest; + postgres=# create database openstack_citest with owner openstack_citest; """ diff --git a/ironic/tests/drivers/third_party_driver_mocks.py b/ironic/tests/drivers/third_party_driver_mocks.py index e8c431768f..404d7fe07d 100644 --- a/ironic/tests/drivers/third_party_driver_mocks.py +++ b/ironic/tests/drivers/third_party_driver_mocks.py @@ -21,10 +21,11 @@ respective external libraries' actually being present. Any external library required by a third-party driver should be mocked here. Current list of mocked libraries: - seamicroclient - ipminative - proliantutils - pysnmp + +- seamicroclient +- ipminative +- proliantutils +- pysnmp """ import sys