From 142ff10cb29ab43f1b665c83d0893140e38d59d8 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 22 Jul 2019 15:06:17 -0400 Subject: [PATCH] Support setting BMC hostname in redfish Provide write access to this currently read only property. Change-Id: I4e4fb7dc836e6657add73205ec2a95977111ffe1 --- pyghmi/redfish/command.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyghmi/redfish/command.py b/pyghmi/redfish/command.py index df29ce1a..4d4532a9 100644 --- a/pyghmi/redfish/command.py +++ b/pyghmi/redfish/command.py @@ -996,6 +996,10 @@ class Command(object): netcfg = self._do_web_request(self._bmcnicurl) return netcfg['HostName'] + def set_hostname(self, hostname): + self._do_web_request(self._bmcnicurl, + {'HostName': hostname}, 'PATCH') + def get_firmware(self, components=()): try: for firminfo in self.oem.get_firmware_inventory(components):