reformat and fix markdownlint issues
Reformat all the files with the latest settings from
openbmc-build-scripts and fix any markdownlint issues.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I955a341441b24487b2e5552692b749fa21b37757
diff --git a/README-settings-manager.md b/README-settings-manager.md
index 4b13608..7f9c50f 100644
--- a/README-settings-manager.md
+++ b/README-settings-manager.md
@@ -1,17 +1,19 @@
+# Settings Manager
+
## Introduction
The settings manager has the following design goals:
-* Each setting should be a distinct D-Bus object.
+- Each setting should be a distinct D-Bus object.
-* The above makes it possible to not even create settings objects that do not
+- The above makes it possible to not even create settings objects that do not
apply to a specific system.
-* It should be possible, for example, for host0/ and host1/ on a system with
- two hosts to not only have different values for certain settings, but
- have different applicable settings as well.
+- It should be possible, for example, for host0/ and host1/ on a system with two
+ hosts to not only have different values for certain settings, but have
+ different applicable settings as well.
-* It should be possible to specify default settings for a system at build-time,
+- It should be possible to specify default settings for a system at build-time,
based on which the settings manager should at run-time create appropriate
D-Bus objects and place them on the bus.
@@ -24,16 +26,16 @@
Here's an example of how entries in the YAML would look:
-```
+```yaml
/xyz/openbmc_project/control/host0/boot_mode:
- Interface: xyz.openbmc_project.Control.Boot.Mode
- Defaults:
- BootMode: Mode::Modes::Regular
+ Interface: xyz.openbmc_project.Control.Boot.Mode
+ Defaults:
+ BootMode: Mode::Modes::Regular
/xyz/openbmc_project/control/host1/boot_mode:
- Interface: xyz.openbmc_project.Control.Boot.Mode
- Defaults:
- BootMode: Mode::Modes::Safe
+ Interface: xyz.openbmc_project.Control.Boot.Mode
+ Defaults:
+ BootMode: Mode::Modes::Safe
```
It is possible to specify this policy file via a bitbake recipe for a system
diff --git a/settings.py b/settings.py
index 57053f7..0867fbc 100755
--- a/settings.py
+++ b/settings.py
@@ -1,32 +1,36 @@
#!/usr/bin/env python3
+import argparse
import os
+
import yaml
from mako.template import Template
-import argparse
def main():
parser = argparse.ArgumentParser(
- description="Settings YAML parser and code generator")
+ description="Settings YAML parser and code generator"
+ )
parser.add_argument(
- '-i', '--settings_yaml', dest='settings_yaml',
- default='settings_example.yaml', help='settings yaml file to parse')
+ "-i",
+ "--settings_yaml",
+ dest="settings_yaml",
+ default="settings_example.yaml",
+ help="settings yaml file to parse",
+ )
args = parser.parse_args()
- with open(os.path.join(script_dir, args.settings_yaml), 'r') as fd:
+ with open(os.path.join(script_dir, args.settings_yaml), "r") as fd:
yamlDict = yaml.safe_load(fd)
# Render the mako template
- template = os.path.join(script_dir, 'settings_manager.mako.hpp')
+ template = os.path.join(script_dir, "settings_manager.mako.hpp")
t = Template(filename=template)
- with open('settings_manager.hpp', 'w') as fd:
- fd.write(
- t.render(
- settingsDict=yamlDict))
+ with open("settings_manager.hpp", "w") as fd:
+ fd.write(t.render(settingsDict=yamlDict))
-if __name__ == '__main__':
+if __name__ == "__main__":
script_dir = os.path.dirname(os.path.realpath(__file__))
main()
diff --git a/settings.yaml b/settings.yaml
index 2f543b7..ba8fe62 100644
--- a/settings.yaml
+++ b/settings.yaml
@@ -69,7 +69,6 @@
keyregex: "host"
subtree: "/org/openbmc/control"
matchregex: "control/(host\\d*)$"
-
# Example of using regex
# macaddress:
# name: mac_address
diff --git a/settings_example.yaml b/settings_example.yaml
index d76b4c7..167c898 100644
--- a/settings_example.yaml
+++ b/settings_example.yaml
@@ -28,7 +28,7 @@
Default: '"00:00:00:00:00:00"'
Validation:
Type: "regex"
- Validator: '^([0-9A-F]{2}[:-]){5}([0-9A-F]{2})$'
+ Validator: "^([0-9A-F]{2}[:-]){5}([0-9A-F]{2})$"
/xyz/openbmc_project/control/host0/power_cap:
- Interface: xyz.openbmc_project.Control.Power.Cap
@@ -40,7 +40,7 @@
Validator: "0..1000"
Unit: "Watts"
PowerCapEnable:
- Default: 'false'
+ Default: "false"
# This interface also ends in Mode and sets an enum.
/xyz/openbmc_project/control/power_mode: