summaryrefslogtreecommitdiffstats
path: root/settings_manager.py
Commit message (Collapse)AuthorAgeFilesLines
* settings_manager: Use raw string for regexAndrew Jeffery2018-04-301-1/+1
| | | | | | | | | | | | Avoids a warning about an invalid escape sequence: ./settings_manager.py:221:36: W605 invalid escape sequence '\-' regex = '([a-fA-F0-9]{2}[:|\-]?){6}' Fixes openbmc/openbmc#3140 Change-Id: I3be3d27bf9505b104db53a3a93e26fdc2e79e4db Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* PEP 8 fixesGunnar Mills2018-01-311-5/+9
| | | | | | | | | | | | | | | | | | | | | Added E402 to the ignore errors list. E402 is "module level import not at top of file" and ignoring since settings_manager.py needs to modify the sys.path before importing certain modules. Since the default ignore list is not used anymore, rules E121,E123,E126,E226,E24,E704,W503 are now enforced. Looking at those rules, I believe we should enforce them. Note E121,E123,E126,E226,E24,E704,W503 are all in the default ignore list, so if no ignore list is provided in the setup.cfg these errors are ignored. from pycodestyle --help --ignore=errors skip errors and warnings (e.g. E4,W) (default: E121,E123,E126,E226,E24,E704,W503) Change-Id: I0f64535eb4b4ba471466c8c9c3dbda1f8b33f702 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Restore settings to default on errorPatrick Williams2017-04-061-6/+17
| | | | | | | | | | | | In the event that the value read from a persistence file is invalid, currently a ValueError exception is thrown and the settingsd fails to run. Instead, catch this condition and restore the setting to default. Fixes openbmc/openbmc#1442. Change-Id: I22ce8837d9c48b21bab050f1de9b730ec219bc4b Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* Validate data input *as is* instead of ignoring caseVishwanatha Subbanna2017-01-231-4/+4
| | | | | | | | | | | | | | User input that is supposed to be in certain allowed values were getting validated ignoring the case and this resulted in incorrect behavior in the daemons that consume those values. Since the input value is really the data, its acceptable to be strict about the case and hence this patch validates the user input against the allowed range being sensitive to the case. Fixes openbmc/openbmc#961 Change-Id: I901600918691324b60512c27ab43925c531db09b Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Increase retry time and interval when calling get_subtree_paths()Lei YU2017-01-111-3/+4
| | | | | | | | | | | | | | | | | | | | In create_object(), mapper.get_subtree_paths() may raise DBusException which is not handled, it will cause settings_manager failure. This is a follow up commit after review #1751, where retry interval is added as function parameter, so that it will sleep for an interval between retries. When calling get_subtree_paths(), use retry time 10 and sleep interval 0.1, so far the exception is not raised any more. Make HostSettingsObject to inherit DbusObjectManager helps ObjectMapper to get HostSettingsObject's info more efficiently, otherwise it falls back to call Introspect. Partially fix openbmc/openbmc#862 Change-Id: I87c856e372a20a0ad577ce52f099074cdf5a4355 Signed-off-by: Lei YU <mine260309@gmail.com>
* Still create host settings object if no host controlMatt Spinler2016-12-161-0/+5
| | | | | | | | | | P9 doesn't have a host control object, so the host settings object can't depend on it. As a short term fix just create the host settings object even if the host control object not found. Change-Id: I6e14a1350de3575eb7f18d6d3a698367384cd8fc Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Fix incorrect argument for "PropertiesChanged" signal handlerYi Li2016-11-221-5/+5
| | | | | | | | | | We cannot pass 'fname' as an argument to "PropertiesChanged" signal handler, without changing the signal emitting code. Resolves openbmc/openbmc#824 Change-Id: Ia093914fdba9e3299f9cb409b91e093f74393773 Signed-off-by: Yi Li <adamliyi@msn.com>
* Define bus used by mapper in settings_manager.pySergey Solomin2016-11-151-0/+1
| | | | | | | | | | | Undefined bus in mapper = obmc.mapper.Mapper(bus) in settings_manager.py causes a failure. This patch defines the bus. Resolves openbmc/openbmc#806 Change-Id: I1989c1246c34f8be98591f439bfa1847f3325e00 Signed-off-by: Sergey Solomin <sergey.solomin@us.ibm.com>
* Create top categories dynamically based on inventory object.Sergey Solomin2016-11-081-21/+40
| | | | | | | | | | | | | Presently, the settingsd code will statically create objects 'host0', 'bmc0' and 'bmc0/clock' from top-level categories Host and Bmc in the YAML file. This code provides a 1-to-1 mapping between YAML categories and inventory objects and changes filename format to correspond to an inventory object. Resolves openbmc/openbmc#638 Change-Id: I462cf4c7b7cf042b37e1006a73b36bf11fa52b43 Signed-off-by: Sergey Solomin <sergey.solomin@us.ibm.com>
* phosphor-settingsd - Support YAML categories and sub-categoriesSergey Solomin2016-10-131-30/+72
| | | | | | | | | | | | Currently phosphor-settingsd only supports a single category of 'host0', but the YAML format supports categories and sub-categories. This enhancement supports categories and sub-categories and automatically creates corresponding dbus objects to represent. Resolves openbmc/openbmc#551 Change-Id: I42bf246881ca08e8429771666415321fa997f0dc Signed-off-by: Sergey Solomin <sergey.solomin@us.ibm.com>
* pep8 fixesBrad Bishop2016-09-291-12/+16
| | | | | Change-Id: Iad6cfe757e9defffbeaa6ea00816ef5e17264fa5 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add vim modelinesBrad Bishop2016-09-291-0/+2
| | | | | Change-Id: I86e2d378c229023fb5dcda658535e2587adec343 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* fix settings data directory pathBrad Bishop2016-09-291-1/+4
| | | | | | | fixes openbmc/openbmc#609 Change-Id: Ib817849c30848b636642ea7d0977e7ad9069a4cb Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Validate user inputs in settings daemonVishwanatha Subbanna2016-09-271-7/+94
| | | | | | | | | | | | | | | | Currently, the properties defined under /org/openbmc/settings/host0 can take any value and it is upto the consumer daemons to act only if the valid data was given. This patch will provide a validation logic for all the properties and will raise an exception in the case of invalid inputs. Only on a valid input, will the data gets written and saved. Validation methods and types per property are provided in the configuration file and used by the manager whenever a particular property is changed. Change-Id: I0731ce6e00ab3cb4e11deb98c03fda8d5adad913 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Add python setup scriptAdriana Kobylak2016-09-111-0/+4
| | | | | | | | | Save script in /usr/sbin/ and data file in /usr/share/obmc-phosphor-settings/. Closes openbmc/phosphor-settingsd#9 Change-Id: I1ac67e88dab5904c3d2a96707db0b510a608a8c2 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* manager: ObjectManager/Properties intf fixesBrad Bishop2016-08-311-1/+2
| | | | | | | | Defer name grab until object is created. Unmask ObjectManager/Properties signals. Change-Id: Ife4d15575b87f1e00e5c30b072be3c7b3d117da7 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* manager: pep8 fixesBrad Bishop2016-08-311-11/+15
| | | | | Change-Id: I3457da41acb1ed9e21c2c83f4a6e4509a79f71f7 Signed-of-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* manager: Remove exe permsBrad Bishop2016-08-311-0/+0
| | | | | Change-Id: I84477ba9dd70d5656bc6f66397cd924bd27a427f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Use pyphosphor rather than skeleton Openbmc.pyBrad Bishop2016-05-171-4/+4
| | | | | | | The Openbmc module in skeleton is going away so move to using the bindings add ons in the pyphosphor package. Signed-of-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add Restricted mode as a host settingtomjose2016-03-281-0/+2
|
* Add system_state dbus propertyAdriana Kobylak2016-01-291-42/+35
| | | | | | | | | | | Add system_state property to keep track of the system state across reboots. Include the generated settings_file.py since some build machines cannot have the yaml python module installed. This file will be removed once the code is ported to C in the next rework. Add the path where the settings will be stored in bmc: /var/lib/obmc/ Address review comments from the initial commit.
* Create the settings dbus object.Adriana Kobylak2016-01-101-0/+94
Host settings are specified in a yaml file. Parser converts the yaml file into a dictionary. The settings manager runs on the BMC and uses the dictionary to create the dbus properties and save the values in the BMC so that the values persist.
OpenPOWER on IntegriCloud