summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Change default inventory root pathBrad Bishop2017-02-231-1/+1
| | | | | | | | | | Adhere to OpenBMC naming conventions. /xyz/openbmc_project/Inventory becomes /xyz/openbmc_project/inventory. Change-Id: Ifc5038b0959d38b217960667bf4e6d9507277acd Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Import phosphor-logging header files from new directory.Saqib Khan2017-02-202-2/+2
| | | | | | | | | Phase2: Changing the phosphor-logging header files import from base dir to files under phosphor-logging folder. Once all projects import from the new dir, the files in the base dir will be deleted. Change-Id: I579553e1ce2ececaf9d7207eed35728fdb11fe7c Signed-off-by: Saqib Khan <khansa@us.ibm.com>
* Add object/interface update methodsBrad Bishop2017-02-155-12/+176
| | | | | | | | Add methods that handle both adding/updating objects/interfaces. Change-Id: I3c682365aad18f439babfb0413f29af05327eead Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add comparison utilitiesBrad Bishop2017-02-151-0/+121
| | | | | | | | Add some utilities for comparing paths and pair elements. Change-Id: Ica5f90381160ffb8ee4358662536815a2a9ce2f6 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* pimgen: Remove interfaces.dBrad Bishop2017-02-154-19/+43
| | | | | | | | | | Obtain the information encoded in this file via scanning the filesystem for interface files. Add an interfaces-dir option to specify the filesystem path to scan. Change-Id: I7f5220b515a012d6c6e504f54e4fcb324e6f1f87 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>wip
* pimgen: Un-capitalize booleansBrad Bishop2017-02-151-0/+9
| | | | | | | | The YAML parser capitalizes true and false. Undo that in boolean context. Change-Id: Ib11719ecb77de87991c1add776adefa4e879b786 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add path conditionsBrad Bishop2017-02-157-23/+192
| | | | | | | | | Add support to setProperty and destroyObject to conditionally perform their action based on the result of a condition testing functor. Change-Id: I67ded31f4a7ee0f7a29bb6edc06ebf9249cdc070 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Merge actions.hpp and events.hppBrad Bishop2017-02-159-381/+355
| | | | | | | | | | | | | | | Move all action/filter functors to a common functor.hpp. The intent of this refactoring is to facilitate reuse of functors in more than one context. - Moved functors from actions.hpp and events.hpp to functor.hpp. - Renamed events.cpp to functor.cpp. - Moved Action/Filter types to types.hpp. - Minor namespace shuffling. - Update pimgen to render according to the new namespaces. Change-Id: I630ec1587b8a48f6dc2eac1111365035873310d9 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* setProperty: Allow multiple objectsBrad Bishop2017-02-153-7/+14
| | | | | | | Allow multiple objects when using the setProperty action. Change-Id: Ie65b9abee6240d6a6541b9778d4bf776010f865d Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Update notify method to update interfacesBrad Bishop2017-02-151-68/+2
| | | | | | | When interfaces already exist, update them on notify. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: Iac75b59ed51320b932ff4fe4eab0ed576cef6c7a
* Set properties when constructing interfaces.Brad Bishop2017-02-144-40/+122
| | | | | | | | | Make use of new sdbusplus support for passing a map of properties and their values to the interface constructor. Change-Id: Ib0dd406fd80c89acb723e3a376af26ba57b53d27 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add interface exception classBrad Bishop2017-02-143-0/+87
| | | | | | | Add an exception class for interface errors. Change-Id: I8409e345ff5dd5cf3744b1c2ef9501199bbadfee Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Remove details namespaceBrad Bishop2017-02-097-46/+27
| | | | | | | | The usage was incoherent and it isn't really necessary for application only objects. Change-Id: I76eb5525a39fbbef95548558e777940edf574a06 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Use std::anyBrad Bishop2017-02-094-109/+17
| | | | | | | Replace holder types with std::any. Change-Id: I0cd8c2804ad4bff79a0cfe93589e699afb095e5f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Use std::functionBrad Bishop2017-02-096-91/+23
| | | | | | | | Replace CallableHolder with std::function. No need to re-invent the wheel. Change-Id: I2647a802237dba4a48187718f0d3da59e97575d7 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Remove use of sdbusplus::object::objectBrad Bishop2017-02-092-13/+11
| | | | | | | | | | | Cannot use this interface wrapper with property import constructors at the moment, so just use the interface classes directly. Emit interfaces added/removed signals manually. Change-Id: I688e1b774756d48beac7511dda0387b627e57c1f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Link with libphosphor_dbusBrad Bishop2017-02-098-189/+22
| | | | | | | | | | | Link with libphosphor_dbus. Update the manager implementation to match the new server binding in libphosphor_dbus (bool types for notify and notify signature change). Change-Id: I033d224965caf737591e363b3e2fd666605bff13 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* build: split app/test pimgen invocationBrad Bishop2017-02-0910-102/+148
| | | | | | | | | | | | | Run pimgen twice, once for the application with the real YAML and once for the testcase with the example YAML so that the testcase can run and build sucessfully when an alternate YAML tree is provided. Move extra interface rule generation from pimgen to a makefile generating script. Change-Id: Ib0c01bd2207007b815019232a466fa16889f2005 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add libsdbusplus dependencyDeepak Kodihalli2017-02-092-1/+3
| | | | | Change-Id: Ia31eda92f54c9d19858fb4fb7a3b87cf20f796be Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
* Fix sigsegv with createObjectsBrad Bishop2017-02-091-4/+4
| | | | | | | | | | | The create objects functor lambda was not properly capturing the input object map. Update the signature to accept an rvalue reference and move construct the lambda copy. Change-Id: I901fd978ea0882d5475b7340a2db1017d7aa443c Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Improve example descriptionsBrad Bishop2017-02-023-7/+15
| | | | | | | | These were all labeled: Example Match - improve the description slightly. Change-Id: I1ec78c6512fb66423193b5ce0f42b0fc41cdcc45 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add support for application startup events.Brad Bishop2017-02-024-1/+51
| | | | | | | | Allow clients to specify filters and actions that trigger on application startup. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: Ib36c5bab778d7c87906dd3f61a3a6e033c7ccde1
* Add support for rendering startup eventsBrad Bishop2017-02-012-1/+18
| | | | | Change-Id: I0255cad1746893c41602f6e16bfe917ab1482fe3 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add support for createObjects actionBrad Bishop2017-02-015-48/+168
| | | | | Change-Id: I999a5e506a236eac8ca0944b0e2b003c57612e54 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add support for rendering createObjectsBrad Bishop2017-02-012-0/+41
| | | | | Change-Id: Ic7412430ad223e8237ab0a1d1f26183486c22518 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Maker factory refactoringBrad Bishop2017-02-013-18/+33
| | | | | | | | | | Prepare for the addition of new iface -> class op adapters. Get ready to pass the interface properties to the sdbusplus server binding constructor, once that method is available. Change-Id: I002cc187ac3d8d8a7fd02cc820f831e345e49a61 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Remove Object from testcaseBrad Bishop2017-02-013-19/+40
| | | | | | | | Currently the testcase and the application both define their own Object type. Move to a common header. Change-Id: I05dba67dca7855f522be299fcfd361913ed73fbc Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Minor event refactoringBrad Bishop2017-02-013-24/+37
| | | | | | | | | | | | Assert that all events will share the same filter interface by moving event filters to event base class. Remove virtual on destructors in classes with final. Improve comments in a number of places. Change-Id: Ia32c13fd0f3b9a5fa147a2198a285bce37c27cfb Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* events: Use forward rather than moveBrad Bishop2017-01-311-1/+1
| | | | | | | Fix up a universal reference using move. Change-Id: I443e4d18a9009a7a1394487309ec3331be5c3ee9 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add propertyIs filterBrad Bishop2017-01-316-0/+365
| | | | | | | | | | | The existing property match filter tests a property in the PropertiesChanged signal payload. Add a match filter that tests any arbitrary property on any object. Change-Id: I1c238c03a3ccbf45f7b338693a4342fbd4f670c2 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* pimgen: Add support for rendering propertyIsBrad Bishop2017-01-311-0/+21
| | | | | Change-Id: Ic0e304849f25a3119bd2d985650496e6983d71ad Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Pass a bus connection to actions and filtersBrad Bishop2017-01-313-9/+12
| | | | | | | Prepare for outgoing calls from filters and actions. Change-Id: Ic6255f51f8f4be9f25f2fd5321ee0b7703d60179 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Rename PropertyConditionBrad Bishop2017-01-311-11/+12
| | | | | | | Prepare for additional filters based on properties. Change-Id: Ia063e306a5b4f6c7c48a93824e5cafbfe3e1f8a6 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Enable multiple filtersBrad Bishop2017-01-313-10/+17
| | | | | | | | Add support for specifying multiple filters for a given event. All filters must evaluate true to trigger the associated action. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I86d3e98e5c9e23b65e2e9733c817b38d2ab59465
* Fix hardcoded string in propertyChangedToBrad Bishop2017-01-314-13/+93
| | | | | | | | | | Prior to this change this template will not build with types other than strings. Add an example that tests this. Change-Id: I71e5c4136e7e4fd52fea3e8e027e42634011d630 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* test: Move trigger objects to dedicated threadBrad Bishop2017-01-313-45/+86
| | | | | | | | | Put the trigger object in its own thread rather than the inventory manager thread. This allows the thread under test to make calls to it. Change-Id: I181d2d46a10e4193653df61205ac3380a1d4db2e Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Allow multiple objects to be destroyedBrad Bishop2017-01-316-18/+25
| | | | | | | | Enhance the destroyObject action to take an array rather than a single path. Change-Id: Ic1de7274afc253042b590c71ca200618a6ff54d2 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* pimgen: Switch to new Mako templatesBrad Bishop2017-01-245-161/+108
| | | | | | | | | | | | | | | | | | | | | A substantial structural update to pimgen. The existing template and supporting code is difficult to enhance. Given that the code being generated by pimgen is primarily a large map, with map elements being initialized by simple types, initializers lists or the result of method calls - structure pimgen types in a way that track these givens. yaml: Simplify the yaml structures. MethodCall: become an argument. Mako: Simplify main template. Use new convenience types. Use new decorator types. Remove unused function throughout. Change-Id: I1c3c16776ef8d5d7e005142999817e0371f9ce89 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Remove default action/filterBrad Bishop2017-01-244-31/+2
| | | | | | | These noops are no longer required. Change-Id: Iebe706388d985838eff2259fc93c928a7fe0c0e7 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* pimgen: Argument refactoringBrad Bishop2017-01-241-22/+44
| | | | | | | | | | | | | | Rename the existing argument type to TrivialArgument to prepare for additional argument types. Remove inheritance of sdbusplus.property. Define an argument interface base type. Inherit argument interface from DBusSignature, and move it up by other argument types. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I3fa2b8794838fd0b0b484e618a477de208ead2d9
* pimgen: Add new typesBrad Bishop2017-01-241-1/+114
| | | | | | | | | | | | | | | | Add a number of new types in preparation for another round of refactoring. Indent - An object that facilitates indent agnostic templates. Template - An association of a template with its parent namespace. Quote - A decorator for quoting strings. Cast - A decorator for casting arguments. Literal - A decorator for using literal operators. InitializerList - An initializer list argument. Vector/Wrapper - Convenience types. Change-Id: I92cb6179716f6a04f2fecd3c7c59af5f9ec8d26c Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* pimgen: Add new Mako templatesBrad Bishop2017-01-244-0/+38
| | | | | | | | | | | Add three new templates in preparation for another round of refactoring. argument - For rendering array arguments. method - For rendering method calls. signature - For rendering dbus signature arguments. Change-Id: I9f9806bcb5c1e048aa283e76f9c6f0f8a7bb53ac Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* docs: Update documentationBrad Bishop2017-01-241-23/+45
| | | | | | | Update the README to reflect the current state of affairs. Change-Id: I10397145684176f4529a9506f71216244bc6aaf7 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* pimgen: use yaml.safe_loadBrad Bishop2017-01-241-2/+2
| | | | | | | The extended parsing features of yaml.load are not required. Change-Id: I9517f20c291a6fa3478b13216cf1d503535dbc15 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* pimgen: Display possible commands with helpBrad Bishop2017-01-241-1/+1
| | | | | Change-Id: Ibdc6671289487224dae639643c36f1ac05a3eb6f Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Fix build failureBrad Bishop2017-01-241-1/+1
| | | | | | | | Comparing strings to object paths directly isn't supported at the moment. Change-Id: I98083cf563fe8dde74e7f058720a0481bbe7c2e6 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Fix a bug with new interface signalsBrad Bishop2017-01-162-4/+8
| | | | | | | | When creating new objects, Defer sending of interface added signals until all interfaces have been created. Change-Id: I031846861bb8f569be054e1d0303810fc0dd6ba6 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Don't save empty objectsBrad Bishop2017-01-161-5/+8
| | | | | | | | Handle an exceptional case where the notify method is called without any interfaces. Change-Id: I27424db41e95590968eba7849b424188a0eb743c Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Regenerate manager bindingsBrad Bishop2017-01-165-47/+68
| | | | | | | Re-run sdbus++ and react to the sdbusplus interface namespace move and a real object path type. Change-Id: Id6241b55cd3f2d4c3b85e5545e4ac6e5dd439e34
* Remove pointless move operationsBrad Bishop2017-01-162-8/+8
| | | | | Change-Id: I7ea63f3b78e62fa40247806ceca7b84b7e36f875 Signed-off-by: Brad Bishop <<bradleyb@fuzziesquirrel.com>
OpenPOWER on IntegriCloud