def reconfig(self, factory, val):
        """Called to reconfigure the VM. Actually customizes the property
        setting of the Virtual Machine object.
        """

        if hasattr(val, 'name') and val.name:
            self.set("name", val.name)

        if hasattr(val, 'extraConfig'):
            extraConfigs = _merge_extraconfig(
                                    self.get("config.extraConfig").OptionValue,
                                    val.extraConfig)
            self.get("config.extraConfig").OptionValue = extraConfigs

        if hasattr(val, 'instanceUuid') and val.instanceUuid is not None:
            if val.instanceUuid == "":
                val.instanceUuid = uuidutils.generate_uuid()
            self.set("summary.config.instanceUuid", val.instanceUuid)

        try:
            if not hasattr(val, 'deviceChange'):
                return

            if hasattr(val, 'extraConfig'):
                # there are 2 cases - new entry or update an existing one
                for extra in val.extraConfig:
                    self._update_extra_config(extra)

            if 2 < len(val.deviceChange):
                return

            # Case of Reconfig of VM to attach disk
            controller_key = val.deviceChange[0].device.controllerKey
            filename = val.deviceChange[0].device.backing.fileName

            disk = VirtualDisk()
            disk.controllerKey = controller_key

            disk_backing = VirtualDiskFlatVer2BackingInfo()
            disk_backing.fileName = filename
            disk_backing.key = -101
            disk.backing = disk_backing
            disk.capacityInBytes = 1024
            disk.capacityInKB = 1

            controller = VirtualLsiLogicController()
            controller.key = controller_key

            devices = _create_array_of_type('VirtualDevice')
            devices.VirtualDevice = [disk, controller, self.device[0]]
            self.set("config.hardware.device", devices)
        except AttributeError:
            pass
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/virt/vmwareapi/fake.py/VirtualMachine.reconfig/swapped operands of `<`