merge_config_file fail without core components
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
devstack |
Fix Released
|
Low
|
Toshiaki Takahashi |
Bug Description
We created separated OpenStack controller node which include some component (actually, Tacker) but not include core component (Nova, Neutron...).
In this case, post-config setting leads to the following error.
=======
2020-12-20 16:56:56.687 | + inc/meta-
2020-12-20 16:56:56.687 | BEGIN {
2020-12-20 16:56:56.687 | section = ""
2020-12-20 16:56:56.687 | last_section = ""
2020-12-20 16:56:56.687 | section_count = 0
2020-12-20 16:56:56.687 | }
2020-12-20 16:56:56.687 | /^\[.+\]/ {
2020-12-20 16:56:56.687 | gsub("[][]", "", $1);
2020-12-20 16:56:56.687 | section=$1
2020-12-20 16:56:56.687 | next
2020-12-20 16:56:56.687 | }
2020-12-20 16:56:56.687 | /^ *\#/ {
2020-12-20 16:56:56.687 | next
2020-12-20 16:56:56.687 | }
2020-12-20 16:56:56.687 | /^[^ \t]+/ {
2020-12-20 16:56:56.687 | # get offset of first = in $0
2020-12-20 16:56:56.687 | eq_idx = index($0, "=")
2020-12-20 16:56:56.687 | # extract attr & value from $0
2020-12-20 16:56:56.687 | attr = substr($0, 1, eq_idx - 1)
2020-12-20 16:56:56.687 | value = substr($0, eq_idx + 1)
2020-12-20 16:56:56.688 | # only need to strip trailing whitespace from attr
2020-12-20 16:56:56.688 | sub(/[ \t]*$/, "", attr)
2020-12-20 16:56:56.688 | # need to strip leading & trailing whitespace from value
2020-12-20 16:56:56.688 | sub(/^[ \t]*/, "", value)
2020-12-20 16:56:56.688 | sub(/[ \t]*$/, "", value)
2020-12-20 16:56:56.688 |
2020-12-20 16:56:56.688 | # cfg_attr_count: number of config lines per [section, attr]
2020-12-20 16:56:56.688 | # cfg_attr: three dimensional array to keep all the config lines per [section, attr]
2020-12-20 16:56:56.688 | # cfg_section: keep the section names in the same order as they appear in local.conf
2020-12-20 16:56:56.688 | # cfg_sec_attr_name: keep the attr names in the same order as they appear in local.conf
2020-12-20 16:56:56.688 | if (! (section, attr) in cfg_attr_count) {
2020-12-20 16:56:56.688 | if (section != last_section) {
2020-12-20 16:56:56.688 | cfg_section[
2020-12-20 16:56:56.688 | last_section = section
2020-12-20 16:56:56.688 | }
2020-12-20 16:56:56.688 | attr_count = cfg_sec_
2020-12-20 16:56:56.688 | cfg_sec_
2020-12-20 16:56:56.688 |
2020-12-20 16:56:56.688 | cfg_attr[section, attr, 0] = value
2020-12-20 16:56:56.688 | cfg_attr_
2020-12-20 16:56:56.688 | } else {
2020-12-20 16:56:56.688 | lno = cfg_attr_
2020-12-20 16:56:56.688 | cfg_attr[section, attr, lno] = value
2020-12-20 16:56:56.688 | }
2020-12-20 16:56:56.688 | }
2020-12-20 16:56:56.688 | END {
2020-12-20 16:56:56.688 | # Process each section in order
2020-12-20 16:56:56.688 | for (sno = 0; sno < section_count; sno++) {
2020-12-20 16:56:56.688 | section = cfg_section[sno]
2020-12-20 16:56:56.688 | # The ini routines simply append a config item immediately
2020-12-20 16:56:56.688 | # after the section header. To keep the same order as defined
2020-12-20 16:56:56.688 | # in local.conf, invoke the ini routines in the reverse order
2020-12-20 16:56:56.688 | for (attr_no = cfg_sec_
2020-12-20 16:56:56.688 | attr = cfg_sec_
2020-12-20 16:56:56.688 | if (cfg_attr_
2020-12-20 16:56:56.688 | print "iniset " configfile " " section " " attr " \"" cfg_attr[section, attr, 0] "\""
2020-12-20 16:56:56.688 | else {
2020-12-20 16:56:56.688 | # For multiline, invoke the ini routines in the reverse order
2020-12-20 16:56:56.688 | count = cfg_attr_
2020-12-20 16:56:56.689 | print "inidelete " configfile " " section " " attr
2020-12-20 16:56:56.689 | print "iniset " configfile " " section " " attr " \"" cfg_attr[section, attr, count - 1] "\""
2020-12-20 16:56:56.689 | for (l = count -2; l >= 0; l--)
2020-12-20 16:56:56.689 | print "iniadd_literal " configfile " " section " " attr " \"" cfg_attr[section, attr, l] "\""
2020-12-20 16:56:56.689 | }
2020-12-20 16:56:56.689 | }
2020-12-20 16:56:56.689 | }
2020-12-20 16:56:56.689 | }
2020-12-20 16:56:56.689 | '
2020-12-20 16:56:56.689 | + inc/meta-
2020-12-20 16:56:56.689 | awk: line 31: syntax error at or near ,
2020-12-20 16:56:56.689 | awk: line 41: syntax error at or near }
2020-12-20 16:56:56.689 | awk: line 45: syntax error at or near }
=======
The following is local.conf.
=======
[[local|localrc]]
disable_
enable_service q-agt
enable_service tacker
enable_service tacker-conductor
ADMIN_PASSWORD=
CELLSV2_
DATABASE_
DATABASE_
DATABASE_
ERROR_ON_
FIXED_RANGE=
FLOATING_
GLANCE_
HOST_IP=
IPV4_ADDRS_
IS_ZUUL_FT="True"
KEYSTONE_
LIBVIRT_TYPE="qemu"
LOGFILE=
LOG_COLOR="False"
MYSQL_HOST=
NETWORK_
NOVA_VNC_
NOVNC_FROM_
OVS_BRIDGE_
PHYSICAL_
PUBLIC_
PUBLIC_
Q_DVR_MODE="dvr"
Q_HOST=
RABBIT_
RABBIT_
SERVICE_
SERVICE_
TACKER_
TACKER_
VERBOSE="True"
VERBOSE_
LIBS_FROM_
enable_plugin tacker https:/
[[post-
[connect_grant]
base_url = http://
[connect_
base_url = http://
pipeline = package_
=======
My guess is that this is because gawk is not installed in the environment, which seems Nova's requirement.
Changed in devstack: | |
importance: | Undecided → Low |
I proposed a patch for fix.
https:/ /review. opendev. org/c/openstack /devstack/ +/768363