I am doing some testing with this patch in a lxd container (for conditions unmet case), I noticed the `kernel.modprobe` will raise exception: https://pastebin.canonical.com/p/xYBJXsSqZH/
Instead of creating a new patch, I am wondering could you apply following change to your code and re-push, so we can keep the review history here, please ?
Hi Jose:
I am doing some testing with this patch in a lxd container (for conditions unmet case), I noticed the `kernel.modprobe` will raise exception: https:/ /pastebin. canonical. com/p/xYBJXsSqZ H/
Instead of creating a new patch, I am wondering could you apply following change to your code and re-push, so we can keep the review history here, please ?
diff --git a/src/reactive/ telegraf. py b/src/reactive/ telegraf. py telegraf. py telegraf. py telegraf( ): # noqa: C901 "collect_ intel_rdt_ metrics" ]:
hookenv. log("Intel RDT enabled, enabling module and running checks") modprobe( RDT_KERNEL_ MODULE_ NAME, persist=True) modprobe( RDT_KERNEL_ MODULE_ NAME, persist=True) CalledProcessEr ror: .format( RDT_KERNEL_ MODULE_ NAME) log(error_ msg, level=hookenv. ERROR) status_ set("blocked" , error_msg)
check_ valid_intel_ rdt_configurati on() Configuration as e:
index 0b1e71d..8bfd801 100644
--- a/src/reactive/
+++ b/src/reactive/
@@ -807,7 +807,14 @@ def configure_
if config[
# load and persist the required module
- kernel.
+ try:
+ kernel.
+ except subprocess.
+ error_msg = "modprobe {} failed"
+ hookenv.
+ hookenv.
+ return
+
try:
except InvalidIntelRDT