Nir Soffer has uploaded a new change for review. Change subject: spbackends: Move backend functions to spbackends ......................................................................
spbackends: Move backend functions to spbackends Move domainListEncoder() and domainListDecoder() to spbackends, since they are used only by the backends. This avoids circualr dependency between the pool and the backends. Change-Id: Ibde69dda90de62dea222a5ca5badca913749e75e Signed-off-by: Nir Soffer <[email protected]> --- M vdsm/storage/sp.py M vdsm/storage/spbackends.py 2 files changed, 15 insertions(+), 17 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/63/43463/1 diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py index 8574bac..9166f60 100644 --- a/vdsm/storage/sp.py +++ b/vdsm/storage/sp.py @@ -61,21 +61,6 @@ LVER_INVALID = -1 -def domainListEncoder(domDict): - domains = ','.join(['%s:%s' % (k, v) for k, v in domDict.iteritems()]) - return domains - - -def domainListDecoder(s): - domList = {} - if not s: - return domList - for domDecl in s.split(","): - k, v = domDecl.split(':') - domList[k.strip("'")] = v.strip("'").capitalize() - return domList - - @secured class StoragePool(object): ''' diff --git a/vdsm/storage/spbackends.py b/vdsm/storage/spbackends.py index 953e01e..7f9269f 100644 --- a/vdsm/storage/spbackends.py +++ b/vdsm/storage/spbackends.py @@ -35,8 +35,6 @@ from sp import SPM_ACQUIRED from sp import SPM_FREE from sp import SPM_ID_FREE -from sp import domainListDecoder -from sp import domainListEncoder from vdsm.config import config @@ -56,6 +54,21 @@ MAX_DOMAINS /= 48 +def domainListEncoder(domDict): + domains = ','.join(['%s:%s' % (k, v) for k, v in domDict.iteritems()]) + return domains + + +def domainListDecoder(s): + domList = {} + if not s: + return domList + for domDecl in s.split(","): + k, v = domDecl.split(':') + domList[k.strip("'")] = v.strip("'").capitalize() + return domList + + # metadata_key: (metadata_decoder, metadata_encoder) SP_MD_FIELDS = { PMDK_DOMAINS: (domainListDecoder, domainListEncoder), -- To view, visit https://gerrit.ovirt.org/43463 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibde69dda90de62dea222a5ca5badca913749e75e Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
