[node-patches] Change in ovirt-node[master]: move cim support to plugin module

jboggs at redhat.com jboggs at redhat.com
Wed Oct 24 17:39:07 UTC 2012


Joey Boggs has uploaded a new change for review.

Change subject: move cim support to plugin module
......................................................................

move cim support to plugin module

auto installation support doesnt fully exist for cim will add the missing bits
in a followup patch

Signed-off-by: Joey Boggs <jboggs at redhat.com>
Change-Id: I534c613e79947e4617628ba54badae828ea0a948
---
M ovirt-node.spec.in
M plugins/Makefile.am
A plugins/cim.minimize
R plugins/cim.py
M recipe/common-pkgs.ks
M scripts/Makefile.am
M tools/edit-node
7 files changed, 58 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/88/8788/1

diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in
index 90ce90e..50780b9 100644
--- a/ovirt-node.spec.in
+++ b/ovirt-node.spec.in
@@ -123,6 +123,27 @@
 %post plugin-snmp
 systemctl enable snmpd.service
 
+
+%package plugin-cim
+Summary:        CIM plugin for %{product_family} image
+Group:          Applications/System
+Requires:       libvirt-cim
+Requires:       sblim-sfcb
+
+%description plugin-cim
+This package provides a cim plugin for use with%{product_family} image.
+
+
+%post plugin-cim
+%if ! %{is_systemd}
+/sbin/chkconfig --add ovirt-cim
+%else
+if [ $1 -eq 1 ] ; then
+    # Initial installation
+    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
+%endif
+
 %prep
 %setup -q
 
@@ -172,7 +193,6 @@
 /sbin/chkconfig --add ovirt-firstboot
 /sbin/chkconfig --add ovirt
 /sbin/chkconfig --add ovirt-post
-/sbin/chkconfig --add ovirt-cim
 %else
 if [ $1 -eq 1 ] ; then
     # Initial installation
@@ -211,13 +231,11 @@
     /sbin/service ovirt-firstboot stop >/dev/null 2>&1
     /sbin/service ovirt stop >/dev/null 2>&1
     /sbin/service ovirt-post stop >/dev/null 2>&1
-    /sbin/service ovirt-cim stop >/dev/null 2>&1
     /sbin/chkconfig --del ovirt-awake
     /sbin/chkconfig --del ovirt-early
     /sbin/chkconfig --del ovirt-firstboot
     /sbin/chkconfig --del ovirt
     /sbin/chkconfig --del ovirt-post
-    /sbin/chkconfig --del ovirt-cim
 fi
 %else
 if [ $1 -eq 0 ] ; then
@@ -226,15 +244,26 @@
     /bin/systemctl --no-reload disable ovirt.service > /dev/null 2>&1 || :
     /bin/systemctl --no-reload disable ovirt-post.service > /dev/null 2>&1 || :
     /bin/systemctl --no-reload disable ovirt-early.service > /dev/null 2>&1 || :
-    /bin/systemctl --no-reload disable ovirt-cim.service > /dev/null 2>&1 || :
 
     /bin/systemctl stop ovirt.service > /dev/null
     /bin/systemctl stop ovirt-post.service > /dev/null
     /bin/systemctl stop ovirt-early.service > /dev/null
-    /bin/systemctl stop ovirt-cim.service > /dev/null
 fi
 %endif
 
+%preun plugin-cim
+%if ! %{is_systemd}
+if [ $1 = 0 ] ; then
+    /sbin/service ovirt-cim stop >/dev/null 2>&1
+    /sbin/chkconfig --del ovirt-cim
+fi
+%else
+if [ $1 -eq 0 ] ; then
+    # Package removal, not upgrade
+    /bin/systemctl --no-reload disable ovirt-cim.service > /dev/null 2>&1 || :
+    /bin/systemctl stop ovirt-cim.service > /dev/null
+fi
+%endif
 
 %files recipe
 %defattr(0644,root,root,0755)
