From 39fb229ef1d5ba05f9ced53f04c69d6ec66b9ff6 Mon Sep 17 00:00:00 2001 From: tkucherera Date: Thu, 2 May 2024 10:29:20 -0400 Subject: [PATCH 1/4] check update args before setting anything --- confluent_client/confluent/client.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/confluent_client/confluent/client.py b/confluent_client/confluent/client.py index a7c13cd3..f9887d4e 100644 --- a/confluent_client/confluent/client.py +++ b/confluent_client/confluent/client.py @@ -705,6 +705,14 @@ def updateattrib(session, updateargs, nodetype, noderange, options, dictassign=N noderange, 'attributes/all', dictassign[key], key) else: if "=" in updateargs[1]: + update_ready = True + for arg in updateargs[1:]: + if not '=' in arg: + update_ready = False + sys.stderr.write('Error: {0} not a valid expression\n'.format(str(arg))) + exitcode = 1 + if not update_ready: + sys.exit(exitcode) try: for val in updateargs[1:]: val = val.split('=', 1) From 930ff3e20d97776223f7b9585373ef9514bcf172 Mon Sep 17 00:00:00 2001 From: tkucherera Date: Thu, 2 May 2024 10:41:30 -0400 Subject: [PATCH 2/4] fix error message --- confluent_client/confluent/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/confluent_client/confluent/client.py b/confluent_client/confluent/client.py index f9887d4e..a9957b96 100644 --- a/confluent_client/confluent/client.py +++ b/confluent_client/confluent/client.py @@ -595,7 +595,7 @@ def print_attrib_path(path, session, requestargs, options, rename=None, attrpref else: printmissing.add(attr) for missing in printmissing: - sys.stderr.write('Error: {0} not a valid attribute\n'.format(attr)) + sys.stderr.write('Error: {0} not a valid attribute\n'.format(missing)) return exitcode @@ -709,9 +709,9 @@ def updateattrib(session, updateargs, nodetype, noderange, options, dictassign=N for arg in updateargs[1:]: if not '=' in arg: update_ready = False - sys.stderr.write('Error: {0} not a valid expression\n'.format(str(arg))) exitcode = 1 if not update_ready: + sys.stderr.write('Error: {0} Can not set and read at the same time!\n'.format(str(updateargs[1:]))) sys.exit(exitcode) try: for val in updateargs[1:]: From 172c57c6f19f8a5bc593fb13ac76df9afee87bf4 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 15 May 2024 12:28:41 -0400 Subject: [PATCH 3/4] Fix media location search for EL8 EL8 distributions marked the 'OS' as dracut, workaround by trying to use PRETTY_NAME --- .../usr/lib/dracut/hooks/pre-trigger/01-confluent.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/confluent_osdeploy/el8/initramfs/usr/lib/dracut/hooks/pre-trigger/01-confluent.sh b/confluent_osdeploy/el8/initramfs/usr/lib/dracut/hooks/pre-trigger/01-confluent.sh index a1778e08..caa60997 100644 --- a/confluent_osdeploy/el8/initramfs/usr/lib/dracut/hooks/pre-trigger/01-confluent.sh +++ b/confluent_osdeploy/el8/initramfs/usr/lib/dracut/hooks/pre-trigger/01-confluent.sh @@ -228,6 +228,15 @@ if [ "$textconsole" = "true" ] && ! grep console= /proc/cmdline > /dev/null; the fi . /etc/os-release +if [ "$ID" = "dracut" ]; then + ID=$(echo $PRETTY_NAME|awk '{print $1}') + VERSION_ID=$(echo $VERSION|awk '{print $1}') + if [ "$ID" = "Oracle" ]; then + ID=OL + elif [ "$ID" = "Red" ]; then + ID=RHEL + fi +fi ISOSRC=$(blkid -t TYPE=iso9660|grep -Ei ' LABEL="'$ID-$VERSION_ID|sed -e s/:.*//) if [ -z "$ISOSRC" ]; then echo inst.repo=$proto://$mgr/confluent-public/os/$profilename/distribution >> /etc/cmdline.d/01-confluent.conf From c0bcc3791d0071c565d8b480d10b3e51b0261c5a Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 15 May 2024 12:30:13 -0400 Subject: [PATCH 4/4] Fix handling some eatonpdu return values --- .../confluent/plugins/hardwaremanagement/eatonpdu.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/plugins/hardwaremanagement/eatonpdu.py b/confluent_server/confluent/plugins/hardwaremanagement/eatonpdu.py index 16be5b38..4c3d4654 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/eatonpdu.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/eatonpdu.py @@ -33,7 +33,8 @@ def simplify_name(name): def sanitize_json(data): if not isinstance(data, str): data = data.decode('utf8') - return re.sub(r'([^ {:,]*):', r'"\1":', data).replace("'", '"') + return re.sub(r'([^ {:,]*):', r'"\1":', data).replace("'", '"').replace(',,', ',null,') + def answer_challenge(username, password, data): realm = data[0]