Skip to content

Commit 12eb984

Browse files
amithashfacebook-github-bot
authored andcommitted
psu: Split out the key logic to allow for its local storage
Summary: Allow for the default key to be provided by a python module (but still allow the user to override it). This allows for the local storage of the BMC to be modified to allow for persistent store of it. Test Plan: TODO Reviewed By: ifel Differential Revision: D82985056 fbshipit-source-id: ba236c3cf84bb808898519b5c4c91adc0c554dbe
1 parent 1c07550 commit 12eb984

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
key = None

common/recipes-core/psu-update/files/psu-update-delta-orv3.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@
2222
)
2323
from pyrmd import ModbusException, RackmonInterface as rmd
2424

25+
import delta_key
2526

2627
parser = get_parser()
27-
parser.add_argument("--key", type=auto_int, required=True, help="Sec key")
28+
parser.add_argument("--key", type=auto_int, default=delta_key.key, help="Sec key")
2829

2930

3031
class StatusRegister:
@@ -293,6 +294,9 @@ def print_revision(addr):
293294

294295
def main():
295296
args = parser.parse_args()
297+
if args.key is None:
298+
print("PSU Update Key is needed to upgrade this device")
299+
sys.exit(1)
296300
with suppress_monitoring(args.addr):
297301
try:
298302
print_revision(args.addr)

0 commit comments

Comments
 (0)