From: smbaker Date: Fri, 6 Jan 2012 06:48:06 +0000 (-0800) Subject: handle blank rspecs without faulting X-Git-Tag: sface-0.9-3~1 X-Git-Url: http://git.onelab.eu/?p=sface.git;a=commitdiff_plain;h=72d17d9e61f0c38e293a3e8773b046975ac570d5 handle blank rspecs without faulting --- diff --git a/sface/sfidata.py b/sface/sfidata.py index 4f2749e..9a2710a 100644 --- a/sface/sfidata.py +++ b/sface/sfidata.py @@ -80,9 +80,11 @@ class SfiData: rspec_file = config.getSliceRSpecFile() if os.path.exists(rspec_file): xml = open(rspec_file).read() - rspec = RSpec(rspec=xml) #rspec = parse_rspec(xml) - #self.purgeNonSliceResources(rspec) + if (xml.strip()==""): + return None + + rspec = RSpec(rspec=xml) return rspec return None @@ -91,7 +93,11 @@ class SfiData: rspec_file = config.getResourcesRSpecFile() if os.path.exists(rspec_file): xml = open(rspec_file).read() - rspec = RSpec(rspec=xml) #rspec= parse_rspec(xml) + + if (xml.strip()==""): + return None + + rspec = RSpec(rspec=xml) return rspec return None