def _apply_ide_controller_config(ide_controller_label, operation,
                                 key, bus_number=0):
    '''
    Returns a vim.vm.device.VirtualDeviceSpec object specifying to add/edit an
    IDE controller

    ide_controller_label
        Controller label of the IDE adapter

    operation
        Type of operation: add or edit

    key
        Unique key of the device

    bus_number
        Device bus number property
    '''
    log.trace('Configuring IDE controller ide_controller_label=%s',
              ide_controller_label)
    ide_spec = vim.vm.device.VirtualDeviceSpec()
    ide_spec.device = vim.vm.device.VirtualIDEController()
    if operation == 'add':
        ide_spec.operation = vim.vm.device.VirtualDeviceSpec.Operation.add
    if operation == 'edit':
        ide_spec.operation = vim.vm.device.VirtualDeviceSpec.Operation.edit
    ide_spec.device.key = key
    ide_spec.device.busNumber = bus_number
    if ide_controller_label:
        ide_spec.device.deviceInfo = vim.Description()
        ide_spec.device.deviceInfo.label = ide_controller_label
        ide_spec.device.deviceInfo.summary = ide_controller_label
    return ide_spec
def _apply_ide_controller_config ( ide_controller_label , operation , key , bus_number = 0 ) : log . trace ( 'Configuring IDE controller ide_controller_label=%s' , ide_controller_label ) ide_spec = vim . vm . device . VirtualDeviceSpec ( ) ide_spec . device = vim . vm . device . VirtualIDEController ( ) if operation == 'add' : ide_spec . operation = vim . vm . device . VirtualDeviceSpec . Operation . add if operation == 'edit' : ide_spec . operation = vim . vm . device . VirtualDeviceSpec . Operation . edit ide_spec . device . key = key ide_spec . device . busNumber = bus_number if ide_controller_label : ide_spec . device . deviceInfo = vim . Description ( ) ide_spec . device . deviceInfo . label = ide_controller_label ide_spec . device . deviceInfo . summary = ide_controller_label return ide_spec
Returns a vim.vm.device.VirtualDeviceSpec object specifying to add/edit an
    IDE controller

    ide_controller_label
        Controller label of the IDE adapter

    operation
        Type of operation: add or edit

    key
        Unique key of the device

    bus_number
        Device bus number property