Skip to content

Commit

Permalink
dont check status if no file attached to object
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed May 10, 2018
1 parent cccf0c6 commit 707de1b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scripts/lib/CIME/XML/generic_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def read(self, infile, schema=None):
"""
if not self.DISABLE_CACHING and infile in self._FILEMAP and self.read_only:
logger.debug("read (cached): " + infile)
expect(not self.needsrewrite, "Reading into object marked for rewrite, file {}"
expect(not self.filename or not self.needsrewrite, "Reading into object marked for rewrite, file {}"
.format(self.filename))
self.tree, self.root = self._FILEMAP[infile]
else:
Expand All @@ -94,8 +94,7 @@ def read(self, infile, schema=None):
self._FILEMAP[infile] = (self.tree, self.root)

def read_fd(self, fd):
expect(not self.needsrewrite, "Reading into object marked for rewrite, file {}"
.format(self.filename))
expect(not self.filename or not self.needsrewrite, "Reading into object marked for rewrite, file {}" .format(self.filename))
if self.tree:
addroot = _Element(ET.parse(fd).getroot())
read_only = self.read_only
Expand Down

0 comments on commit 707de1b

Please sign in to comment.