Skip to content

fix(linstor): use quotes on linstor type annotations - #150

Merged
Wescoeur merged 1 commit into
3.2.12-8.3-develfrom
ran-fix-linstor-annotation
Jul 30, 2026
Merged

fix(linstor): use quotes on linstor type annotations#150
Wescoeur merged 1 commit into
3.2.12-8.3-develfrom
ran-fix-linstor-annotation

Conversation

@Wescoeur

Copy link
Copy Markdown
Member

Without that and if LINSTOR python package is not installed we can have issues to register our drivers. AttributeError is raised and not catched by other modules during imports...

Trace:

Jul 30 17:11:36 hpm1c20 xapi: [error||0 |Registering SMAPIv1 plugins D:6829eea78bbd|sm_exec] Rejecting SM plugin: LVM because of exception: Storage_error ([S(Backend_error);[S(SR_BACKEND_FAILURE);[S(non-zero exit);S();S(Traceback (most recent call last):\x0A  File "/opt/xensource/sm/LVMSR", line 23, in <module>\x0A    import SR\x0A  File "/opt/xensource/sm/SR.py", line 23, in <module>\x0A    import VDI\x0A  File "/opt/xensource/sm/VDI.py", line 21, in <module>\x0A    import cleanup\x0A  File "/opt/xensource/sm/cleanup.py", line 44, in <module>\x0A    import blktap2\x0A  File "/opt/xensource/sm/blktap2.py", line 60, in <module>\x0A    from linstorvolumemanager import get_controller_uri, get_all_volume_openers, LinstorVolumeManager\x0A  File "/opt/xensource/sm/linstorvolumemanager.py", line 262, in <module>\x0A    class LinstorVolumeManager(object):\x0A  File "/opt/xensource/sm/linstorvolumemanager.py", line 420, in LinstorVolumeManager\x0A    def native_client(self) -> linstor.Linstor:\x0AAttributeError: module 'linstor' has no attribute 'Linstor'\x0A)]]]) (executable)

Without that and if LINSTOR python package is not installed we can have
issues to register our drivers. `AttributeError` is raised and not catched by
other modules during imports...

Trace:
```
Jul 30 17:11:36 hpm1c20 xapi: [error||0 |Registering SMAPIv1 plugins D:6829eea78bbd|sm_exec] Rejecting SM plugin: LVM because of exception: Storage_error ([S(Backend_error);[S(SR_BACKEND_FAILURE);[S(non-zero exit);S();S(Traceback (most recent call last):\x0A  File "/opt/xensource/sm/LVMSR", line 23, in <module>\x0A    import SR\x0A  File "/opt/xensource/sm/SR.py", line 23, in <module>\x0A    import VDI\x0A  File "/opt/xensource/sm/VDI.py", line 21, in <module>\x0A    import cleanup\x0A  File "/opt/xensource/sm/cleanup.py", line 44, in <module>\x0A    import blktap2\x0A  File "/opt/xensource/sm/blktap2.py", line 60, in <module>\x0A    from linstorvolumemanager import get_controller_uri, get_all_volume_openers, LinstorVolumeManager\x0A  File "/opt/xensource/sm/linstorvolumemanager.py", line 262, in <module>\x0A    class LinstorVolumeManager(object):\x0A  File "/opt/xensource/sm/linstorvolumemanager.py", line 420, in LinstorVolumeManager\x0A    def native_client(self) -> linstor.Linstor:\x0AAttributeError: module 'linstor' has no attribute 'Linstor'\x0A)]]]) (executable)
```

Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
@Wescoeur
Wescoeur requested review from Kuruyia and klmp200 July 30, 2026 15:32

@Kuruyia Kuruyia left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I wasn't aware of that... I'll know for next time.

@Wescoeur

Copy link
Copy Markdown
Member Author

Oops, I wasn't aware of that... I'll know for next time.

No worries, I let my guard down. We wouldn't have this problem if the architecture were more modular.

@Wescoeur
Wescoeur merged commit 82c3f52 into 3.2.12-8.3-devel Jul 30, 2026
5 checks passed
@Wescoeur
Wescoeur deleted the ran-fix-linstor-annotation branch July 30, 2026 15:40
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.

3 participants