X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=geni%2Futil%2Frspec.py;h=393d8df5eabb8d2ae6168ec9ca47ed8f2cc28f5d;hb=1d53363bdbaecfeefc63275c268dd60ea3167fcf;hp=7963c82cad8e4c8466b52dfd3c03cdf46ea4010b;hpb=310e72e7fef0be4215863f096a87d2a16d87ac27;p=sfa.git diff --git a/geni/util/rspec.py b/geni/util/rspec.py index 7963c82c..393d8df5 100644 --- a/geni/util/rspec.py +++ b/geni/util/rspec.py @@ -291,6 +291,7 @@ class Rspec(): class RecordSpec(Rspec): + root_tag = 'record' def parseDict(self, rdict, include_doc = False): """ Convert a dictionary into a dom object and store it. @@ -298,7 +299,10 @@ class RecordSpec(Rspec): self.rootNode = self.dict2dom(rdict, include_doc) def dict2dom(self, rdict, include_doc = False): - record_dict = {'record': rdict} + record_dict = rdict + if not len(rdict.keys()) == 1: + record_dict = {self.root_tag : rdict} return Rspec.dict2dom(self, record_dict, include_doc) # vim:ts=4:expandtab +