From 899b5ae5be05c757811420ac1ab99a4f6069c0bd Mon Sep 17 00:00:00 2001 From: tgoff0 Date: Thu, 5 Feb 2015 00:15:59 +0000 Subject: [PATCH] daemon: Renumber XML versioning. Consider the current XML representation version 0.0. --- daemon/core/misc/xmlparser.py | 10 +++++----- daemon/core/misc/{xmlparser1.py => xmlparser0.py} | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) rename daemon/core/misc/{xmlparser1.py => xmlparser0.py} (99%) diff --git a/daemon/core/misc/xmlparser.py b/daemon/core/misc/xmlparser.py index daaaa68a..fb07fb48 100644 --- a/daemon/core/misc/xmlparser.py +++ b/daemon/core/misc/xmlparser.py @@ -4,13 +4,13 @@ from xml.dom.minidom import parse from xmlutils import getoneelement -from xmlparser1 import CoreDocumentParser1 +from xmlparser0 import CoreDocumentParser0 class CoreVersionParser(object): '''\ Helper class to check the version of Network Plan document. This simply looks for a "Scenario" element; when present, this - indicates a 1.0 version document. The dom member is set in order + indicates a 0.0 version document. The dom member is set in order to prevent parsing a file twice (it can be passed to the appropriate CoreDocumentParser class.) ''' @@ -21,7 +21,7 @@ class CoreVersionParser(object): self.dom = parse(filename) self.scenario = getoneelement(self.dom, 'Scenario') if self.scenario is not None: - self.version = 1.0 + self.version = 0.0 else: self.version = 'unknown' @@ -29,8 +29,8 @@ def core_document_parser(session, filename, options): vp = CoreVersionParser(filename, options) if 'dom' not in options: options['dom'] = vp.dom - if vp.version == 1.0: - doc = CoreDocumentParser1(session, filename, options) + if vp.version == 0.0: + doc = CoreDocumentParser0(session, filename, options) else: raise ValueError, 'unsupported document version: %s' % vp.version return doc diff --git a/daemon/core/misc/xmlparser1.py b/daemon/core/misc/xmlparser0.py similarity index 99% rename from daemon/core/misc/xmlparser1.py rename to daemon/core/misc/xmlparser0.py index f1fff574..c945326d 100644 --- a/daemon/core/misc/xmlparser1.py +++ b/daemon/core/misc/xmlparser0.py @@ -10,7 +10,7 @@ from core.netns import nodes from xml.dom.minidom import parse from xmlutils import * -class CoreDocumentParser1(object): +class CoreDocumentParser0(object): def __init__(self, session, filename, options): self.session = session self.verbose = self.session.getcfgitembool('verbose', False)