Merge ~smoser/cloud-init:bug/1685810-nova-lxd into cloud-init:master

Proposed by Scott Moser
Status: Merged
Merged at revision: 513e99e049eab4acea14e187f59d760adc755b40
Proposed branch: ~smoser/cloud-init:bug/1685810-nova-lxd
Merge into: cloud-init:master
Diff against target: 65 lines (+9/-9)
1 file modified
tools/ds-identify (+9/-9)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
cloud-init Commiters Pending
Review via email: mp+323057@code.launchpad.net

Commit message

nova-lxd: read product_name from environment, not platform.

Apparently signals were crossed when this implementation was done.
Cloud-init was reading 'platform' in the environment of pid 1, but
nova-lxd was setting 'product_name'.

The fix is being made here in cloud-init to instead read product_name.

LP: #1685810

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tools/ds-identify b/tools/ds-identify
2index a40b14d..a43b129 100755
3--- a/tools/ds-identify
4+++ b/tools/ds-identify
5@@ -92,7 +92,7 @@ DI_DMI_PRODUCT_UUID=""
6 DI_FS_LABELS=""
7 DI_KERNEL_CMDLINE=""
8 DI_VIRT=""
9-DI_PID_1_PLATFORM=""
10+DI_PID_1_PRODUCT_NAME=""
11
12 DI_UNAME_KERNEL_NAME=""
13 DI_UNAME_KERNEL_RELEASE=""
14@@ -362,9 +362,9 @@ read_datasource_list() {
15 return 0
16 }
17
18-read_pid1_platform() {
19- local oifs="$IFS" out="" tok="" key="" val="" platform="${UNAVAILABLE}"
20- cached "${DI_PID_1_PLATFORM}" && return
21+read_pid1_product_name() {
22+ local oifs="$IFS" out="" tok="" key="" val="" product_name="${UNAVAILABLE}"
23+ cached "${DI_PID_1_PRODUCT_NAME}" && return
24 [ -r "${PATH_PROC_1_ENVIRON}" ] || return
25 out=$(tr '\0' '\n' <"${PATH_PROC_1_ENVIRON}")
26 IFS="$CR"; set -- $out; IFS="$oifs"
27@@ -372,9 +372,9 @@ read_pid1_platform() {
28 key=${tok%%=*}
29 [ "$key" != "$tok" ] || continue
30 val=${tok#*=}
31- [ "$key" = "platform" ] && platform="$val" && break
32+ [ "$key" = "product_name" ] && product_name="$val" && break
33 done
34- DI_PID_1_PLATFORM="$platform"
35+ DI_PID_1_PRODUCT_NAME="$product_name"
36 }
37
38 dmi_product_name_matches() {
39@@ -805,7 +805,7 @@ dscheck_OpenStack() {
40 # RDO installed nova (LP: #1675349).
41 return ${DS_FOUND}
42 fi
43- if [ "${DI_PID_1_PLATFORM}" = "$nova" ]; then
44+ if [ "${DI_PID_1_PRODUCT_NAME}" = "$nova" ]; then
45 return ${DS_FOUND}
46 fi
47
48@@ -873,7 +873,7 @@ dscheck_None() {
49
50 collect_info() {
51 read_virt
52- read_pid1_platform
53+ read_pid1_product_name
54 read_kernel_cmdline
55 read_uname_info
56 read_config
57@@ -893,7 +893,7 @@ print_info() {
58 _print_info() {
59 local n="" v="" vars=""
60 vars="DMI_PRODUCT_NAME DMI_SYS_VENDOR DMI_PRODUCT_SERIAL"
61- vars="$vars DMI_PRODUCT_UUID PID_1_PLATFORM"
62+ vars="$vars DMI_PRODUCT_UUID PID_1_PRODUCT_NAME"
63 vars="$vars FS_LABELS KERNEL_CMDLINE VIRT"
64 vars="$vars UNAME_KERNEL_NAME UNAME_KERNEL_RELEASE UNAME_KERNEL_VERSION"
65 vars="$vars UNAME_MACHINE UNAME_NODENAME UNAME_OPERATING_SYSTEM"

Subscribers

People subscribed via source and target branches