Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
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.
DescriptionJan Pokorný [poki]
2015-05-18 20:26:58 UTC
... as "start" parameter (attribute in pacemaker-1.2.rng) should be
optional.
As for the help screen:
> Usage: pcs constraint [constraints]...
> Manage resource constraints
>
> Commands:
> [...]
> location <resource id> rule [id=<rule id>] [role=master|slave]
> [constraint-id=<id>] [score=<score>|score-attribute=<attribute>]
> <expression>
> Creates a location rule on the specified resource where the expression
> looks like one of the following:
> [...]
> date in_range <date> to <date>
^ last line in this excerpt should read:
> date in_range [<date> to] <date>
Comment 1Jan Pokorný [poki]
2015-05-18 20:41:46 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'
Comment 2Jan Pokorný [poki]
2015-05-18 20:42:49 UTC
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