Skip to content

Commit ecb3e5d

Browse files
committed
issue-34: 'comment' functionality as a dependency from 'python3-pscheduler'
1 parent d9d3c22 commit ecb3e5d

File tree

2 files changed

+3
-27
lines changed

2 files changed

+3
-27
lines changed

psconfig/perfsonar-psconfig/psconfig/client/psconfig/base_connect.py

+1-26
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,7 @@
88
import json
99
from urllib.parse import urlparse
1010
import logging
11-
12-
13-
def json_decomment(json_obj, prefix='#', null=False):
14-
"""
15-
Remove any JSON object emember whose name begins with 'prefix'
16-
(default '#') and return the result. If 'null' is True, replace
17-
the prefixed items with a null value instead of deleting them.
18-
"""
19-
if type(json_obj) is dict:
20-
result = {}
21-
for item in json_obj.keys():
22-
if item.startswith(prefix):
23-
if null:
24-
result[item] = None
25-
else:
26-
next
27-
else:
28-
result[item] = json_decomment(json_obj[item], prefix=prefix, null=null)
29-
return result
30-
elif type(json_obj) is list:
31-
result = []
32-
for item in json_obj:
33-
result.append(json_decomment(item, prefix=prefix, null=null))
34-
return result
35-
else:
36-
return json_obj
11+
from pscheduler.psjson import json_decomment
3712

3813

3914
class BaseConnect(object):

psconfig/perfsonar-psconfig/unibuild-packaging/deb/control

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Architecture: all
1515
Depends: python3, ${misc:Depends},
1616
python3-requests, python3-jsonschema (>= 3.0.1~0), python3-tqdm,
1717
python3-isodate (>= 0.5.0), python3-dnspython, python3-pyjq,
18-
python3-netifaces, python3-dateutil, python3-file-read-backwards
18+
python3-netifaces, python3-dateutil, python3-file-read-backwards,
19+
python3-pscheduler
1920
Description: pSConfig library
2021
Utility functions for pSConfig
2122

0 commit comments

Comments
 (0)