Skip to content

Commit d61737c

Browse files
committed
Add is_shared function on SR
Signed-off-by: Damien Thenot <[email protected]>
1 parent 32f32ce commit d61737c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/SR.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ def __init__(self, srcmd, sr_uuid):
152152
self.direct = False
153153
self.ops_exclusive = []
154154
self.driver_config = {}
155+
self._is_shared = None
155156

156157
self.load(sr_uuid)
157158

@@ -233,6 +234,11 @@ def _addLUNperVDIkey(self):
233234
except:
234235
pass
235236

237+
def is_shared(self):
238+
if not self._is_shared:
239+
self._is_shared = self.session.xenapi.SR.get_shared(self.sr_ref)
240+
return self._is_shared
241+
236242
def create(self, uuid, size) -> None:
237243
"""Create this repository.
238244
This operation may delete existing data.

0 commit comments

Comments
 (0)