Bug 1222691
Summary: | "rule date in_range to <date>" should be valid syntax | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | Jan Pokorný [poki] <jpokorny> | ||||
Component: | pcs | Assignee: | Tomas Jelinek <tojeline> | ||||
Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> | ||||
Severity: | low | Docs Contact: | Steven J. Levine <slevine> | ||||
Priority: | low | ||||||
Version: | 8.0 | CC: | cfeist, cluster-maint, idevat, mlisik, mmazoure, mpospisi, nhostako, omular, slevine, tojeline | ||||
Target Milestone: | rc | ||||||
Target Release: | 8.4 | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | pcs-0.10.7-1.el8 | Doc Type: | Enhancement | ||||
Doc Text: |
Feature:
Support 'date in_range [<date>] to <date>' syntax in rules, previously only 'date in_range <date> to <date>' was supported.
Reason:
Pacemaker allows to omit the start date in in_range expressions.
Result:
The start date in in_range expression can be omitted. Note this is not supported in location constraint rules.
|
Story Points: | --- | ||||
Clone Of: | Environment: | ||||||
Last Closed: | 2021-05-18 15:12:05 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Jan Pokorný [poki]
2015-05-18 20:26:58 UTC
Currently, one obtains:
# pcs constraint location RESID rule date in_range to 2016-01-01
> Error: 'date in_range to 2016-01-01' is not a valid rule expression:
> unexpected 'to'
re [comment 0]: Actually, the last line in the excerpt should read: > date in_range [<date>] to <date> Created attachment 1715374 [details]
proposed fix + tests
Syntax before fix:
date in_range <date> to <date>
Syntax after fix:
date in_range [<date>] to <date>
This fix only applies to resource and operation defaults. It doesn't apply to location constraints as those haven't been moved to the new pcs architecture yet and fixing relevant legacy code is not feasible. Once location constraints code is overhauled and moved to the new pcs architecture, it will support the new syntax as well.
Test:
pcs resource defaults set create rule date in_range to 2021-01-01
pcs resource op defaults set create rule date in_range to 2021-01-01
Test: [root@r8-node-01 ~]# rpm -q pcs pcs-0.10.7-1.el8.x86_64 [root@r8-node-01 ~]# pcs resource defaults No defaults set [root@r8-node-01 ~]# pcs resource op defaults No defaults set [root@r8-node-01 ~]# pcs resource defaults set create rule date in_range to 2021-01-01 Warning: Defaults do not apply to resources which override them with their own defined values [root@r8-node-01 ~]# pcs resource op defaults set create rule date in_range to 2021-01-01 Warning: Defaults do not apply to resources which override them with their own defined values [root@r8-node-01 ~]# pcs resource defaults Meta Attrs: rsc_defaults-meta_attributes Rule: boolean-op=and score=INFINITY Expression: date in_range to 2021-01-01 [root@r8-node-01 ~]# pcs resource op defaults Meta Attrs: op_defaults-meta_attributes Rule: boolean-op=and score=INFINITY Expression: date in_range to 2021-01-01 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (pcs bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2021:1737 |