Skip to content

Commit

Permalink
hot fixes from live environment
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrosx committed Jan 11, 2024
1 parent c3d9fa9 commit f21fb8f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions ingestor_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ def ingest_message(
logger.info('Instantiating dataset model')
dataset = create_dataset(
logger,
config,
metadata,
proposal,
instrument,
Expand All @@ -455,9 +456,6 @@ def ingest_message(
proposal_id,
dataset_source_folder,
dataset_title,
config['run_options']['dataset_pid_prefix'],
config['run_options']['force_dataset_pid'],
config['run_options']['use_job_id_as_dataset'],
job_id
)
#logger.info('Dataset : {}'.format(dataset))
Expand Down Expand Up @@ -533,6 +531,7 @@ def get_prop(

def create_dataset(
logger,
config,
metadata: dict,
proposal: dict,
instrument: dict,
Expand All @@ -541,11 +540,12 @@ def create_dataset(
proposal_id: str = None,
source_folder: str = "",
dataset_name: str = None,
dataset_pid_prefix: str = None,
force_dataset_pid: bool = False,
use_job_id_as_dataset: bool = False,
job_id: str = "unknown"
) -> dict:
# extract settings from configuration
dataset_pid_prefix = config['run_options']['dataset_pid_prefix']
force_dataset_pid = config['run_options']['force_dataset_pid']
use_job_id_as_dataset = config['run_options']['use_job_id_as_dataset']
# prepare info for datasets
dataset_pid = job_id if use_job_id_as_dataset else str(uuid.uuid4())
if dataset_pid_prefix:
Expand Down Expand Up @@ -578,7 +578,7 @@ def create_dataset(
"description": dataset_description,
"principalInvestigator": principal_investigator,
"creationLocation": get_prop(instrument,"name",""),
"scientificMetadata": prepare_flatten_metadata(metadata),
"scientificMetadata": prepare_flatten_metadata(config,metadata),
"owner": principal_investigator,
"ownerEmail": email,
"contactEmail": email,
Expand Down

0 comments on commit f21fb8f

Please sign in to comment.