Skip to content

Conversation

@LunfanZhang
Copy link
Contributor

In some cases, sr_health_check fails with:

TypeError: super(type, obj): obj must be an instance or subtype of type

This occurs when SR.from_uuid() dynamically loads the module, potentially creating separate LVHDoHBASR class objects in memory. Python's super() validates class identity and fails when the class reference differs from the instance's class.

Replace super(LVHDoHBASR, self).load(sr_uuid) with LVHDSR.LVHDSR.load(self, sr_uuid)

This direct parent call bypasses class identity validation and aligns with all other methods(create, detach etc.) in this class.

Replace super() with direct parent class call to fix "TypeError: super(type,
obj): obj must be an instance or subtype of type" when SR.from_uuid()
dynamically loads the module.

This aligns load() with all other methods in the class (create, attach, scan,
probe, detach, delete) which already use direct parent calls.

Signed-off-by: Lunfan Zhang[Lunfan.Zhang] <Lunfan.Zhang@cloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant