@@ -202,9 +202,9 @@ def lookup(self):
202
202
for item in self .existing_storages :
203
203
if item ['storage' ] == self .name :
204
204
# pvesh doesn't return the disable param value if it's false,
205
- # so we set it to False .
205
+ # so we set it to 0, which is what PVE would normally use .
206
206
if item .get ('disable' ) is None :
207
- item ['disable' ] = False
207
+ item ['disable' ] = 0
208
208
return item
209
209
return None
210
210
@@ -222,9 +222,7 @@ def prepare_storage_args(self):
222
222
if self .nodes is not None :
223
223
args ['nodes' ] = ',' .join (self .nodes )
224
224
if self .disable is not None :
225
- args ['disable' ] = self .disable
226
- else :
227
- args ['disable' ] = False
225
+ args ['disable' ] = 1 if self .disable else 0
228
226
if self .path is not None :
229
227
args ['path' ] = self .path
230
228
if self .pool is not None :
@@ -234,7 +232,7 @@ def prepare_storage_args(self):
234
232
if self .username is not None :
235
233
args ['username' ] = self .username
236
234
if self .krbd is not None :
237
- args ['krbd' ] = self .krbd
235
+ args ['krbd' ] = 1 if self .krbd else 0
238
236
if self .maxfiles is not None :
239
237
args ['maxfiles' ] = self .maxfiles
240
238
if self .server is not None :
@@ -248,7 +246,7 @@ def prepare_storage_args(self):
248
246
if self .thinpool is not None :
249
247
args ['thinpool' ] = self .thinpool
250
248
if self .sparse is not None :
251
- args ['sparse' ] = self .sparse
249
+ args ['sparse' ] = 1 if self .sparse else 0
252
250
253
251
if self .maxfiles is not None and 'backup' not in self .content :
254
252
self .module .fail_json (msg = "maxfiles is not allowed when there is no 'backup' in content" )
0 commit comments