From b744927045007510942db3c8cb2dc18aaf34bf32 Mon Sep 17 00:00:00 2001 From: XuWei Date: Tue, 27 Mar 2018 00:03:06 -0400 Subject: [PATCH] fix issue 4983, get autoreboot info --- .../agent/hwctl/executor/openbmc_bmcconfig.py | 4 +++- .../lib/python/agent/hwctl/openbmc_client.py | 14 +++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py index 031397e4d..104a3bd2f 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/executor/openbmc_bmcconfig.py @@ -401,8 +401,10 @@ rmdir \"/tmp/$userid\" \n") if isinstance(value, dict): str_value = value.values()[0] + elif value: + str_value = str(value) else: - str_value = value + str_value = '0' result = '%s: %s: %s' % (node, openbmc.RSPCONFIG_APIS[key]['display_name'], str_value.split('.')[-1]) self.callback.info(result) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index 5bdf8c678..e75caa20c 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -183,7 +183,7 @@ RSPCONFIG_APIS = { 'autoreboot' : { 'baseurl': "/control/host0/auto_reboot/", 'set_url': "attr/AutoReboot", - 'get_url': "attr/AutoReboot", + 'get_url': "", 'display_name': "BMC AutoReboot", 'attr_values': { '0': False, @@ -203,9 +203,9 @@ RSPCONFIG_APIS = { }, }, 'powerrestorepolicy': { - 'baseurl': "/control/host0/power_restore_policy/", - 'set_url': "attr/PowerRestorePolicy", - 'get_url': "attr/PowerRestorePolicy", + 'baseurl': "/control/host0/power_restore_policy", + 'set_url': "/attr/PowerRestorePolicy", + 'get_url': "", 'display_name': "BMC PowerRestorePolicy", 'attr_values': { 'restore': "xyz.openbmc_project.Control.Power.RestorePolicy.Policy.Restore", @@ -214,9 +214,9 @@ RSPCONFIG_APIS = { }, }, 'bootmode': { - 'baseurl': "/control/host0/boot/", - 'set_url': "attr/BootMode", - 'get_url': "attr/BootMode", + 'baseurl': "/control/host0/boot", + 'set_url': "/attr/BootMode", + 'get_url': "", 'display_name':"BMC BootMode", 'attr_values': { 'regular': "xyz.openbmc_project.Control.Boot.Mode.Modes.Regular",