[PATCH phosphor-settingsd] Add Restricted mode as a host setting

OpenBMC Patches openbmc-patches at stwcx.xyz
Tue Mar 29 07:01:14 AEDT 2016


From: tomjose <tomjoseph at in.ibm.com>

---
 settings.yaml       | 4 ++++
 settings_file.py    | 2 +-
 settings_manager.py | 2 ++
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/settings.yaml b/settings.yaml
index 200aa86..c950e4c 100644
--- a/settings.yaml
+++ b/settings.yaml
@@ -20,3 +20,7 @@ host:
         name: power_policy
         type: s
         default: "RESTORE_LAST_STATE"
+    restrictedmode:
+        name: restricted_mode
+        type: b
+        default: false 
diff --git a/settings_file.py b/settings_file.py
index 3efad0b..698d941 100644
--- a/settings_file.py
+++ b/settings_file.py
@@ -1,2 +1,2 @@
 #!/usr/bin/python -u
-SETTINGS={'host': {'bootflags': {'default': 'default', 'type': 's', 'name': 'boot_flags'}, 'powerpolicy': {'default': 'RESTORE_LAST_STATE', 'type': 's', 'name': 'power_policy'}, 'powercap': {'name': 'power_cap', 'min': 0, 'default': 0, 'max': 1000, 'type': 'i', 'unit': 'watts'}, 'sysstate': {'default': '', 'type': 's', 'name': 'system_state'}}}
\ No newline at end of file
+SETTINGS={'host': {'bootflags': {'default': 'default', 'type': 's', 'name': 'boot_flags'}, 'powerpolicy': {'default': 'RESTORE_LAST_STATE', 'type': 's', 'name': 'power_policy'}, 'restrictedmode': {'default': False, 'type': 'b', 'name': 'restricted_mode'}, 'powercap': {'name': 'power_cap', 'min': 0, 'default': 0, 'max': 1000, 'type': 'i', 'unit': 'watts'}, 'sysstate': {'default': '', 'type': 's', 'name': 'system_state'}}}
\ No newline at end of file
diff --git a/settings_manager.py b/settings_manager.py
index e49b466..3d5cf14 100755
--- a/settings_manager.py
+++ b/settings_manager.py
@@ -53,6 +53,8 @@ class HostSettingsObject(Openbmc.DbusProperties):
             self.Set(DBUS_NAME, name, value)
         elif type=="s":
             self.Set(DBUS_NAME, name, str(value))
+        elif type=="b":
+            self.Set(DBUS_NAME, name, value)
 
     # Save the settings to the BMC. This will write the settings value in
     # individual files named by the property name to the BMC.
-- 
2.7.1




More information about the openbmc mailing list