summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-05-29 23:43:29 +0200
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-05-30 11:45:07 +0000
commit11a45cfda5e4d6473a8b6792aaf6eeb5021f2af3 (patch)
treee4c4612963a8ccea7e55480b8ff88dd575be0b71 /src
parentc5fb6aecdc1fc3ca492b1641404ede1eba7a5e74 (diff)
downloadvyos-1x-11a45cfda5e4d6473a8b6792aaf6eeb5021f2af3.tar.gz
vyos-1x-11a45cfda5e4d6473a8b6792aaf6eeb5021f2af3.zip
container: T6406: fix NameError: name 'vyos' is not defined
Commit 74910564f ("T6406: rename cpus to cpu") did not import the function from the Python module. (cherry picked from commit 8439f8a43e93c0560f1abfc2aa60990f521b4d4d)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/container.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/conf_mode/container.py b/src/conf_mode/container.py
index ca09dff9f..3efeb9b40 100755
--- a/src/conf_mode/container.py
+++ b/src/conf_mode/container.py
@@ -29,6 +29,7 @@ from vyos.configdict import node_changed
from vyos.configdict import is_node_changed
from vyos.configverify import verify_vrf
from vyos.ifconfig import Interface
+from vyos.cpu import get_core_count
from vyos.utils.file import write_file
from vyos.utils.process import call
from vyos.utils.process import cmd
@@ -129,7 +130,7 @@ def verify(container):
f'to the system! Container "{name}" will not be started!')
if 'cpu_quota' in container_config:
- cores = vyos.cpu.get_core_count()
+ cores = get_core_count()
if Decimal(container_config['cpu_quota']) > cores:
raise ConfigError(f'Cannot set limit to more cores than available "{name}"!')