~ubuntu-branches/ubuntu/vivid/ironic/vivid-updates

« back to all changes in this revision

Viewing changes to ironic/drivers/modules/ilo/common.py

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2015-01-05 12:21:37 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20150105122137-171bqrdpcxqipunk
Tags: 2015.1~b1-0ubuntu1
* New upstream beta release:
  - d/control: Align version requirements with upstream release.
* d/watch: Update uversionmangle to deal with kilo beta versioning
  changes.
* d/control: Bumped Standards-Version to 3.9.6, no changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
190
190
        return STANDARD_LICENSE
191
191
 
192
192
 
 
193
def update_ipmi_properties(task):
 
194
    """Update ipmi properties to node driver_info
 
195
 
 
196
    :param task: a task from TaskManager.
 
197
    """
 
198
    node = task.node
 
199
    info = node.driver_info
 
200
 
 
201
    # updating ipmi credentials
 
202
    info['ipmi_address'] = info.get('ilo_address')
 
203
    info['ipmi_username'] = info.get('ilo_username')
 
204
    info['ipmi_password'] = info.get('ilo_password')
 
205
 
 
206
    if 'console_port' in info:
 
207
        info['ipmi_terminal_port'] = info['console_port']
 
208
 
 
209
    # saving ipmi credentials to task object
 
210
    task.node.driver_info = info
 
211
 
 
212
 
193
213
def _get_floppy_image_name(node):
194
214
    """Returns the floppy image name for a given node.
195
215
 
273
293
    LOG.info(_LI("Attached virtual media %s successfully."), device)
274
294
 
275
295
 
276
 
# TODO(rameshg87): This needs to be moved to iLO's management interface.
277
 
def set_boot_device(node, device, persistent=False):
278
 
    """Sets the node to boot from a device for the next boot.
279
 
 
280
 
    :param node: an ironic node object.
281
 
    :param device: the device to boot from
282
 
    :raises: IloOperationError if setting boot device failed.
283
 
    """
284
 
    ilo_object = get_ilo_object(node)
285
 
 
286
 
    try:
287
 
        if not persistent:
288
 
            ilo_object.set_one_time_boot(device)
289
 
        else:
290
 
            ilo_object.update_persistent_boot([device])
291
 
    except ilo_client.IloError as ilo_exception:
292
 
        operation = _("Setting %s as boot device") % device
293
 
        raise exception.IloOperationError(operation=operation,
294
 
                                          error=ilo_exception)
295
 
 
296
 
    LOG.debug("Node %(uuid)s set to boot from %(device)s.",
297
 
             {'uuid': node.uuid, 'device': device})
298
 
 
299
 
 
300
296
def set_boot_mode(node, boot_mode):
301
297
    """Sets the node to boot using boot_mode for the next boot.
302
298