cpu_range with reservation takes precedence
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
charm-sysconfig |
Fix Released
|
Undecided
|
Arif Ali |
Bug Description
When specifying cpu_range, reservation, and migrating to the new options. Some people may forget to reset the cpu_range/
juju config cpu_range=1,2,3,4 reservation=
If the above command it run, the CPUAffinity will be set to 1,2,3,4 and not 1,2
~~~
--- lib_sysconfig.
+++ lib_sysconfig.py 2022-10-20 11:20:13.752422277 +0000
@@ -192,7 +192,7 @@
@property
def cpu_affinity_
"""Return cpu-affinity-range config."""
- if self.reservation == "affinity" and self.cpu_range:
+ if self.charm_
return self.cpu_range
return self.charm_
@@ -218,7 +218,7 @@
@property
def isolcpus(self):
"""Return isolcpus config."""
- if self.reservation == "isolcpus" and self.cpu_range:
+ if self.charm_
return self.cpu_range
return self.charm_
~~
I suspect a change like above should do the trick, or something similar
The workaround, and ought to unset the cpu_range/
Related branches
- Robert Gildein: Approve
- 🤖 prod-jenkaas-bootstack (community): Approve (continuous-integration)
- Eric Chen: Approve
- BootStack Reviewers: Pending requested
-
Diff: 159 lines (+95/-3)3 files modifiedsrc/lib/lib_sysconfig.py (+10/-2)
src/pyproject.toml (+1/-1)
src/tests/unit/test_lib.py (+84/-0)
Changed in charm-sysconfig: | |
assignee: | nobody → Arif Ali (arif-ali) |
status: | New → In Progress |
Changed in charm-sysconfig: | |
status: | In Progress → Fix Committed |
Changed in charm-sysconfig: | |
milestone: | none → 23.01 |
Changed in charm-sysconfig: | |
status: | Fix Committed → Fix Released |