Skip to content

Commit fb8ff95

Browse files
committed
Replaced jsonpath_rw in favor of jsonpath_ng
Signed-off-by: Mike Raineri <michael.raineri@dell.com>
1 parent 2ad192e commit fb8ff95

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Required external packages:
4646
4747
jsonpatch<=1.24 ; python_version == '3.4'
4848
jsonpatch ; python_version >= '3.5'
49-
jsonpath_rw
49+
jsonpath_ng
5050
jsonpointer
5151
requests
5252
requests-toolbelt

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
jsonpatch<=1.24 ; python_version == '3.4'
22
jsonpatch ; python_version >= '3.5'
3-
jsonpath_rw
3+
jsonpath_ng
44
jsonpointer
55
requests
66
requests-toolbelt

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
packages=find_packages('src'),
3030
package_dir={'': 'src'},
3131
install_requires=[
32-
'jsonpath_rw',
32+
'jsonpath_ng',
3333
'jsonpointer',
3434
"requests",
3535
'requests_toolbelt',

src/redfish/ris/ris.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from queue import Queue
1616
from collections import OrderedDict
1717

18-
import jsonpath_rw
18+
import jsonpath_ng
1919

2020
import redfish.rest.v1
2121
from redfish.ris.sharedtypes import Dictable
@@ -406,7 +406,7 @@ def _load(
406406

407407
if loadtype == "href":
408408
# follow all the href attributes
409-
jsonpath_expr = jsonpath_rw.parse("$..'@odata.id'")
409+
jsonpath_expr = jsonpath_ng.parse("$..'@odata.id'")
410410
matches = jsonpath_expr.find(resp.dict)
411411

412412
if "links" in resp.dict and "NextPage" in resp.dict["links"]:

src/redfish/ris/rmc.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from collections.abc import Mapping
2020

2121
import jsonpatch
22-
import jsonpath_rw
22+
import jsonpath_ng
2323
import jsonpointer
2424

2525
from redfish.ris.rmc_helper import (UndefinedClientError, \
@@ -384,7 +384,7 @@ def get(self, selector=None):
384384
currdict = jsonpatch.apply_patch(currdict, patch)
385385

386386
if selector:
387-
jsonpath_expr = jsonpath_rw.parse('%s' % selector)
387+
jsonpath_expr = jsonpath_ng.parse('%s' % selector)
388388
matches = jsonpath_expr.find(currdict)
389389
temp_dict = OrderedDict()
390390

@@ -440,7 +440,7 @@ def get_save(self, selector=None, currentoverride=False, pluspath=False,
440440
break
441441

442442
try:
443-
jsonpath_expr = jsonpath_rw.parse('"%s"' % selector)
443+
jsonpath_expr = jsonpath_ng.parse('"%s"' % selector)
444444
except Exception as excp:
445445
raise InvalidCommandLineError(excp)
446446

@@ -516,7 +516,7 @@ def set(self, selector=None, val=None):
516516
break
517517

518518
newdict = currdict.copy()
519-
jsonpath_expr = jsonpath_rw.parse(u'%s' % selector)
519+
jsonpath_expr = jsonpath_ng.parse(u'%s' % selector)
520520
matches = jsonpath_expr.find(currdict)
521521

522522
if not matches:
@@ -730,7 +730,7 @@ def loadset(self, dicttolist=None, selector=None, val=None, newargs=None):
730730
dicttolist = []
731731

732732
for (itersel, iterval) in dicttolist:
733-
jsonpath_expr = jsonpath_rw.parse('%s' % itersel)
733+
jsonpath_expr = jsonpath_ng.parse('%s' % itersel)
734734
matches = jsonpath_expr.find(currdict)
735735

736736
if not matches:

0 commit comments

Comments
 (0)