@@ -253,6 +282,19 @@
 %{python_sitelib}/ovirt_config_setup/snmp.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
+%{_sysconfdir}/ovirt-plugins.d/cim.minimize
+%if %{is_systemd}
+%{_unitdir}/ovirt-cim.service
+%else
+%{_initrddir}/ovirt-cim
+%endif
+
+
+
+
 %files
 %defattr(-,root,root)
 %config(noreplace) %attr(0644,root,root) %{_sysconfdir}/default/ovirt
@@ -302,6 +344,7 @@
 %{_sbindir}/persist
 %{_sbindir}/unpersist
 %{python_sitelib}/ovirt_config_setup
+%exclude %{python_sitelib}/ovirt_config_setup/cim.py*
 %exclude %{python_sitelib}/ovirt_config_setup/snmp.py*
 %{python_sitelib}/ovirtnode
 %{python_sitelib}/augeas*
@@ -313,14 +356,12 @@
 %{_unitdir}/ovirt-firstboot.service
 %{_unitdir}/ovirt-post.service
 %{_unitdir}/ovirt-early.service
-%{_unitdir}/ovirt-cim.service
 %else
 %{_initrddir}/ovirt-awake
 %{_initrddir}/ovirt-early
 %{_initrddir}/ovirt-firstboot
 %{_initrddir}/ovirt
 %{_initrddir}/ovirt-post
-%{_initrddir}/ovirt-cim
 %endif
 
 
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 845b2b4..a44f0fa 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -20,10 +20,12 @@
 pyovirtconfigbootdir = $(sysconfdir)/ovirt-config-boot.d
 
 dist_pyovirtconfigsetup_SCRIPTS = \
-  snmp.py
+  snmp.py \
+  cim.py
 
 dist_plugins_DATA = \
-  snmp.minimize
+  snmp.minimize \
+  cim.minimize
 
 dist_pyovirtconfigboot_SCRIPTS = \
   snmp_autoinstall.py
diff --git a/plugins/cim.minimize b/plugins/cim.minimize
new file mode 100644
index 0000000..33d7fe2
--- /dev/null
+++ b/plugins/cim.minimize
@@ -0,0 +1,4 @@
+droprpm tog-pegasus
+droprpm tog-pegasus-libs
+droprpm mailcap
+droprpm openslp
diff --git a/scripts/ovirt_config_setup/cim.py b/plugins/cim.py
similarity index 100%
rename from scripts/ovirt_config_setup/cim.py
rename to plugins/cim.py
diff --git a/recipe/common-pkgs.ks b/recipe/common-pkgs.ks
index 4e3e275..0de2ef2 100644
--- a/recipe/common-pkgs.ks
+++ b/recipe/common-pkgs.ks
@@ -107,9 +107,6 @@
 rpm-python
 # for efi installs
 efibootmgr
-# libvirt-cim
-sblim-sfcb
-libvirt-cim
 # yum for plugins
 yum
 # Consistent ethernet device naming
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 8f50349..bb63680 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -58,7 +58,6 @@
 pyovirtconfigsetupdir =$(pythondir)/ovirt_config_setup
 pyovirtconfigsetup_PYTHON = \
   ovirt_config_setup/__init__.py \
-  ovirt_config_setup/cim.py \
   ovirt_config_setup/plugins.py
 
 if TARGET_FEDORA
diff --git a/tools/edit-node b/tools/edit-node
index e6cce27..e685c91 100755
--- a/tools/edit-node
+++ b/tools/edit-node
@@ -1070,7 +1070,8 @@
             valid_write_locations = [ "/etc",
                                       "/opt",
                                       "/usr/share/man",
-                                      "/usr/lib/python"]
+                                      "/usr/lib/python",
+                                      "/usr/lib/systemd"]
         elif options.install_dup:
             valid_write_locations = [ "/etc/modprobe.d",
                                       "/etc/depmod.d",


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I534c613e79947e4617628ba54badae828ea0a948
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Joey Boggs <jboggs at redhat.com>



More information about the node-patches mailing list