-
Notifications
You must be signed in to change notification settings - Fork 95
Dev: ui_sbd: Configure crashdump watchdog timeout #1732
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
Dev: ui_sbd: Configure crashdump watchdog timeout #1732
Conversation
d1be2d5 to
d0edb67
Compare
f377478 to
e3f1f86
Compare
e3f1f86 to
e218c75
Compare
crmsh/cibquery.py
Outdated
| )) | ||
|
|
||
|
|
||
| def has_primitive(cib: lxml.etree.Element, ra: ResourceAgent) -> list[str]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
has_primitive sounds like to return a boolean.
| def has_primitive(cib: lxml.etree.Element, ra: ResourceAgent) -> list[str]: | |
| def get_primitives_with_ra(cib: lxml.etree.Element, ra: ResourceAgent) -> list[str]: |
crmsh/cibquery.py
Outdated
| return [e.get('id') for e in cib.xpath( | ||
| f'/cib/configuration/resources//primitive[@class="{ra.m_class}"{provider_condition} and @type="{ra.m_type}"]' | ||
| )] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return [e.get('id') for e in cib.xpath( | |
| f'/cib/configuration/resources//primitive[@class="{ra.m_class}"{provider_condition} and @type="{ra.m_type}"]' | |
| )] | |
| return cib.xpath( | |
| f'/cib/configuration/resources//primitive[@class="{ra.m_class}"{provider_condition} and @type="{ra.m_type}"]/@id', | |
| ) |
crmsh/cibquery.py
Outdated
| e.get('value') for e in cib.xpath( | ||
| f'/cib/configuration/resources//primitive[@id="{res_id}"]' | ||
| f'/instance_attributes/nvpair[@name="{param_name}"]' | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can use .../@value in xpath.
crmsh/ui_sbd.py
Outdated
| PARSE_RE = re.compile( | ||
| # Match keys with non-empty values, capturing possible suffix | ||
| r'(\w+)(?:-(\w+))?=("[^"]+"|[\w/\d;]+)' | ||
| r'([\w-]+)-([\w-]+)=([\w/\d]+)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment and code disagree here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update as
PARSE_RE = re.compile(
# To extract key, suffix and value from these possible arguments:
# watchdog-timeout=30
# crashdump-watchdog-timeout=120
# watchdog-device=/dev/watchdog
r'([\w-]+)-([\w]+)=([\w/]+)'
)And added the unit test for it
be8789d to
187d48c
Compare
This commit supports configuring the crashdump watchdog timeout by using `crm sbd configure crashdump-watchdog-timeout=<timeout>`, for both disk-based and diskless SBD.
187d48c to
48e37ad
Compare
when configuring crashdump option.
Skip the process of configuring if the value is the same. Also load all attributes of SBD UI class before running any sbd subcommand, to ensure all attributes are updated.
When no crashdump watchdog timeout configured, return False; When crashdump watchdog timeout was specified and not equal to previous value, return True; Or, when watchdog timeout was specified and not equal to previous value, return True.
40f10f4 to
afb7d99
Compare
To cleanup crashdump option from fence_sbd agent and related configurations in /etc/sysconfig/sbd
afb7d99 to
964c262
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
This PR supports configuring the crashdump watchdog timeout
by using
crm sbd configure crashdump-watchdog-timeout=<timeout>,for both disk-based and diskless SBD.