From 8df1c5b8e44cff511c6a7565975631ad3e313c16 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 8 Nov 2021 16:23:56 -0500 Subject: [PATCH] Make confignet available as a 'common' script --- .../{ => initramfs}/opt/confluent/bin/apiclient | 0 .../{opt/confluent/bin => profile/scripts}/confignet | 4 ++-- confluent_osdeploy/confluent_osdeploy.spec.tmpl | 12 +++++++++--- 3 files changed, 11 insertions(+), 5 deletions(-) rename confluent_osdeploy/common/{ => initramfs}/opt/confluent/bin/apiclient (100%) rename confluent_osdeploy/common/{opt/confluent/bin => profile/scripts}/confignet (99%) diff --git a/confluent_osdeploy/common/opt/confluent/bin/apiclient b/confluent_osdeploy/common/initramfs/opt/confluent/bin/apiclient similarity index 100% rename from confluent_osdeploy/common/opt/confluent/bin/apiclient rename to confluent_osdeploy/common/initramfs/opt/confluent/bin/apiclient diff --git a/confluent_osdeploy/common/opt/confluent/bin/confignet b/confluent_osdeploy/common/profile/scripts/confignet similarity index 99% rename from confluent_osdeploy/common/opt/confluent/bin/confignet rename to confluent_osdeploy/common/profile/scripts/confignet index 7c7862b3..b8b2d29a 100644 --- a/confluent_osdeploy/common/opt/confluent/bin/confignet +++ b/confluent_osdeploy/common/profile/scripts/confignet @@ -197,9 +197,9 @@ class NetworkManager(object): self.uuidbyname = {} self.uuidbydev = {} self.connectiondetail = {} - ci = subprocess.check_output(['nmcli', 'c']).decode('utf8') + ci = subprocess.check_output(['nmcli', '-t', 'c']).decode('utf8') for inf in ci.splitlines(): - n, u, t, dev = inf.split() + n, u, t, dev = inf.split(':') if n == 'NAME': continue if dev == '--': diff --git a/confluent_osdeploy/confluent_osdeploy.spec.tmpl b/confluent_osdeploy/confluent_osdeploy.spec.tmpl index 13db6b76..a90a92c7 100644 --- a/confluent_osdeploy/confluent_osdeploy.spec.tmpl +++ b/confluent_osdeploy/confluent_osdeploy.spec.tmpl @@ -39,7 +39,7 @@ for os in rhvh4 el7 genesis el8 suse15 ubuntu20.04 coreos el9; do cp -a ../opt . fi cp -a ../${os}/initramfs/* . - cp -a ../common/* . + cp -a ../common/initramfs/* . find . | cpio -H newc -o > ../addons.cpio mv ../addons.cpio . cd .. @@ -53,7 +53,7 @@ for os in el8 suse15 el9; do cp -a ../opt . fi cp -a ../${os}-diskless/initramfs/* . - cp -a ../common/* . + cp -a ../common/initramfs/* . if [ -d ../${os}bin ]; then cp -a ../${os}bin/stateless-bin/* opt/confluent/bin else @@ -67,7 +67,7 @@ mkdir esxi7out cd esxi7out cp -a ../opt . cp -a ../esxi7/initramfs/* . -cp -a ../common/* . +cp -a ../common/initramfs/* . chmod +x bin/* opt/confluent/bin/* tar zcvf ../addons.tgz * mv ../addons.tgz . @@ -81,11 +81,17 @@ for os in rhvh4 el7 el8 el9 genesis suse15 ubuntu20.04 esxi6 esxi7 coreos; do mkdir -p %{buildroot}/opt/confluent/lib/osdeploy/$os/profiles cp ${os}out/addons.* %{buildroot}/opt/confluent/lib/osdeploy/$os/initramfs cp -a $os/profiles/* %{buildroot}/opt/confluent/lib/osdeploy/$os/profiles + for targ in %{buildroot}/opt/confluent/lib/osdeploy/$os/profiles/*; do + cp -a common/profile/* $targ + done if [ -d ${os}disklessout ]; then mkdir -p %{buildroot}/opt/confluent/lib/osdeploy/${os}-diskless/initramfs mkdir -p %{buildroot}/opt/confluent/lib/osdeploy/${os}-diskless/profiles cp ${os}disklessout/addons.* %{buildroot}/opt/confluent/lib/osdeploy/${os}-diskless/initramfs cp -a ${os}-diskless/profiles/* %{buildroot}/opt/confluent/lib/osdeploy/$os-diskless/profiles + for targ in %{buildroot}/opt/confluent/lib/osdeploy/$os-diskless/profiles/*; do + cp -a common/profile/* $targ + done fi done find %{buildroot}/opt/confluent/lib/osdeploy/ -name .gitignore -exec rm -f {} +