summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2018-04-30 13:21:51 -0600
committerChad Smith <chad.smith@canonical.com>2018-04-30 13:21:51 -0600
commit11172924a48a47a7231d19d9cefe628dfddda8bf (patch)
tree1ac6832ec576d3f6eb1ea43f4f619f879c05c062 /tools
parent4bd5870f62df771f2a346b0003fd03e44d7fac19 (diff)
downloadvyos-cloud-init-11172924a48a47a7231d19d9cefe628dfddda8bf.tar.gz
vyos-cloud-init-11172924a48a47a7231d19d9cefe628dfddda8bf.zip
IBMCloud: Disable config-drive and nocloud only if IBMCloud is enabled.
Ubuntu images on IBMCloud for 16.04 have some seed data in /var/lib/cloud/data/seed/nocloud-net. In order to have systems with IBMCloud enabled, we modified ds-identify detection to skip that seed if the system was on IBMCloud. That change did not consider the fact that IBMCloud might not be in the datasource list. There was similar logic in the ConfigDrive datasource in ds-identify and the datasource itself. Config drive is now updated to only check and avoid IBMCloud if IBMCloud is enabled. The check in ds-identify for nocloud was dropped. If a user provides a nocloud seed on IBMCloud, then that can be used. This means that systems running Xenial will continue to get their old datasources. LP: #1766401
Diffstat (limited to 'tools')
-rwxr-xr-xtools/ds-identify17
1 files changed, 12 insertions, 5 deletions
diff --git a/tools/ds-identify b/tools/ds-identify
index 7fff5d1e..9f0d96f7 100755
--- a/tools/ds-identify
+++ b/tools/ds-identify
@@ -601,7 +601,6 @@ dscheck_NoCloud() {
*\ ds=nocloud*) return ${DS_FOUND};;
esac
- is_ibm_cloud && return ${DS_NOT_FOUND}
for d in nocloud nocloud-net; do
check_seed_dir "$d" meta-data user-data && return ${DS_FOUND}
check_writable_seed_dir "$d" meta-data user-data && return ${DS_FOUND}
@@ -612,11 +611,12 @@ dscheck_NoCloud() {
return ${DS_NOT_FOUND}
}
+is_ds_enabled() {
+ local name="$1" pad=" ${DI_DSLIST} "
+ [ "${pad#* $name }" != "${pad}" ]
+}
+
check_configdrive_v2() {
- is_ibm_cloud && return ${DS_NOT_FOUND}
- if has_fs_with_label CONFIG-2 config-2; then
- return ${DS_FOUND}
- fi
# look in /config-drive <vlc>/seed/config_drive for a directory
# openstack/YYYY-MM-DD format with a file meta_data.json
local d=""
@@ -631,6 +631,13 @@ check_configdrive_v2() {
debug 1 "config drive seeded directory had only 'latest'"
return ${DS_FOUND}
fi
+
+ is_ds_enabled "IBMCloud"
+ debug 1 "is_ds_enabled returned $?: $DI_DSLIST"
+ is_ds_enabled "IBMCloud" && is_ibm_cloud && return ${DS_NOT_FOUND}
+ if has_fs_with_label CONFIG-2 config-2; then
+ return ${DS_FOUND}
+ fi
return ${DS_NOT_FOUND}
}