summaryrefslogtreecommitdiffstats
path: root/meta-openstack/classes/identity.bbclass
diff options
context:
space:
mode:
authorMark Asselstine <mark.asselstine@windriver.com>2017-11-15 12:59:53 -0500
committerBruce Ashfield <bruce.ashfield@windriver.com>2017-11-15 15:53:38 -0500
commit3051160f23fe8e06e545859538c86ef3a3c39d7a (patch)
tree97f922e30173df31dda04f10cca3beea27652eb8 /meta-openstack/classes/identity.bbclass
parent3d512115129e2cea97067d23cb72fea62b70dd39 (diff)
downloadmeta-cloud-services-3051160f23fe8e06e545859538c86ef3a3c39d7a.tar.gz
python-*: fixup postinst scripts
Checking for "$D" and doing an "exit 1" now results in errors such as: [log_check] warning: %post(keystone-cronjobs-...) scriptlet failed, exit status 2 during image creation. Instead of escaping the script for "level-1" (image creation postinst) we wrap the "level-2" (first boot) postinst in an if statement. This also ensure the scriptlet in indentity.bbclass is less prone to behaving differently based on the postinsts defined in the classes which inherit 'identity'. Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/classes/identity.bbclass')
-rw-r--r--meta-openstack/classes/identity.bbclass11
1 files changed, 8 insertions, 3 deletions
diff --git a/meta-openstack/classes/identity.bbclass b/meta-openstack/classes/identity.bbclass
index c4b1394..1f4f408 100644
--- a/meta-openstack/classes/identity.bbclass
+++ b/meta-openstack/classes/identity.bbclass
@@ -163,9 +163,11 @@ python populate_packages_append () {
163 163
164 postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True) 164 postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True)
165 if not postinst: 165 if not postinst:
166 postinst = ' if [ "x$D" != "x" ]; then\n' + \ 166 postinst = ''
167 ' exit 1\n' + \ 167
168 ' fi\n' 168 # Only execute on target. Header.
169 postinst += ' if [ -z "$D" ]; then\n'
170
169 postinst += servicecreate_postinst_common_copy 171 postinst += servicecreate_postinst_common_copy
170 172
171 if d.getVar('USERCREATE_PARAM_%s' % pkg, True): 173 if d.getVar('USERCREATE_PARAM_%s' % pkg, True):
@@ -176,6 +178,9 @@ python populate_packages_append () {
176 servicecreate_postinst_service = servicecreate_postinst_service_copy.replace("SERVICECREATE_PARAM", servicecreate_param(d, pkg)) 178 servicecreate_postinst_service = servicecreate_postinst_service_copy.replace("SERVICECREATE_PARAM", servicecreate_param(d, pkg))
177 postinst += servicecreate_postinst_service 179 postinst += servicecreate_postinst_service
178 180
181 # Footer.
182 postinst += ' fi\n'
183
179 d.setVar('pkg_postinst_%s' % pkg, postinst) 184 d.setVar('pkg_postinst_%s' % pkg, postinst)
180 bb.debug(1, 'pkg_postinst_%s = %s' % (pkg, d.getVar('pkg_postinst_%s' % pkg, True))) 185 bb.debug(1, 'pkg_postinst_%s = %s' % (pkg, d.getVar('pkg_postinst_%s' % pkg, True)))
181} 186}