Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.

Commit 8057586

Browse files
committed
Added organization and contact email handling to config file logic
1 parent 570fb47 commit 8057586

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

Diff for: llnl_config.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"agency": "DOE",
33
"organization": "Lawrence Livermore National Laboratory",
4+
"contact_email": "[email protected]",
45
"github_orgs": [
56
"chaos",
67
"esgf",

Diff for: scraper/gen_code_gov_json.py

+14-6
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@ def main():
137137
method = args.method or method
138138
logger.debug('Inventory Method: %s', method)
139139

140+
organization = config_json.get('organization', '')
141+
organization = args.organization or organization
142+
logger.debug('Organization: %s', organization)
143+
144+
contact_email = config_json.get('contact_email', '')
145+
contact_email = args.contact_email or contact_email
146+
logger.debug('Contact Email: %s', contact_email)
147+
140148
github_orgs = config_json.get('github_orgs', [])
141149
github_orgs.extend(args.github_orgs)
142150
logger.debug('GitHub.com Organizations: %s', github_orgs)
@@ -169,15 +177,15 @@ def main():
169177
logger.warning('Unbale to find DOECode json file: %s', doecode_json)
170178

171179
# Force certain fields
172-
if args.organization:
173-
logger.debug('Forcing Organiation to: %s', args.organzation)
180+
if organization:
181+
logger.debug('Forcing Organiation to: %s', organization)
174182
for release in code_json['releases']:
175-
release['organization'] = args.organization
183+
release['organization'] = organization
176184

177-
if args.contact_email:
178-
logger.debug('Forcing Contact Email to: %s', args.contact_email)
185+
if contact_email:
186+
logger.debug('Forcing Contact Email to: %s', contact_email)
179187
for release in code_json['releases']:
180-
release['contact']['email'] = args.contact_email
188+
release['contact']['email'] = contact_email
181189

182190
str_org_projects = code_json.to_json()
183191

0 commit comments

Comments
 (0)