Skip to content

Commit 6b84919

Browse files
fix count on cedar backup
1 parent c84e333 commit 6b84919

File tree

4 files changed

+474
-11
lines changed

4 files changed

+474
-11
lines changed

pcor_tools/cedar_backup_tool.spec

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,26 @@ pyz = PYZ(a.pure)
1919
exe = EXE(
2020
pyz,
2121
a.scripts,
22-
a.binaries,
23-
a.datas,
2422
[],
23+
exclude_binaries=True,
2524
name='cedar_backup_tool',
2625
debug=False,
2726
bootloader_ignore_signals=False,
2827
strip=False,
2928
upx=True,
30-
upx_exclude=[],
31-
runtime_tmpdir=None,
3229
console=True,
3330
disable_windowed_traceback=False,
3431
argv_emulation=False,
3532
target_arch=None,
3633
codesign_identity=None,
3734
entitlements_file=None,
3835
)
36+
coll = COLLECT(
37+
exe,
38+
a.binaries,
39+
a.datas,
40+
strip=False,
41+
upx=True,
42+
upx_exclude=[],
43+
name='cedar_backup_tool',
44+
)

pcor_tools/pcor_cedar/cedar_access.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def retrieve_folder_contents(self, folder_id):
4040
4141
"""
4242

43-
api_url = self.cedar_config.cedar_properties["cedar_endpoint"] + "/folders/https%3A%2F%2Frepo.metadatacenter.org%2Ffolders%2F" + folder_id +"/contents"
43+
api_url = self.cedar_config.cedar_properties["cedar_endpoint"] + "/folders/https%3A%2F%2Frepo.metadatacenter.org%2Ffolders%2F" + folder_id +"/contents?limit=500"
4444
headers = {"Content-Type": "application/json", "Accept": "application/json",
4545
"Authorization": self.cedar_config.build_request_headers_json()}
4646
r = requests.get(api_url, headers=headers)

pcor_tools/pcor_cedar/cedar_config.py

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,32 @@ class CedarConfig(object):
3434

3535
""" init will load the cedar properties from the provided config file,
3636
which can be overwritten by a CEDAR_PROPERTIES env variable"""
37-
def __init__(self, config_file=None):
37+
def __init__(self, config_file=None, config_param=None):
38+
"""
39+
Config for CEDAR access. This starts with CEDAR_PROPERTIES env variable, then config_file, then config_parm
40+
:param config_file: optional file path to a config file
41+
:param config_param: optional dictionary with cedar properties
42+
43+
props:
44+
45+
api_key=xxxxxxx
46+
cedar_endpoint=https://resource.metadatacenter.org
47+
48+
"""
3849

3950
env_config_file = os.getenv('CEDAR_PROPERTIES')
4051
if env_config_file:
4152
self.config_file = env_config_file
4253
else:
4354
self.config_file = config_file
4455

45-
if env_config_file is None:
46-
raise Exception("no CEDAR_PROPERTIES or config_file found")
47-
48-
logger.info("loading config file from %s", self.config_file)
49-
self.cedar_properties = dict_from_props(self.config_file)
56+
if self.config_file:
57+
logger.info("loading config file from %s", self.config_file)
58+
self.cedar_properties = dict_from_props(self.config_file)
59+
elif config_param:
60+
self.cedar_properties = config_param
61+
else:
62+
raise Exception("No source of parameters provided")
5063

5164
def build_request_headers_json(self):
5265
auth_fmt = "apiKey {key}"

0 commit comments

Comments
 (0)