def _test_build_deploy_ramdisk_options(self, mock_alnum, api_url,
                                           expected_root_device=None,
                                           expected_boot_option='netboot',
                                           expected_boot_mode='bios'):
        fake_key = '0123456789ABCDEFGHIJKLMNOPQRSTUV'
        fake_disk = 'fake-disk'

        self.config(disk_devices=fake_disk, group='pxe')

        mock_alnum.return_value = fake_key

        expected_iqn = self.node.uuid % 'iqn.2008-10.org.openstack:%s'
        expected_opts = {
            'iscsi_target_iqn': expected_iqn,
            'iscsi_portal_port': 3260,
            'deployment_id': self.node.uuid,
            'deployment_key': fake_key,
            'disk': fake_disk,
            'ironic_api_url': api_url,
            'boot_option': expected_boot_option,
            'boot_mode': expected_boot_mode,
            'coreos.configdrive': 0,
        }

        if expected_root_device:
            expected_opts['root_device'] = expected_root_device

        opts = iscsi_deploy.build_deploy_ramdisk_options(self.node)

        self.assertEqual(expected_opts, opts)
        mock_alnum.assert_called_once_with(32)
        # assert deploy_key was injected in the node
        self.assertIn('deploy_key', self.node.instance_info)
dataset/ETHPy150Open openstack/ironic/ironic/tests/unit/drivers/modules/test_iscsi_deploy.py/IscsiDeployMethodsTestCase._test_build_deploy_ramdisk_options/swapped operands of `%`