Giuseppe Vallarelli has uploaded a new change for review.

Change subject: refactoring: Configurator base class making attributes explicit.
......................................................................

refactoring: Configurator base class making attributes explicit.

Currently the base class contains references to internal attributes
in some methods that are instantiated in the subclass Ifcfg.
Proposed refactoring let the baseclass instantiate the configApplier
and the _libvirtAdded set.

Change-Id: I6e5719146493c83349d18284fa1f67f99bc239fa
Signed-off-by: Giuseppe Vallarelli <[email protected]>
---
M vdsm/netconf/__init__.py
M vdsm/netconf/ifcfg.py
2 files changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/45/16845/1

diff --git a/vdsm/netconf/__init__.py b/vdsm/netconf/__init__.py
index 14a5ec1..72e0e09 100644
--- a/vdsm/netconf/__init__.py
+++ b/vdsm/netconf/__init__.py
@@ -25,6 +25,10 @@
 
 
 class Configurator(object):
+    def __init__(self, configApplier):
+        self.configApplier = configApplier()
+        self._libvirtAdded = set()
+
     def configureBridge(self, bridge, **opts):
         raise NotImplementedError
 
diff --git a/vdsm/netconf/ifcfg.py b/vdsm/netconf/ifcfg.py
index c062b57..ce339ce 100644
--- a/vdsm/netconf/ifcfg.py
+++ b/vdsm/netconf/ifcfg.py
@@ -42,8 +42,7 @@
 class Ifcfg(Configurator):
     # TODO: Do all the configApplier interaction from here.
     def __init__(self):
-        self.configApplier = ConfigWriter()
-        self._libvirtAdded = set()
+        super(Ifcfg, self).__init__(ConfigWriter)
 
     def begin(self):
         if self.configApplier is None:


-- 
To view, visit http://gerrit.ovirt.org/16845
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6e5719146493c83349d18284fa1f67f99bc239fa
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Giuseppe Vallarelli <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to