[openstack-tripleo-image-elements] Update %post script

slagle slagle at fedoraproject.org
Thu Oct 23 18:04:22 UTC 2014


commit ab1129f89845ca56f26af6c1a662ca73c093a97d
Author: James Slagle <jslagle at redhat.com>
Date:   Thu Oct 23 14:01:53 2014 -0400

    Update %post script

 openstack-tripleo-image-elements.spec |   55 ++++++++++++++------------------
 1 files changed, 24 insertions(+), 31 deletions(-)
---
diff --git a/openstack-tripleo-image-elements.spec b/openstack-tripleo-image-elements.spec
index f84461b..aac5339 100644
--- a/openstack-tripleo-image-elements.spec
+++ b/openstack-tripleo-image-elements.spec
@@ -4,7 +4,7 @@
 Name:		openstack-tripleo-image-elements
 Summary:	OpenStack TripleO Image Elements for diskimage-builder
 Version:	0.8.10
-Release:	3%{?dist}
+Release:	4%{?dist}
 License:	ASL 2.0
 Group:		System Environment/Base
 URL:		https://wiki.openstack.org/wiki/TripleO
@@ -59,37 +59,27 @@ chmod +x %{buildroot}/%{_datadir}/tripleo-image-elements/tuskar/install.d/tuskar
 
 %post
 manifest_file=/etc/dib-manifests/dib-element-manifest
+source /usr/share/diskimage-builder/lib/common-functions
+TMP_HOOKS_PATH=$(mktemp -d)
+IMAGE_ELEMENT=$(cat $manifest_file)
+ELEMENTS_PATH=/usr/share/instack-undercloud/:/usr/share/tripleo-image-elements/:/usr/share/diskimage-builder/elements/
+generate_hooks 
+
+# os-apply-config templates
+TEMPLATE_ROOT=/usr/libexec/os-apply-config/templates
+TEMPLATE_SOURCE=$TMP_HOOKS_PATH/os-apply-config
+mkdir -p $TEMPLATE_ROOT
+rsync --delete --exclude='.*.swp' -Cr $TEMPLATE_SOURCE/ $TEMPLATE_ROOT/
+
+# os-refresh-config scripts
+SCRIPT_BASE=/usr/libexec/os-refresh-config
+SCRIPT_SOURCE=$TMP_HOOKS_PATH/os-refresh-config
+mkdir -p $SCRIPT_BASE
+rsync --delete -r $SCRIPT_SOURCE/ $SCRIPT_BASE/
+
+# bin files
+install -m 0755 -o root -g root $TMP_HOOKS_PATH/bin/* /usr/local/bin
 
-if [ -f $manifest_file ]; then
-	# Update os-refresh-config scripts
-	rm -rf /opt/stack/os-config-refresh/*
-	if [ -d /usr/libexec/os-refresh-config ]; then
-	    while read element; do
-		rsync -av \
-		    %{_datadir}/tripleo-image-elements/$element/os-refresh-config/* \
-		    /usr/libexec/os-refresh-config
-	    done < $manifest_file
-	fi
-
-	# Update os-apply-config templates
-	rm -rf /usr/libexec/os-apply-config/templates/*
-	if [ -d /usr/libexec/os-apply-config ]; then
-	    while read element; do
-		rsync -av \
-		    %{_datadir}/tripleo-image-elements/$element/os-apply-config/* \
-		    /usr/libexec/os-apply-config/templates/
-	    done < $manifest_file
-	fi
-
-	# Update binaries in /usr/local/bin
-	if [ -d /usr/local/bin ]; then
-	    while read element; do
-		rsync -av \
-		    %{_datadir}/tripleo-image-elements/$element/bin/* \
-		    /usr/local/bin/
-	    done < $manifest_file
-	fi
-fi
 # be sure to always exit true
 true
 
@@ -102,6 +92,9 @@ true
 %{_datadir}/tripleo-image-elements
 
 %changelog
+* Thu Oct 23 2014 James Slagle <jslagle at redhat.com> 0.8.10-4
+- Update %post script
+
 * Thu Oct 23 2014 James Slagle <jslagle at redhat.com> 0.8.10-3
 - Simplify keepalived custom policy
 


More information about the scm-commits mailing list