[node-patches] Change in ovirt-node[master]: app: Move plugins into their own namespace
fabiand at fedoraproject.org
fabiand at fedoraproject.org
Fri May 24 08:46:39 UTC 2013
Fabian Deutsch has uploaded a new change for review.
Change subject: app: Move plugins into their own namespace
......................................................................
app: Move plugins into their own namespace
Previously all plugins had to put the UI .py fies into the same
directory. This could lead to collisions and could became messy on the
long term. Now each plugin can create it's own folder in the base plugin
dirs for the setup and installer (their own namespace) to keep all
relevant files (wrt to the plugin) in one place and avoid collisions
with other plugins.
Examples:
Previously all "core" plugins (each page is actually a plugin) for the
setup application resided in:
ovirt/node/setup/
Additional plugins were also put into this path (e.g. SNMP and CIM).
Now the core plugins moved to:
ovirt/node/setup/core/
And additional plugins will move to
ovirt/node/setup/cim/
ovirt/node/setup/snmp/
and so on ...
Change-Id: Icaf10816d1c87d9d0404130f496f0f6cad13149a
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M ovirt-node.spec.in
M src/Makefile.am
M src/ovirt/node/app.py
M src/ovirt/node/installer/__init__.py
M src/ovirt/node/installer/__main__.py
A src/ovirt/node/installer/core/__init__.py
R src/ovirt/node/installer/core/boot_device_page.py
A src/ovirt/node/installer/core/core.py
R src/ovirt/node/installer/core/installation_device_page.py
R src/ovirt/node/installer/core/keyboard_page.py
R src/ovirt/node/installer/core/password_page.py
R src/ovirt/node/installer/core/progress_page.py
R src/ovirt/node/installer/core/storage_vol_page.py
R src/ovirt/node/installer/core/upgrade_page.py
R src/ovirt/node/installer/core/welcome_page.py
M src/ovirt/node/plugins.py
M src/ovirt/node/setup/__init__.py
A src/ovirt/node/setup/cim/__init__.py
R src/ovirt/node/setup/cim/cim_model.py
R src/ovirt/node/setup/cim/cim_page.py
A src/ovirt/node/setup/core/__init__.py
R src/ovirt/node/setup/core/kdump_page.py
R src/ovirt/node/setup/core/keyboard_page.py
R src/ovirt/node/setup/core/logging_page.py
R src/ovirt/node/setup/core/monitoring_page.py
R src/ovirt/node/setup/core/network_page.py
R src/ovirt/node/setup/core/ping.py
R src/ovirt/node/setup/core/remote_storage_page.py
R src/ovirt/node/setup/core/security_page.py
R src/ovirt/node/setup/core/status_page.py
R src/ovirt/node/setup/core/support_page.py
A src/ovirt/node/setup/snmp/__init__.py
R src/ovirt/node/setup/snmp/snmp_model.py
R src/ovirt/node/setup/snmp/snmp_page.py
34 files changed, 166 insertions(+), 77 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/46/15046/1
diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in
index 46327cc..011843e 100644
--- a/ovirt-node.spec.in
+++ b/ovirt-node.spec.in
@@ -435,16 +435,16 @@
%files plugin-snmp
%{python_sitelib}/ovirt_config_setup/snmp.py
-%{python_sitelib}/ovirt/node/config/snmp.py
-%{python_sitelib}/ovirt/node/setup/snmp_page.py
+%{python_sitelib}/ovirt/node/setup/snmp/snmp.py
+%{python_sitelib}/ovirt/node/setup/snmp/snmp_page.py
%{_sysconfdir}/ovirt-plugins.d/snmp.minimize
%{_sysconfdir}/ovirt-config-boot.d/snmp_autoinstall.py
%files plugin-cim
%{python_sitelib}/ovirt_config_setup/cim.py
-%{python_sitelib}/ovirt/node/config/cim.py
-%{python_sitelib}/ovirt/node/setup/cim_page.py
+%{python_sitelib}/ovirt/node/setup/cim/cim.py
+%{python_sitelib}/ovirt/node/setup/cim/cim_page.py
%{_sysconfdir}/ovirt-plugins.d/cim.minimize
%if %{is_systemd}
%{_unitdir}/ovirt-cim.service
@@ -542,10 +542,8 @@
# Files related to the new TUI
%{python_sitelib}/ovirt/__init__.*
%{python_sitelib}/ovirt/node/*
-%exclude %{python_sitelib}/ovirt/node/config/snmp.py*
-%exclude %{python_sitelib}/ovirt/node/config/cim.py*
-%exclude %{python_sitelib}/ovirt/node/setup/snmp_page.py*
-%exclude %{python_sitelib}/ovirt/node/setup/cim_page.py*
+%exclude %{python_sitelib}/ovirt/node/setup/snmp/*
+%exclude %{python_sitelib}/ovirt/node/setup/cim/*
%{_bindir}/ovirt-config-setup
%{_bindir}/ovirt-node-installer
%{_bindir}/ovirt-node-doc
diff --git a/src/Makefile.am b/src/Makefile.am
index cdadc27..4914d11 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -49,13 +49,25 @@
ovirtnode/password.py \
ovirtnode/storage.py
+# Basic dirs
pyovirtdir = $(pythondir)/ovirt
pyovirt_nodedir = $(pyovirtdir)/node
pyovirt_node_configdir = $(pyovirt_nodedir)/config
-pyovirt_node_installerdir = $(pyovirt_nodedir)/installer
-pyovirt_node_setupdir = $(pyovirt_nodedir)/setup
pyovirt_node_uidir = $(pyovirt_nodedir)/ui
pyovirt_node_utilsdir = $(pyovirt_nodedir)/utils
+
+# Path to installer app and installer plugins
+pyovirt_node_installerdir = $(pyovirt_nodedir)/installer
+pyovirt_node_installer_coredir = $(pyovirt_installerdir)/core
+
+# Path to setup app and setup plugins
+pyovirt_node_setupdir = $(pyovirt_nodedir)/setup
+pyovirt_node_setup_coredir = $(pyovirt_setupdir)/core
+
+# Paths to CIM and SNMP setup plugins
+pyovirt_node_setup_cimdir = $(pyovirt_setupdir)/cim
+pyovirt_node_setup_snmpdir = $(pyovirt_setupdir)/snmp
+
pyovirt_PYTHON = \
ovirt/__init__.py
@@ -71,39 +83,7 @@
pyovirt_node_config_PYTHON = \
ovirt/node/config/__init__.py \
ovirt/node/config/defaults.py \
- ovirt/node/config/network.py \
- ovirt/node/config/cim.py \
- ovirt/node/config/snmp.py
-
-pyovirt_node_installer_PYTHON = \
- ovirt/node/installer/__init__.py \
- ovirt/node/installer/__main__.py \
- ovirt/node/installer/boot_device_page.py \
- ovirt/node/installer/installation_device_page.py \
- ovirt/node/installer/keyboard_page.py \
- ovirt/node/installer/password_page.py \
- ovirt/node/installer/progress_page.py \
- ovirt/node/installer/storage_vol_page.py \
- ovirt/node/installer/upgrade_page.py \
- ovirt/node/installer/welcome_page.py
-
-pyovirt_node_setup_PYTHON = \
- ovirt/node/setup/__init__.py \
- ovirt/node/setup/__main__.py \
- ovirt/node/setup/diagnostics_page.py \
- ovirt/node/setup/kdump_page.py \
- ovirt/node/setup/keyboard_page.py \
- ovirt/node/setup/logging_page.py \
- ovirt/node/setup/monitoring_page.py \
- ovirt/node/setup/network_page.py \
- ovirt/node/setup/ping.py \
- ovirt/node/setup/plugins_page.py \
- ovirt/node/setup/remote_storage_page.py \
- ovirt/node/setup/security_page.py \
- ovirt/node/setup/status_page.py \
- ovirt/node/setup/support_page.py \
- ovirt/node/setup/cim_page.py \
- ovirt/node/setup/snmp_page.py
+ ovirt/node/config/network.py
pyovirt_node_ui_PYTHON = \
ovirt/node/ui/__init__.py \
@@ -121,3 +101,52 @@
ovirt/node/utils/system.py \
ovirt/node/utils/virt.py
+
+# Installer Main
+pyovirt_node_installer_PYTHON = \
+ ovirt/node/installer/__init__.py \
+ ovirt/node/installer/__main__.py
+
+# Installer Core plugins
+pyovirt_node_installer_core_PYTHON = \
+ ovirt/node/installer/__init__.py \
+ ovirt/node/installer/boot_device_page.py \
+ ovirt/node/installer/installation_device_page.py \
+ ovirt/node/installer/keyboard_page.py \
+ ovirt/node/installer/password_page.py \
+ ovirt/node/installer/progress_page.py \
+ ovirt/node/installer/storage_vol_page.py \
+ ovirt/node/installer/upgrade_page.py \
+ ovirt/node/installer/welcome_page.py
+
+
+# Setup Main
+pyovirt_node_setup_PYTHON = \
+ ovirt/node/setup/__init__.py \
+ ovirt/node/setup/__main__.py
+
+# Setup Core Plugins
+pyovirt_node_setup_core_PYTHON = \
+ ovirt/node/installer/__init__.py \
+ ovirt/node/setup/diagnostics_page.py \
+ ovirt/node/setup/kdump_page.py \
+ ovirt/node/setup/keyboard_page.py \
+ ovirt/node/setup/logging_page.py \
+ ovirt/node/setup/monitoring_page.py \
+ ovirt/node/setup/network_page.py \
+ ovirt/node/setup/ping.py \
+ ovirt/node/setup/plugins_page.py \
+ ovirt/node/setup/remote_storage_page.py \
+ ovirt/node/setup/security_page.py \
+ ovirt/node/setup/status_page.py \
+ ovirt/node/setup/support_page.py
+
+# Setup CIM Plugin
+pyovirt_node_setup_cim_PYTHON = \
+ ovirt/node/setup/cim/cim_page.py \
+ ovirt/node/setup/cim/cim_model.py \
+
+# Setup SNMP Plugin
+pyovirt_node_setup_snmp_PYTHON = \
+ ovirt/node/setup/snmp/snmp_page.py \
+ ovirt/node/setup/snmp/snmp_model.py
diff --git a/src/ovirt/node/app.py b/src/ovirt/node/app.py
index 811a2c5..3ae0a9e 100644
--- a/src/ovirt/node/app.py
+++ b/src/ovirt/node/app.py
@@ -25,7 +25,6 @@
import logging
import logging.config
import sys
-import traceback
from optparse import OptionParser
"""
diff --git a/src/ovirt/node/installer/__init__.py b/src/ovirt/node/installer/__init__.py
index 7373b1d..dc3ef47 100644
--- a/src/ovirt/node/installer/__init__.py
+++ b/src/ovirt/node/installer/__init__.py
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
"""
This package contains all UI plugins for the installer
+
+Each plugin can create it's own directory (a so called plugin group).
"""
diff --git a/src/ovirt/node/installer/__main__.py b/src/ovirt/node/installer/__main__.py
index c75aee8..49e6d94 100644
--- a/src/ovirt/node/installer/__main__.py
+++ b/src/ovirt/node/installer/__main__.py
@@ -23,23 +23,9 @@
Create an setup application instance an start it.
"""
-from ovirt.node import app, installer, plugins
+from ovirt.node import app, installer
if __name__ == '__main__':
app = app.Application(installer)
app.run()
-
-
-class Plugin(plugins.NodePlugin):
- transactions = None
-
- def __init__(self, application):
- super(Plugin, self).__init__(application)
- application.ui.with_menu = False
-
- def name(self):
- return "installer"
-
- def has_ui(self):
- return False
diff --git a/src/ovirt/node/installer/core/__init__.py b/src/ovirt/node/installer/core/__init__.py
new file mode 100644
index 0000000..3909e81
--- /dev/null
+++ b/src/ovirt/node/installer/core/__init__.py
@@ -0,0 +1,3 @@
+"""
+Core Installer Plugins
+"""
\ No newline at end of file
diff --git a/src/ovirt/node/installer/boot_device_page.py b/src/ovirt/node/installer/core/boot_device_page.py
similarity index 100%
rename from src/ovirt/node/installer/boot_device_page.py
rename to src/ovirt/node/installer/core/boot_device_page.py
diff --git a/src/ovirt/node/installer/core/core.py b/src/ovirt/node/installer/core/core.py
new file mode 100644
index 0000000..71bb6b6
--- /dev/null
+++ b/src/ovirt/node/installer/core/core.py
@@ -0,0 +1,40 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#
+# ovirt-config-installer.py - Copyright (C) 2012 Red Hat, Inc.
+# Written by Fabian Deutsch <fabiand at redhat.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301, USA. A copy of the GNU General Public License is
+# also available at http://www.gnu.org/copyleft/gpl.html.
+
+"""
+Configure the application
+"""
+
+from ovirt.node import plugins
+
+
+class Plugin(plugins.NodePlugin):
+ transactions = None
+
+ def __init__(self, application):
+ super(Plugin, self).__init__(application)
+ application.ui.with_menu = False
+
+ def name(self):
+ return "installer"
+
+ def has_ui(self):
+ return False
diff --git a/src/ovirt/node/installer/installation_device_page.py b/src/ovirt/node/installer/core/installation_device_page.py
similarity index 98%
rename from src/ovirt/node/installer/installation_device_page.py
rename to src/ovirt/node/installer/core/installation_device_page.py
index 9572faf..f1c4d8d 100644
--- a/src/ovirt/node/installer/installation_device_page.py
+++ b/src/ovirt/node/installer/core/installation_device_page.py
@@ -23,7 +23,7 @@
Installation device selection page of the installer
"""
from ovirt.node import plugins, ui
-from ovirt.node.installer.boot_device_page import DeviceDetails, \
+from ovirt.node.installer.core.boot_device_page import DeviceDetails, \
CustomDeviceDialog, StorageDiscovery
diff --git a/src/ovirt/node/installer/keyboard_page.py b/src/ovirt/node/installer/core/keyboard_page.py
similarity index 100%
rename from src/ovirt/node/installer/keyboard_page.py
rename to src/ovirt/node/installer/core/keyboard_page.py
diff --git a/src/ovirt/node/installer/password_page.py b/src/ovirt/node/installer/core/password_page.py
similarity index 100%
rename from src/ovirt/node/installer/password_page.py
rename to src/ovirt/node/installer/core/password_page.py
diff --git a/src/ovirt/node/installer/progress_page.py b/src/ovirt/node/installer/core/progress_page.py
similarity index 100%
rename from src/ovirt/node/installer/progress_page.py
rename to src/ovirt/node/installer/core/progress_page.py
diff --git a/src/ovirt/node/installer/storage_vol_page.py b/src/ovirt/node/installer/core/storage_vol_page.py
similarity index 100%
rename from src/ovirt/node/installer/storage_vol_page.py
rename to src/ovirt/node/installer/core/storage_vol_page.py
diff --git a/src/ovirt/node/installer/upgrade_page.py b/src/ovirt/node/installer/core/upgrade_page.py
similarity index 100%
rename from src/ovirt/node/installer/upgrade_page.py
rename to src/ovirt/node/installer/core/upgrade_page.py
diff --git a/src/ovirt/node/installer/welcome_page.py b/src/ovirt/node/installer/core/welcome_page.py
similarity index 100%
rename from src/ovirt/node/installer/welcome_page.py
rename to src/ovirt/node/installer/core/welcome_page.py
diff --git a/src/ovirt/node/plugins.py b/src/ovirt/node/plugins.py
index cd3bfd9..f02c0c3 100644
--- a/src/ovirt/node/plugins.py
+++ b/src/ovirt/node/plugins.py
@@ -37,16 +37,34 @@
"""Load all plugins
"""
modules = []
- for importer, modname, ispkg in __walk_plugins(basemodule):
- #print("Found submodule %s (is a package: %s)" % (modname, ispkg))
- modpath = basemodule.__name__ + "." + modname
- module = __import__(modpath,
- fromlist="dummy")
- #print("Imported", module)
- modules += [module]
+ for groupmodule in __get_plugin_groups(basemodule):
+ for plugin in __get_plugins_for_group(groupmodule):
+ modules.append(plugin)
return modules
+def __get_plugin_groups(basemodule):
+ for importer, modname, ispkg in __walk_plugins(basemodule):
+ if ispkg:
+ modpath = basemodule.__name__ + "." + modname
+ yield __import_by_modname(modpath)
+
+
+def __get_plugins_for_group(groupmodule):
+ for importer, modname, ispkg in __walk_plugins(groupmodule):
+ if (not ispkg and
+ not modname.startswith("_") and
+ not modname.startswith(".")):
+ modpath = groupmodule.__name__ + "." + modname
+ yield __import_by_modname(modpath)
+
+
+def __import_by_modname(modpath):
+ module = __import__(modpath,
+ fromlist="dummy")
+ return module
+
+
class NodePlugin(base.Base):
"""
Basically a plugin provides a model which is changed by the UI (using the
diff --git a/src/ovirt/node/setup/__init__.py b/src/ovirt/node/setup/__init__.py
index 8647625..a990300 100644
--- a/src/ovirt/node/setup/__init__.py
+++ b/src/ovirt/node/setup/__init__.py
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
"""
-This package contains all plugins and the __main__ for the setup application
+This package contains all plugins and the __main__ for the setup application.
+
+Each plugin can create it's own directory (a so called plugin group).
"""
diff --git a/src/ovirt/node/setup/cim/__init__.py b/src/ovirt/node/setup/cim/__init__.py
new file mode 100644
index 0000000..dc94570
--- /dev/null
+++ b/src/ovirt/node/setup/cim/__init__.py
@@ -0,0 +1,4 @@
+# -*- coding: utf-8 -*-
+"""
+CIM Plugin
+"""
diff --git a/src/ovirt/node/config/cim.py b/src/ovirt/node/setup/cim/cim_model.py
similarity index 100%
rename from src/ovirt/node/config/cim.py
rename to src/ovirt/node/setup/cim/cim_model.py
diff --git a/src/ovirt/node/setup/cim_page.py b/src/ovirt/node/setup/cim/cim_page.py
similarity index 96%
rename from src/ovirt/node/setup/cim_page.py
rename to src/ovirt/node/setup/cim/cim_page.py
index 17b0f50..38fa46d 100644
--- a/src/ovirt/node/setup/cim_page.py
+++ b/src/ovirt/node/setup/cim/cim_page.py
@@ -19,7 +19,7 @@
# MA 02110-1301, USA. A copy of the GNU General Public License is
# also available at http://www.gnu.org/copyleft/gpl.html.
from ovirt.node import plugins, valid, ui, utils, exceptions
-from ovirt.node.config import cim as cim_config
+import cim_model
from ovirt.node.plugins import Changeset
"""
@@ -44,7 +44,7 @@
return 45
def model(self):
- cfg = cim_config.CIM().retrieve()
+ cfg = cim_model.CIM().retrieve()
self.logger.debug(cfg)
model = {"cim.enabled": True if cfg["enabled"] else False,
"cim.password": "",
@@ -99,7 +99,7 @@
is_enabled = effective_model["cim.enabled"]
pw = effective_model["cim.password_confirmation"]
- model = cim_config.CIM()
+ model = cim_model.CIM()
model.update(is_enabled)
txs += model.transaction(cim_password=pw)
diff --git a/src/ovirt/node/setup/core/__init__.py b/src/ovirt/node/setup/core/__init__.py
new file mode 100644
index 0000000..0d71911
--- /dev/null
+++ b/src/ovirt/node/setup/core/__init__.py
@@ -0,0 +1,4 @@
+# -*- coding: utf-8 -*-
+"""
+Core Setup Plugins
+"""
diff --git a/src/ovirt/node/setup/kdump_page.py b/src/ovirt/node/setup/core/kdump_page.py
similarity index 100%
rename from src/ovirt/node/setup/kdump_page.py
rename to src/ovirt/node/setup/core/kdump_page.py
diff --git a/src/ovirt/node/setup/keyboard_page.py b/src/ovirt/node/setup/core/keyboard_page.py
similarity index 100%
rename from src/ovirt/node/setup/keyboard_page.py
rename to src/ovirt/node/setup/core/keyboard_page.py
diff --git a/src/ovirt/node/setup/logging_page.py b/src/ovirt/node/setup/core/logging_page.py
similarity index 100%
rename from src/ovirt/node/setup/logging_page.py
rename to src/ovirt/node/setup/core/logging_page.py
diff --git a/src/ovirt/node/setup/monitoring_page.py b/src/ovirt/node/setup/core/monitoring_page.py
similarity index 100%
rename from src/ovirt/node/setup/monitoring_page.py
rename to src/ovirt/node/setup/core/monitoring_page.py
diff --git a/src/ovirt/node/setup/network_page.py b/src/ovirt/node/setup/core/network_page.py
similarity index 98%
rename from src/ovirt/node/setup/network_page.py
rename to src/ovirt/node/setup/core/network_page.py
index 225c5bc..4a7aedd 100644
--- a/src/ovirt/node/setup/network_page.py
+++ b/src/ovirt/node/setup/core/network_page.py
@@ -22,7 +22,8 @@
from ovirt.node.config import defaults
from ovirt.node.plugins import Changeset
from ovirt.node.utils import network
-import ovirt.node.setup.ping
+from ovirt.node.setup.core import ping
+
"""
Network page plugin
@@ -211,8 +212,7 @@
if "button.ping" in changes:
self.logger.debug("Opening ping page")
- plugin_type = ovirt.node.setup.ping.Plugin
- self.application.switch_to_plugin(plugin_type)
+ self.application.switch_to_plugin(ping.Plugin)
return
if "dialog.nic.identify" in changes:
diff --git a/src/ovirt/node/setup/ping.py b/src/ovirt/node/setup/core/ping.py
similarity index 100%
rename from src/ovirt/node/setup/ping.py
rename to src/ovirt/node/setup/core/ping.py
diff --git a/src/ovirt/node/setup/remote_storage_page.py b/src/ovirt/node/setup/core/remote_storage_page.py
similarity index 100%
rename from src/ovirt/node/setup/remote_storage_page.py
rename to src/ovirt/node/setup/core/remote_storage_page.py
diff --git a/src/ovirt/node/setup/security_page.py b/src/ovirt/node/setup/core/security_page.py
similarity index 100%
rename from src/ovirt/node/setup/security_page.py
rename to src/ovirt/node/setup/core/security_page.py
diff --git a/src/ovirt/node/setup/status_page.py b/src/ovirt/node/setup/core/status_page.py
similarity index 100%
rename from src/ovirt/node/setup/status_page.py
rename to src/ovirt/node/setup/core/status_page.py
diff --git a/src/ovirt/node/setup/support_page.py b/src/ovirt/node/setup/core/support_page.py
similarity index 100%
rename from src/ovirt/node/setup/support_page.py
rename to src/ovirt/node/setup/core/support_page.py
diff --git a/src/ovirt/node/setup/snmp/__init__.py b/src/ovirt/node/setup/snmp/__init__.py
new file mode 100644
index 0000000..e324c09
--- /dev/null
+++ b/src/ovirt/node/setup/snmp/__init__.py
@@ -0,0 +1,4 @@
+# -*- coding: utf-8 -*-
+"""
+SNMP Plugin
+"""
diff --git a/src/ovirt/node/config/snmp.py b/src/ovirt/node/setup/snmp/snmp_model.py
similarity index 100%
rename from src/ovirt/node/config/snmp.py
rename to src/ovirt/node/setup/snmp/snmp_model.py
diff --git a/src/ovirt/node/setup/snmp_page.py b/src/ovirt/node/setup/snmp/snmp_page.py
similarity index 96%
rename from src/ovirt/node/setup/snmp_page.py
rename to src/ovirt/node/setup/snmp/snmp_page.py
index d68f6cc..c31648d 100644
--- a/src/ovirt/node/setup/snmp_page.py
+++ b/src/ovirt/node/setup/snmp/snmp_page.py
@@ -19,7 +19,7 @@
# MA 02110-1301, USA. A copy of the GNU General Public License is
# also available at http://www.gnu.org/copyleft/gpl.html.
from ovirt.node import plugins, valid, ui, utils, exceptions
-from ovirt.node.config import snmp as snmp_config
+import snmp_model
from ovirt.node.plugins import Changeset
from ovirt.node.valid import RegexValidator
@@ -64,7 +64,7 @@
return 40
def model(self):
- cfg = snmp_config.SNMP().retrieve()
+ cfg = snmp_model.SNMP().retrieve()
self.logger.debug(cfg)
model = {"snmp.enabled": True if cfg["password"] else False,
"snmp.password": "",
@@ -121,7 +121,7 @@
args = [values[0]]
if values[1] is False: # If set to disabled, set password to None
args[0] = None
- model = snmp_config.SNMP()
+ model = snmp_model.SNMP()
model.update(*args)
txs += model.transaction()
--
To view, visit http://gerrit.ovirt.org/15046
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icaf10816d1c87d9d0404130f496f0f6cad13149a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>
More information about the node-patches
mailing list