summaryrefslogtreecommitdiffstats
path: root/src/pdmgen.py
Commit message (Collapse)AuthorAgeFilesLines
* Add resolve callout rule support to YAML parserMatt Spinler2017-11-141-0/+16
| | | | | | | The callout to resolve is specified in the YAML. Change-Id: If613fae1959c6a54279b2a50c7d858f3e7d831b9 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Spelling fixesGunnar Mills2017-10-251-4/+4
| | | | | | | | | Spelling errors found using github.com/lucasdemarchi/codespell A tool to fix common misspellings. This tool is licensed under GNU General Public License, version 2. Change-Id: I83c844373ea41d762367085cb16b01d31676e33d Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Add support for metadataGunnar Mills2017-08-211-1/+18
| | | | | | | | Added support for metadata in elog.hpp, elog mako file, and pdmgen. This metadata will be added with the error log. Change-Id: Iaf0fe24d71f6bdd02b51df208b2c1d66c68319d3 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Add support for elog callbackGunnar Mills2017-08-211-0/+26
| | | | | | | | | | | Added support for "callback: elog" in PDM. templates/elog.mako.cpp is used to generate the Elog call. templates/errors.mako.hpp is used to generate the errors.hpp used by generated.hpp to include any error.hpp files like "xyz/openbmc_project/Common/error.hpp" Change-Id: Id0ae3aca4282095f58a8939b70e398bec706d7f5 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Fix bool and string templates/renderingBrad Bishop2017-06-191-3/+13
| | | | | | | | Fix a number of bugs related to rendering and instantiation of string and bool templates. Change-Id: Ic75842b4016f4d96bf5850f9c4ad778d82e075ed Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* pdmgen: Require uppercase meta keysBrad Bishop2017-06-191-0/+12
| | | | | | | | | journald ignores lowercase metadata keys so require them to be uppercase. Abort the config file parse when lowercase keys are found. Change-Id: Icffffdc6680b4d305329c3395f8e2fda6210964f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add deferrable callbacksBrad Bishop2017-06-191-0/+3
| | | | | | | | | | | Deferrable callbacks delay callback invocation until a pre configured length of time has elapsed. One example scenario where deferrable callbacks help is to avoid oscillation when testing a condition and making callbacks frequently. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I180c99b57ec1c9bde4da76d947a026f809341c8a
* Method supportBrad Bishop2017-06-191-0/+80
| | | | | | | | | Add support for a method callback. The method callback enables arbitrary DBus method calls. A sample use case could be starting a systemd unit via the sytemd DBus API. Change-Id: If25131d11497c82f862ae1f47da066c5fd8b2e2e Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* pdmgen: Add support for rendering argument listsBrad Bishop2017-06-191-0/+93
| | | | | | | | | | | | Add core support for rendering argument lists. Add a number of decorators like: -literal: Render a literal value. -cast: Render a C++ cast. -fixbool: Work around yaml boolean capitalization. -quote: Quote a string literal. Change-Id: I4364d9f7a8cb7bb932d347d34bfabb88e694020a Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Link watches to callbacksBrad Bishop2017-06-191-0/+13
| | | | | | | | Callbacks must ultimately be triggered when a property is updated by a watch. Add that support. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I20130a11c19ddcf2c4ae45800f2068b31950bcd6
* Add conditional callbacksBrad Bishop2017-06-191-0/+98
| | | | | | | Enable conditional application of callbacks. Change-Id: I9d765e5f585aac40994b65da3b51ea891beae9bf Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add callback groupsBrad Bishop2017-06-191-0/+62
| | | | | | | | Allow named collections of callbacks to be defined and used anywhere callbacks are used. Change-Id: I3224aa06b2250e9a055bc70d20c186caecd033af Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add support for callbacksBrad Bishop2017-06-191-0/+28
| | | | | | | | | Callbacks are the response in the PDM 'trigger->response' model. Add general support for implementing callbacks and implement a log to systemd journal using that framework. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I8bead5368ee5472a02b47e8bba9e9df3a1f346bc
* Add property watchesBrad Bishop2017-06-191-0/+131
| | | | | | | | | Property watches cache DBus property values given an externally supplied index of property names and paths, in an externally supplied storage location. Change-Id: I155081da88c3ab0e4f6a13b012fc9719203b1888 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add property and property group supportBrad Bishop2017-06-041-0/+93
| | | | | | | | | Add support for defining groups of DBus properties. Groups are a list of property/interface/metadata tuples. Metadata can be used to give a property context when required. Change-Id: I5fc27f4d815b53332a2ddea2d270fde8e355dcbc Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add path and path group supportBrad Bishop2017-06-041-0/+76
| | | | | | | | | Add support for defining groups of object paths. Groups are a list of path/metadata tuples. Metadata can be used to give a path context when required. Change-Id: I355ebf76b40f2ffc8d783e94e888b930cde8ee9c Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* pdmgen: Add core parsing logicBrad Bishop2017-06-041-14/+200
| | | | | | | | | | | | | Add logic to parse each yaml file in three stages. 1 - Invoke factory methods for config file directives, generating more factory methods. 2 - Invoke factory methods from 1 for the full set of renderable items. 3 - Run 'setup' on all renderable items to resolve item cross references. Change-Id: I428a9ae1c41cf65e1efc05f3ec7177375822d772 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* build: General build refactoringBrad Bishop2017-05-231-1/+1
| | | | | | | | | | | Add vars.mk for variable sharing across makefiles. Stub and rename example YAML file and template. Content to be re-introduced as support is added. Move generated C++ to a header file. Add input YAML path option to configure. Change-Id: Ia06e392e8b120b1e1d8614046064fa432a6f9e18 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* pdmgen: Update script optionsBrad Bishop2017-05-221-9/+15
| | | | | | | | | | Add an option for specifying an alternate template for testcases. Update the output option to include the desired output filename as well as the directory. Add an option for specifying the mako template search path. Change-Id: I88634fee193409b25988eb1e7d7680aa866cc2e9 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* parser: Add more skeleton boilerplateBrad Bishop2017-05-151-16/+93
| | | | | | | | | | | Add a basic load/render skeleton. Add docstrings. Add multiple file parsing. Steal indent utility from phosphor-inventory-manager. Scan YAML for syntax and discard. Change-Id: I48e5a3923dc1fadceae6241dd6f757388a2f1c51 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Rename YAML parserBrad Bishop2017-05-151-0/+33
Rename to pdmgen.py in the spirit of phosphor-inventory-manager. Change-Id: Iaa0a2dadb8c051342e62c9126e5c7b7bef2fcdde Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
OpenPOWER on IntegriCloud