Skip to content

Commit

Permalink
a couple of corrections and comment updates
Browse files Browse the repository at this point in the history
  • Loading branch information
consolethinks committed Aug 12, 2024
1 parent 9bfcb6e commit de871c6
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions cmd/commands/datasetIngestor.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ For Windows you need instead to specify -user username:password on the command l
return
}

// check for program version
// === check for program version ===
datasetUtils.CheckForNewVersion(client, CMD, VERSION)
datasetUtils.CheckForServiceAvailability(client, testenvFlag, autoarchiveFlag)

Expand Down Expand Up @@ -214,7 +214,7 @@ For Windows you need instead to specify -user username:password on the command l
}
color.Set(color.FgYellow)
if len(foundList) > 0 {
fmt.Println("Warning! The following datasets have been found with the same sourceFolder: ")
fmt.Println("Warning! The following datasets have been found with the same sourceFolders: ")
} else {
log.Println("Finished testing for existing source folders.")
}
Expand All @@ -239,7 +239,7 @@ For Windows you need instead to specify -user username:password on the command l
// a destination location is defined by the archive system
// for now let the user decide if he needs a copy

if nocopyFlag {
if nocopyFlag || beamlineAccount {
copyFlag = false
}
checkCentralAvailability := !(cmd.Flags().Changed("copy") || cmd.Flags().Changed("nocopy") || beamlineAccount || copyFlag)
Expand Down Expand Up @@ -279,7 +279,7 @@ For Windows you need instead to specify -user username:password on the command l
skipSymlinks = ""
}

// get filelist of dataset
// === get filelist of dataset ===
log.Printf("Getting filelist for \"%s\"...\n", datasetSourceFolder)
fullFileArray, startTime, endTime, owner, numFiles, totalSize, err :=
datasetIngestor.GetLocalFileList(datasetSourceFolder, datasetFileListTxt, localSymlinkCallback, localFilepathFilterCallback)
Expand Down Expand Up @@ -312,11 +312,13 @@ For Windows you need instead to specify -user username:password on the command l
log.Printf("Note: this dataset, if archived, will be copied to two tape copies")
color.Unset()
}
// === update metadata ===
datasetIngestor.UpdateMetaData(client, APIServer, user, originalMap, metaDataMap, startTime, endTime, owner, tapecopies)
pretty, _ := json.MarshalIndent(metaDataMap, "", " ")

log.Printf("Updated metadata object:\n%s\n", pretty)

// === check central availability of data ===
// check if data is accesible at archive server, unless beamline account (assumed to be centrally available always)
// and unless (no)copy flag defined via command line
if checkCentralAvailability {
Expand Down Expand Up @@ -351,6 +353,7 @@ For Windows you need instead to specify -user username:password on the command l
}
}

// === ingest dataset ===
if ingestFlag {
// create ingest . For decentral case delay setting status to archivable until data is copied
archivable := false
Expand Down Expand Up @@ -383,6 +386,7 @@ For Windows you need instead to specify -user username:password on the command l
}
log.Printf("Attachment file %v added to dataset %v\n", addAttachment, datasetId)
}
// === copying files ===
if copyFlag {
// TODO rewrite SyncDataToFileserver
log.Println("Syncing files to cache server...")
Expand Down Expand Up @@ -443,7 +447,8 @@ For Windows you need instead to specify -user username:password on the command l
if emptyDatasets > 0 || tooLargeDatasets > 0 {
os.Exit(1)
}
// start archive job

// === create archive job ===
if autoarchiveFlag && ingestFlag {
log.Printf("Submitting Archive Job for the ingested datasets.\n")
// TODO: change param type from pointer to regular as it is unnecessary
Expand Down

0 comments on commit de871c6

Please sign in to comment.