summaryrefslogtreecommitdiffstats
path: root/pytools
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Revert "skeleton: Remove obmcutil""Brad Bishop2019-04-163-335/+1
| | | | | | | | | | This reverts commit c0da84767c00657c0b3b1afff7d9c5c2f1ed5fdb. We have switched to the bash implementation of obmcutil, so this is no longer required. Change-Id: I10e8008e639bbc6d5d1078d7bcb7c0fa575cc62b Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Revert "skeleton: Remove obmcutil"Brad Bishop2019-04-043-1/+335
| | | | | | | | | Additional changes are required before this can go in. This reverts commit a738350d00b3171a1cbf0a749381b1ac36b4b7f8. Change-Id: Ie16d54d781743960356ad936c12f2a571a1ef8e2 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* skeleton: Remove obmcutilAnthony Wilson2019-01-273-335/+1
| | | | | | | | In the effort to remove python from the bmc, obmcutil has been rewritten in 'sh' and moved to phosphor-state-manager. Change-Id: I39dd0e09fada7c7036b14316376e451ae3e2d330 Signed-off-by: Anthony Wilson <wilsonan@us.ibm.com>
* pytools: Remove dependency to obmc.systemAdriana Kobylak2018-09-242-6/+60
| | | | | | | | | | | | | | The system manager (obmc.system) is being deprecated and the GPIOs has moved out of D-Bus (see openbmc/openbmc#3332). The pytools still depend on the convertGpio function provided by system manager, so copy that function into the tools that use it to remove the dependency. Tested: obmcutil power functions still work, and gpioutil -l and -p work the same. Change-Id: Ia09f95312438040908eb15f93ff6d525665f5ab3 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Point obmcutil chassiskill code at the GPIO JSONMatt Spinler2018-08-141-21/+21
| | | | | Change-Id: Ic4de4f9de2c1755be3430b30ed72dfdbca56f787 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* pytools: Add completion script for obmcutilAndrew Jeffery2018-02-261-0/+11
| | | | | Change-Id: Ia248f971e2c8a1ff80f1e6947ef0af283d4ec9ba Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* obmcutil: alias status to stateJoel Stanley2018-01-311-1/+2
| | | | | | | | Save users who assume the machine status is available with 'obmcutil status' by aliasing status to state. Change-Id: Icdfa6f62ff6f719386edd892ec80fe29c32087f0 Signed-off-by: Joel Stanley <joel@jms.id.au>
* Spelling fixesGunnar Mills2017-10-251-1/+1
| | | | | Change-Id: Ia4ded0c195204543c3df671ea471610237f5f44b Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* pytools: obmcutil: Add `chassiskill` commandAndrew Jeffery2017-10-191-0/+78
| | | | | | | | | | | | | | | Nick reported an issue where the BMC became unusable after the host hit a bug and began "spewing a lot of messages to the console". Save ourselves some DBus transactions and immediate execution of systemd transitions by introducing a `chassiskill` command to directly deassert the the power-up GPIO ourselves. This will immediately terminate the host and free up resources for the BMC to become responsive. As a bonus, the PGOOD monitoring will then execute to clean up the resulting inconsistent BMC/Host state for us. Change-Id: I106a4202b6544b8e78b04938230a4eeee5f132bb Requested-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Optionally wait for standby before getting objectsAndrew Jeffery2017-10-171-1/+42
| | | | | | | | | | | If the user passes --wait, try to immediately get the object but wait until we reach standby before trying again if the first attempt fails. The correct strategy is probably to look for registration of names on the bus, but this ghetto approach also works. Change-Id: I71b6f5d4fcf5841510da6f9877726b875b019d51 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Use 'in' test rather than dict.has_key()Andrew Jeffery2017-10-171-2/+2
| | | | | Change-Id: I51b4d8a9760e0c73f0c36ff6619a484718db3a4b Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Remove unnecessary parenthesesAndrew Jeffery2017-10-171-1/+1
| | | | | Change-Id: I902c6674111a6c1790d08ddf02819dddeede970d Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Implement verbose modeAndrew Jeffery2017-10-171-0/+17
| | | | | | | | | | | | | | | | | | Verbose output is limited to state change requests at the moment, as they are the operations that take significant amounts of time. Further, the verbose output is implemented as following the tail of the journal until the requested state change either succeeds or fails. In testing it was observed that the journal output tends to lag the DBus event that signals the completion of the state transition. As such the patch adds a tuning parameter defining a further waiting period beyond the receipt of the completion signal so that the verbose output looks "reasonable". The default value of the tuning parameter was roughly chosen to correlate well with the journal output on a Witherspoon system for the `poweron` command. Change-Id: I847e2bfeba55d6a3d7d1f7ff1ba1901993c9b505 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Implement blocking behaviourAndrew Jeffery2017-10-171-13/+63
| | | | | | | | | | | | | | | | | | | | The technique to block is to attach a listener for systemd JobRemoved property change events, change the desired OpenBMC state management property to trigger the systemd transition, and then run the gobject dbus mainloop. We terminate the mainloop by invoking quit() in the callback on the captured mainloop object. Additionally, the result of the transition (success or failure) is judged in the callback. We can't obtain the result by returning it, and as we are using Python 2 we cannot meaningfully mutate captured variables to expose it. Instead, a variable is created on the callback function object after it is defined but before the function is invoked, which is mutated inside the function (which can reference its own object) when called. The result is retrieved after the mainloop has terminated and is propagated up the call chain to form the exit status. Change-Id: Ic19aa604631177abea7580de2357d8c6812ee874 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Use format string for all-props outputAndrew Jeffery2017-10-171-1/+1
| | | | | Change-Id: I9d803da8c0ff8862039bb5b7adc07952208820d1 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Consistent naming for command descriptorsAndrew Jeffery2017-10-171-17/+17
| | | | | Change-Id: Ibb6d90dbca9c1bffd7b714dc70342b7927ced94e Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Use argparseAndrew Jeffery2017-10-171-28/+9
| | | | | Change-Id: Id33e3802530aa1bf0cb2af88c16bd94f8bfa219d Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Drop ElementTree and json importsAndrew Jeffery2017-10-171-2/+0
| | | | | Change-Id: I2e310eef36eb7bcea58d1567dcf3efe9a9dbeeb8 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Introduce run_all_commands()Andrew Jeffery2017-10-171-5/+13
| | | | | | | | | | This implements the partner for-loop to the run_one_command() function, moving the implementation out of main(). Again this is to elevate the main() implementation to a higher level of abstraction and reduce cyclomatic complexity. Change-Id: I0abe5ee026750efd10dafb6f113359f035ba5bd8 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Introduce run_one_command()Andrew Jeffery2017-10-171-20/+21
| | | | | | | | | Move the complexity of the for-loop body implementation away from the loop itself. This reduces the general cyclomatic complexity a little and allows for easier consideration of the implementation in isolation. Change-Id: Id779dec720d3582cf89cd9981bcfd8b101b0d386 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Drop redundant prop assignment and testAndrew Jeffery2017-10-161-5/+2
| | | | | Change-Id: I0b1b023aeac7103f0be92201c2475193b0f69e5c Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Collapse redundant assignment and testAndrew Jeffery2017-10-161-4/+1
| | | | | Change-Id: Ie461546c9056829b1b4a081a4031ac91c10e6a42 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Drop ability to set properties from the commandlineAndrew Jeffery2017-10-161-2/+0
| | | | | | | | | This was prioritised below the built-in value anyway so I suspect it is an unused feature, especially now that the org.openbmc interfaces (and the method feature) have gone away. Change-Id: Icd5ab91b5fc08b0f6cc461390f4ac39f7e9e41cd Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Collapse nested conditionsAndrew Jeffery2017-10-161-3/+2
| | | | | Change-Id: Idb1f30dc553cfa95b4669df317a5dbac5dbe8966 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Assign None to val by defaultAndrew Jeffery2017-10-161-2/+1
| | | | | | | And remove a now-redundant branch. Change-Id: I92e91cfb307a98cd60a26e5e5d34bf0ddc384d3f Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Properly use format stringAndrew Jeffery2017-10-161-1/+1
| | | | | | | This changes the format slightly, but not for the worse in my opinion. Change-Id: Ie9297c22f8c3ceff4fc56ae567dbdbb0f128dd51 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Drop parentheses from conditionsAndrew Jeffery2017-10-161-3/+3
| | | | | Change-Id: I85b74febc33e8f44d9df86718ce6e3ba1d6d6933 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Make prop use None instead of empty stringAndrew Jeffery2017-10-161-2/+2
| | | | | Change-Id: I54e04fba2108edce0dbe504ae40f4ae4e073188e Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Rename property_value to valAndrew Jeffery2017-10-161-5/+5
| | | | | Change-Id: I768fbffde2025bb0f92b3aa82fe00f558a68fc2b Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Rename property_name to propAndrew Jeffery2017-10-161-6/+6
| | | | | Change-Id: Ia71c777dd41ca5551319f0a733dbdfce248a876b Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Rename prop to dbus_propAndrew Jeffery2017-10-161-2/+2
| | | | | Change-Id: I4c4a3dd142650f60271011f2dce096166c9917a4 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Rename bus_name to busAndrew Jeffery2017-10-161-2/+2
| | | | | Change-Id: Ida2cbe57d83785e2c8c196b55351d89805590169 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Rename bus to dbus_busAndrew Jeffery2017-10-161-2/+2
| | | | | Change-Id: Ia78317bd76f70bb3f701bfad6e262438ea061d6c Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Rename intf_name to ifaceAndrew Jeffery2017-10-161-4/+4
| | | | | Change-Id: Iddd77221c768c5ce5d2f36dc98b640b7df9c5553 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Rename intf to dbus_ifaceAndrew Jeffery2017-10-161-5/+5
| | | | | Change-Id: Ic1e554136be3b7a3afa213b20e4aea69194c856f Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Rename obj_path to objAndrew Jeffery2017-10-161-2/+2
| | | | | Change-Id: I144def3cc221e923e3c3e10c6d8aadddeb88fea1 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Rename obj to dbus_objAndrew Jeffery2017-10-161-3/+3
| | | | | Change-Id: I9a8b47d862690c5bba4b5e12b9835ad8dd86954d Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Put script into a main() methodAndrew Jeffery2017-10-161-49/+53
| | | | | | | | This is more python hygiene than anything required - it makes the module importable without running arbitrary code at import time. Change-Id: I7f5d8056fa553f484076299823716f73e5c7ead2 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* pytools: obmcutil: Drop commandline method supportAndrew Jeffery2017-10-161-82/+4
| | | | | | | | None of the specified DBus objects have the 'method' property any longer, so drop the code supporting it and cleanup the resulting cruft. Change-Id: I9c66226c233e082e9d518310b62b0641ba410532 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* obmcutil to get get bootprogress from xyz interfaceGeorge Keishing2017-08-181-3/+4
| | | | | Change-Id: I3524ef2bba925d81c9746cfa12c16706dcecad5a Signed-off-by: George Keishing <gkeishin@in.ibm.com>
* Add chassis power on/off to obmcutilAndrew Geissler2017-05-191-0/+14
| | | | | | | | | | | | | The recent refactoring of the systemd target names to power on and off the chassis had a significant impact to openpower partners because they'd encoded the systemctl command to power on just the chassis into a lot of instructions and scripts. There's no guarantee the team won't do this again in the future so a wrapper around the command for this function makes sense to have. Now if the target name changes, it's all abstracted within obmcutil. Change-Id: Ib7b1907cf4618cf0985f76f2c5f5c5e04d4c162f Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* obmcutil: Remove most old org.openbmc commandsPatrick Williams2017-04-261-62/+0
| | | | | | | Fixes openbmc/openbmc#1522. Change-Id: Icbbc67f712f70e408207b7fb4cec3e70992009b3 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* LED: Remove methods used to set and clear Identify LEDs.Vishwanatha Subbanna2017-03-301-6/+1
| | | | | | | | | Now that the LED Group manager support is in, the users can make a call to phosphor-ledmanager and assert the Identify group and hence this code in here is not needed. Change-Id: I7c268710ee8806215c60015d6b39a0ef19601fd0 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Add bmc, chassis, and host states to obmcutilAndrew Geissler2017-03-091-49/+81
| | | | | | | Remove the use of system state from obmcutil Change-Id: Ia74b68d945fce7526aa4bbc62cda4ad242cdec25 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Move poweron and poweroff over to new host state interfacesAndrew Geissler2017-01-301-9/+14
| | | | | | | | Depends on this chain of code: https://gerrit.openbmc-project.xyz/#/c/1340/ Change-Id: Iac35b6a23a2b10a656a0e386de7796cd0194dfae Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* Fix formattingAndrew Geissler2016-12-191-173/+175
| | | | | | | A formatting-only change Change-Id: Ib38451f3b54d752e3648a7fd103eef23d97637f9 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
* pytools/gpioutil: Strip whitespace from value readXo Wang2016-12-051-2/+2
| | | | | | | | Reading from the value file includes a newline following the value, so strip it. Signed-off-by: Xo Wang <xow@google.com> Change-Id: I075794d80f6db0ad8169c6a142ea56b34bd87164
* pytools/gpioutil: Don't set direction if already setXo Wang2016-12-051-4/+5
| | | | | | | | | | | | Writing "out" to GPIO direction will actually clear the output value. This makes it impossible to read the value of outputs with gpioutil since it always sets value to 0 before reading it. Fix: don't write direction if the direction already matches that requested. Change-Id: I2116e6c7f5800239dd89c4f47fe7fd087b3a87cd Signed-off-by: Xo Wang <xow@google.com>
* configs: Remove gpio code from config filesBrad Bishop2016-09-231-3/+4
| | | | | | | Move to a new obmc.system module. Change-Id: Ie02a4b2c14cfcf272d8823d44fb9d7c03b796c87 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Cast dbus.Double for python-jsonBrad Bishop2016-06-241-0/+3
| | | | | | | | | | At some point a floating point value was added to a sensor object. python-json doesn't handle the dbus wrapper types like dbus.Double. Cast dbus.Double to a float, similar to integers. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
OpenPOWER on IntegriCloud