Skip to content

Commit 2498f65

Browse files
johnmdilleyDaanHoogland
authored andcommitted
CLOUDSTACK-6909 - fix marvin's handling of SMB credentials for storage
Signed-off-by: Daan Hoogland <daan@onecht.net> (cherry picked from commit 477a812)
1 parent 5749abc commit 2498f65

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎tools/marvin/marvin/configGenerator.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ class primaryStorage(object):
216216
def __init__(self):
217217
self.name = None
218218
self.url = None
219+
self.details = None
219220

220221

221222
class secondaryStorage(object):

‎tools/marvin/marvin/deployDataCenter.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,9 @@ def createPrimaryStorages(self,
236236
return
237237
for primary in primaryStorages:
238238
primarycmd = createStoragePool.createStoragePoolCmd()
239-
primarycmd.details = primary.details
239+
if primary.details:
240+
for key, value in vars(primary.details).iteritems():
241+
primarycmd.details.append({ key: value})
240242
primarycmd.name = primary.name
241243
primarycmd.podid = podId
242244
primarycmd.tags = primary.tags
@@ -333,14 +335,13 @@ def createSecondaryStorages(self, secondaryStorages, zoneId):
333335
secondarycmd.provider = secondary.provider
334336
secondarycmd.details = []
335337

336-
if secondarycmd.provider == 'S3' \
337-
or secondarycmd.provider == "Swift":
338+
if secondarycmd.provider.lower() in ('s3', "swift", "smb"):
338339
for key, value in vars(secondary.details).iteritems():
339340
secondarycmd.details.append({
340341
'key': key,
341342
'value': value
342343
})
343-
if secondarycmd.provider == "NFS":
344+
if secondarycmd.provider.lower() in ("nfs", "smb"):
344345
secondarycmd.zoneid = zoneId
345346
ret = self.__apiClient.addImageStore(secondarycmd)
346347
if ret.id:

0 commit comments

Comments
 (0)