Skip to content

Commit

Permalink
Fix query (#68)
Browse files Browse the repository at this point in the history
* fix issues #67

* fix query id check

* add changelog fragment

* fix changelog fragment new line

* fix changelog fragment new line2

* Update changelogs/fragments/68-fix-query-id-check.yml

Co-authored-by: Felix Fontein <[email protected]>

Co-authored-by: Felix Fontein <[email protected]>
  • Loading branch information
NikolayDachev and felixfontein authored Feb 10, 2022
1 parent e9fdf19 commit a46c7df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/68-fix-query-id-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "query - fix query function check for ``.id`` vs. ``id`` arguments to not conflict with routeros arguments like ``identity`` (https://github.com/ansible-collections/community.routeros/pull/68, https://github.com/ansible-collections/community.routeros/issues/67)."
4 changes: 2 additions & 2 deletions plugins/modules/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
type: str
query:
description:
- Query given path for selected query attributes from RouterOS aip and return '.id'.
- Query given path for selected query attributes from RouterOS aip.
- WHERE is key word which extend query. WHERE format is key operator value - with spaces.
- WHERE valid operators are C(==), C(!=), C(>), C(<).
- Example path C(ip address) and query C(.id address) will return only C(.id) and C(address) for all items in C(ip address) path.
Expand Down Expand Up @@ -439,7 +439,7 @@ def api_update(self):
def api_query(self):
keys = {}
for k in self.query:
if 'id' in k and k != ".id":
if k == 'id':
self.errors("'%s' must be '.id'" % k)
keys[k] = Key(k)
try:
Expand Down

0 comments on commit a46c7df

Please sign in to comment.