Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

celestica get_cpld_reg_value needs to clean output #15250

Closed
kdienes opened this issue May 29, 2023 · 5 comments
Closed

celestica get_cpld_reg_value needs to clean output #15250

kdienes opened this issue May 29, 2023 · 5 comments
Labels
CELESTICA Triaged this issue has been triaged

Comments

@kdienes
Copy link

kdienes commented May 29, 2023

In the revised get_cpld_reg_value:

the function leaves the '\n' on the string,

which means that in

the hex_time has embedded '\n' and cannot parse.

Adding .rstrip() to get_cpld_reg_value seems to fix the issue but since I'm not sure if it should be stripped in _gettimeout or get_cpld_reg_value I'm leaving this as an Issue and not a PR.

@judyjoseph
Copy link
Contributor

@kdienes please add more details. @prgeor, can you check on this

@judyjoseph judyjoseph added CELESTICA Triaged this issue has been triaged labels Jun 7, 2023
@kdienes
Copy link
Author

kdienes commented Jun 7, 2023

Happy to add more details; just let me know what you need. As one example:

def _gettimeout(self):
        h_bit = self._api_helper.get_cpld_reg_value(self.getreg_path, WDT_TIMER_H_BIT_REG)
        m_bit = self._api_helper.get_cpld_reg_value(self.getreg_path, WDT_TIMER_M_BIT_REG)
        l_bit = self._api_helper.get_cpld_reg_value(self.getreg_path, WDT_TIMER_L_BIT_REG)

        hex_time = '0x{}{}{}'.format(h_bit[2:], m_bit[2:], l_bit[2:])
        ms = int(hex_time, 16)
        return int(float(ms)/1000)

So when get_cpld_reg_value() leaves the \n on the end of the string, hex_time ends up unparseable as an int.

@qnos
Copy link
Contributor

qnos commented Jun 8, 2023

PR #15371 fixes the issue. It strip the '\n' in helper api.

@prgeor
Copy link
Contributor

prgeor commented Jun 8, 2023

@qnos for confirming. @kdienes closing for now, please verify the fix

@prgeor prgeor closed this as completed Jun 8, 2023
@prgeor
Copy link
Contributor

prgeor commented Jun 8, 2023

@judyjoseph FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CELESTICA Triaged this issue has been triaged
Projects
None yet
Development

No branches or pull requests

4 participants