summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--interface-definitions/service_config-sync.xml.in62
-rw-r--r--python/vyos/system/compat.py22
2 files changed, 79 insertions, 5 deletions
diff --git a/interface-definitions/service_config-sync.xml.in b/interface-definitions/service_config-sync.xml.in
index 17f59340d..cb51a33b1 100644
--- a/interface-definitions/service_config-sync.xml.in
+++ b/interface-definitions/service_config-sync.xml.in
@@ -344,6 +344,25 @@
</leafNode>
</children>
</node>
+ <node name="qos">
+ <properties>
+ <help>Quality of Service (QoS)</help>
+ </properties>
+ <children>
+ <leafNode name="interface">
+ <properties>
+ <help>Interface to apply QoS policy</help>
+ <valueless/>
+ </properties>
+ </leafNode>
+ <leafNode name="policy">
+ <properties>
+ <help>Service Policy definitions</help>
+ <valueless/>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
<node name="service">
<properties>
<help>System services</help>
@@ -435,6 +454,49 @@
</leafNode>
</children>
</node>
+ <node name="system">
+ <properties>
+ <help>System parameters</help>
+ </properties>
+ <children>
+ <leafNode name="conntrack">
+ <properties>
+ <help>Connection Tracking</help>
+ <valueless/>
+ </properties>
+ </leafNode>
+ <leafNode name="flow-accounting">
+ <properties>
+ <help>Flow accounting</help>
+ <valueless/>
+ </properties>
+ </leafNode>
+ <leafNode name="option">
+ <properties>
+ <help>System Options</help>
+ <valueless/>
+ </properties>
+ </leafNode>
+ <leafNode name="sflow">
+ <properties>
+ <help>sFlow</help>
+ <valueless/>
+ </properties>
+ </leafNode>
+ <leafNode name="static-host-mapping">
+ <properties>
+ <help>Map host names to addresses</help>
+ <valueless/>
+ </properties>
+ </leafNode>
+ <leafNode name="sysctl">
+ <properties>
+ <help>Configure kernel parameters at runtime</help>
+ <valueless/>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
<leafNode name="vpn">
<properties>
<help>Virtual Private Network (VPN)</help>
diff --git a/python/vyos/system/compat.py b/python/vyos/system/compat.py
index 37b834ad6..1b487c1d2 100644
--- a/python/vyos/system/compat.py
+++ b/python/vyos/system/compat.py
@@ -198,11 +198,11 @@ def update_cfg_ver(root_dir:str = '') -> int:
return cfg_version
-def get_default(menu_entries: list, root_dir: str = '') -> Union[int, None]:
+def get_default(data: dict, root_dir: str = '') -> Union[int, None]:
"""Translate default version to menuentry index
Args:
- menu_entries (list): list of dicts of installed version boot data
+ data (dict): boot data
root_dir (str): an optional path to the root directory
Returns:
@@ -213,10 +213,22 @@ def get_default(menu_entries: list, root_dir: str = '') -> Union[int, None]:
grub_cfg_main = f'{root_dir}/{grub.GRUB_CFG_MAIN}'
+ menu_entries = data.get('versions', [])
+ console_type = data.get('console_type', 'tty')
+ console_num = data.get('console_num', '0')
image_name = image.get_default_image()
- sublist = list(filter(lambda x: x.get('version') == image_name,
- menu_entries))
+ sublist = list(filter(lambda x: (x.get('version') == image_name and
+ x.get('console_type') == console_type and
+ x.get('console_num') == console_num and
+ x.get('bootmode') == 'normal'),
+ menu_entries))
+ # legacy images added with legacy tools omitted 'ttyUSB'; if entry not
+ # available, default to initial entry of version
+ if not sublist:
+ sublist = list(filter(lambda x: x.get('version') == image_name,
+ menu_entries))
+
if sublist:
return menu_entries.index(sublist[0])
@@ -291,7 +303,7 @@ def grub_cfg_fields(root_dir: str = '') -> dict:
menu_entries = update_version_list(root_dir)
fields['versions'] = menu_entries
- default = get_default(menu_entries, root_dir)
+ default = get_default(fields, root_dir)
if default is not None:
fields['default'] = default