Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions psconfig/perfsonar-psconfig/psconfig/utilities/jq.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
Utilities for running JQ.
'''

import pyjq
# This dodges a name collision
import jq as _jq

def jq(jq, json_obj, formatting_params=None, timeout=None):
def jq(script, input_data):
'''
Run a jq script with input and return the first result
'''

#initialize formatting params
try:
value = pyjq.one(jq, json_obj)
return value
except Exception as e:
raise Exception('jq error: {}'.format(e))
# On failure, this raises ValueError('jq: ...')
return _jq.compile(script).input_value(input_data).first()
2 changes: 1 addition & 1 deletion psconfig/perfsonar-psconfig/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
],
install_requires=['requests',
'jsonschema',
'pyjq',
'jq',
'isodate'
'python-dateutil==2.8.2',
'pyinotify',
Expand Down
2 changes: 1 addition & 1 deletion psconfig/perfsonar-psconfig/unibuild-packaging/deb/control
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Package: python3-perfsonar-psconfig
Architecture: all
Depends: python3, ${misc:Depends},
python3-requests, python3-jsonschema (>= 3.0.1~0), python3-tqdm,
python3-isodate (>= 0.5.0), python3-dnspython, python3-pyjq,
python3-isodate (>= 0.5.0), python3-dnspython, python3-jq,
python3-netifaces, python3-dateutil, python3-file-read-backwards,
python3-pscheduler
Description: pSConfig library
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Summary: perfSONAR pSConfig Python Libraries
Requires: %{_python}
Requires: %{_python}-requests
Requires: %{_python}-jsonschema >= 3.0
Requires: %{_python}-pyjq >= 2.2.0
Requires: %{_python}-jq
Requires: %{_python}-netifaces
Requires: %{_python}-isodate
Requires: %{_python}-dns
Expand Down
Loading