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.
Bug 1222691 - "rule date in_range to <date>" should be valid syntax
Summary: "rule date in_range to <date>" should be valid syntax
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pcs
Version: 8.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: 8.4
Assignee: Tomas Jelinek
QA Contact: cluster-qe@redhat.com
Steven J. Levine
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-18 20:26 UTC by Jan Pokorný [poki]
Modified: 2021-05-18 15:12 UTC (History)
10 users (show)

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.
Clone Of:
Environment:
Last Closed: 2021-05-18 15:12:05 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed fix + tests (23.14 KB, patch)
2020-09-18 13:53 UTC, Tomas Jelinek
no flags Details | Diff

Description Jan 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 1 Jan 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 2 Jan 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>

Comment 5 Tomas Jelinek 2020-09-18 13:53:35 UTC
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

Comment 13 Miroslav Lisik 2020-10-14 13:48:43 UTC
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

Comment 18 errata-xmlrpc 2021-05-18 15:12:05 UTC
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


Note You need to log in before you can comment on or make changes to this bug.