From 53c79f16586e8ee1a89d83a444f2524a5ccf22ac Mon Sep 17 00:00:00 2001 From: Matheus Guilhermino Date: Tue, 16 May 2023 10:18:31 -0300 Subject: [PATCH] Fix warnings on puppet-drbd's resource.pp Some values on resource.pp were defined as strings and operated on as numbers, this causes puppet to automatically convert the strings to the Numeric type, generating the following warning: The string '' was automatically coerced to the numerical value to fix this, all affected values were cast to Numeric. Test Plan: PASS: Build & install PASS: AIO-SX Successful Bootstrap PASS: AIO-SX Successful Unlock Story: 2010757 Task: 48027 Change-Id: Iebac4655b9bf22ba969b684c6709df09641b6969 Signed-off-by: Matheus Guilhermino --- ...gs-to-Numeric-type-to-avoid-warnings.patch | 57 +++++++++++++++++++ .../puppet-drbd-0.5.2/debian/patches/series | 1 + 2 files changed, 58 insertions(+) create mode 100644 config/puppet-modules/puppet-drbd-0.5.2/debian/patches/0012-Convert-strings-to-Numeric-type-to-avoid-warnings.patch diff --git a/config/puppet-modules/puppet-drbd-0.5.2/debian/patches/0012-Convert-strings-to-Numeric-type-to-avoid-warnings.patch b/config/puppet-modules/puppet-drbd-0.5.2/debian/patches/0012-Convert-strings-to-Numeric-type-to-avoid-warnings.patch new file mode 100644 index 000000000..d91d47365 --- /dev/null +++ b/config/puppet-modules/puppet-drbd-0.5.2/debian/patches/0012-Convert-strings-to-Numeric-type-to-avoid-warnings.patch @@ -0,0 +1,57 @@ +From 6873421fb36bf643168a7612dc9973c34da6c322 Mon Sep 17 00:00:00 2001 +From: Matheus Guilhermino +Date: Tue, 16 May 2023 10:00:27 -0300 +Subject: [PATCH] Convert strings to Numeric type to avoid warnings + +Some values on resource.pp were defined as strings and operated on +as numbers, this causes puppet to automatically convert the strings +to the Numeric type, generating the following warning: + +The string '' was automatically coerced to the numerical +value + +to fix this, all affected values were cast to Numeric. + +Signed-off-by: Matheus Guilhermino +--- + manifests/resource.pp | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/manifests/resource.pp b/manifests/resource.pp +index ede961f..05b8678 100644 +--- a/manifests/resource.pp ++++ b/manifests/resource.pp +@@ -93,13 +93,13 @@ define drbd::resource ( + # to 1 and let DRBD auto-regulate its throughput. The end result is that + # multiple competing filesystems (i.e., on same disk device) already have + # their sync throughput reduced. +- $mbps = $link_speed / $num_parallel ++ $mbps = $link_speed / Numeric($num_parallel) + + # bandwidth delay product +- $bdp_k = $mbps * $rtt_ms ++ $bdp_k = $mbps * Numeric($rtt_ms) + + # engineer initial sync rate as percent of link bandwidth +- $rate_M = floor($link_util * $mbps / 8 / 100) ++ $rate_M = floor(Numeric($link_util) * $mbps / 8 / 100) + $rate = "${rate_M}M" + + # engineer c_plan_ahead to default value (tenths) +@@ -114,11 +114,11 @@ define drbd::resource ( + # engineer c_min_rate -- experimentally determined so DRBD is not + # throttled to a crawl even when there is minimal application IO. + # DRBD default is way too small. +- $min_rate_M = 15 + floor($link_util * $mbps / 8 / 100 / 25) ++ $min_rate_M = 15 + floor(Numeric($link_util) * $mbps / 8 / 100 / 25) + $c_min_rate = "${min_rate_M}M" + + # engineer c_max_rate as percent of link bandwidth +- $max_rate_M = floor($link_util * $mbps / 8 / 100) ++ $max_rate_M = floor(Numeric($link_util) * $mbps / 8 / 100) + $c_max_rate = "${max_rate_M}M" + + # various tuning settings to enable larger link bandwidth (eg, 10G) +-- +2.37.1 + diff --git a/config/puppet-modules/puppet-drbd-0.5.2/debian/patches/series b/config/puppet-modules/puppet-drbd-0.5.2/debian/patches/series index 5e8ee8474..2a9c32a60 100644 --- a/config/puppet-modules/puppet-drbd-0.5.2/debian/patches/series +++ b/config/puppet-modules/puppet-drbd-0.5.2/debian/patches/series @@ -9,3 +9,4 @@ 0009-drbd-slow-before-swact.patch 0010-Format-DRBD-resource-cpu-mask-to-support-64-or-larger-cpus.patch 0011-Fix-DRBD-cephmon-resize.patch +0012-Convert-strings-to-Numeric-type-to-avoid-warnings.patch