← Back to team overview

cloud-init-dev team mailing list archive

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

 

Scott Moser has proposed merging ~smoser/cloud-init:bug/1685810-nova-lxd into cloud-init:master.

Requested reviews:
  cloud init development team (cloud-init-dev)
Related bugs:
  Bug #1685810 in cloud-init: "nova-lxd needs to read 'product_name' in environment, not 'platform'"
  https://bugs.launchpad.net/cloud-init/+bug/1685810

For more details, see:
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/323057
-- 
Your team cloud init development team is requested to review the proposed merge of ~smoser/cloud-init:bug/1685810-nova-lxd into cloud-init:master.
diff --git a/tools/ds-identify b/tools/ds-identify
index a40b14d..a43b129 100755
--- a/tools/ds-identify
+++ b/tools/ds-identify
@@ -92,7 +92,7 @@ DI_DMI_PRODUCT_UUID=""
 DI_FS_LABELS=""
 DI_KERNEL_CMDLINE=""
 DI_VIRT=""
-DI_PID_1_PLATFORM=""
+DI_PID_1_PRODUCT_NAME=""
 
 DI_UNAME_KERNEL_NAME=""
 DI_UNAME_KERNEL_RELEASE=""
@@ -362,9 +362,9 @@ read_datasource_list() {
     return 0
 }
 
-read_pid1_platform() {
-    local oifs="$IFS" out="" tok="" key="" val="" platform="${UNAVAILABLE}"
-    cached "${DI_PID_1_PLATFORM}" && return
+read_pid1_product_name() {
+    local oifs="$IFS" out="" tok="" key="" val="" product_name="${UNAVAILABLE}"
+    cached "${DI_PID_1_PRODUCT_NAME}" && return
     [ -r "${PATH_PROC_1_ENVIRON}" ] || return
     out=$(tr '\0' '\n' <"${PATH_PROC_1_ENVIRON}")
     IFS="$CR"; set -- $out; IFS="$oifs"
@@ -372,9 +372,9 @@ read_pid1_platform() {
         key=${tok%%=*}
         [ "$key" != "$tok" ] || continue
         val=${tok#*=}
-        [ "$key" = "platform" ] && platform="$val" && break
+        [ "$key" = "product_name" ] && product_name="$val" && break
     done
-    DI_PID_1_PLATFORM="$platform"
+    DI_PID_1_PRODUCT_NAME="$product_name"
 }
 
 dmi_product_name_matches() {
@@ -805,7 +805,7 @@ dscheck_OpenStack() {
         # RDO installed nova (LP: #1675349).
         return ${DS_FOUND}
     fi
-    if [ "${DI_PID_1_PLATFORM}" = "$nova" ]; then
+    if [ "${DI_PID_1_PRODUCT_NAME}" = "$nova" ]; then
         return ${DS_FOUND}
     fi
 
@@ -873,7 +873,7 @@ dscheck_None() {
 
 collect_info() {
     read_virt
-    read_pid1_platform
+    read_pid1_product_name
     read_kernel_cmdline
     read_uname_info
     read_config
@@ -893,7 +893,7 @@ print_info() {
 _print_info() {
     local n="" v="" vars=""
     vars="DMI_PRODUCT_NAME DMI_SYS_VENDOR DMI_PRODUCT_SERIAL"
-    vars="$vars DMI_PRODUCT_UUID PID_1_PLATFORM"
+    vars="$vars DMI_PRODUCT_UUID PID_1_PRODUCT_NAME"
     vars="$vars FS_LABELS KERNEL_CMDLINE VIRT"
     vars="$vars UNAME_KERNEL_NAME UNAME_KERNEL_RELEASE UNAME_KERNEL_VERSION"
     vars="$vars UNAME_MACHINE UNAME_NODENAME UNAME_OPERATING_SYSTEM"

Follow ups