Skip to content

Commit

Permalink
Fix bugs that prevent tests from passing
Browse files Browse the repository at this point in the history
  • Loading branch information
kavir1698 authored and minottic committed Mar 6, 2024
1 parent d3f68b9 commit 07620b9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
build
build
*.un~
*~
2 changes: 1 addition & 1 deletion cmd/datasetIngestor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ func main() {
} else if numFiles > TOTAL_MAXFILES {
tooLargeDatasets++
color.Set(color.FgRed)
log.Println("This dataset exceeds the current filecount limit of the archive system of %v files and will therefore NOT be stored.\n", TOTAL_MAXFILES)
log.Printf("This dataset exceeds the current filecount limit of the archive system of %v files and will therefore NOT be stored.\n", TOTAL_MAXFILES)
color.Unset()
} else {
datasetIngestor.UpdateMetaData(client, APIServer, user, originalMap, metaDataMap, startTime, endTime, owner, tapecopies)
Expand Down
4 changes: 2 additions & 2 deletions cmd/datasetRetriever/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func main() {
log.Printf("You are about to retrieve dataset(s) from the === %s === retrieve server...", env)
color.Unset()

if *retrieveFlag == false {
if !*retrieveFlag {
color.Set(color.FgRed)
log.Printf("Note: you run in 'dry' mode to simply check which data would be fetched.\n")
log.Printf("Use the -retrieve flag to actually transfer the datasets to your chosen destination path.\n")
Expand Down Expand Up @@ -126,7 +126,7 @@ func main() {

if len(datasetList) == 0 {
fmt.Printf("\n\nNo datasets found on intermediate cache server.\n")
fmt.Println("Did you submit a retrieve job from the data catalog first ?\n")
fmt.Println("Did you submit a retrieve job from the data catalog first ?")
} else {
// get sourceFolder and other dataset related info for all Datasets
datasetDetails := datasetUtils.GetDatasetDetails(client, APIServer, user["accessToken"], datasetList, *ownerGroup)
Expand Down
2 changes: 1 addition & 1 deletion datasetIngestor/assembleFilelisting.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func AssembleFilelisting(sourceFolder string, filelistingPath string, skip *stri
// spin.Start() // Start the spinner
e := filepath.Walk(line, func(path string, f os.FileInfo, err error) error {
// ignore ./ (but keep other dot files)
if f == nil || f.IsDir == nil || f.Name == nil {
if f == nil || !f.IsDir() || f.Name() == "" {
log.Printf("Missing file info for line %s and path %s", line, path)
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion datasetUtils/getUserInfoFromToken.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func GetUserInfoFromToken(client *http.Client, APIServer string, token string) (
accessGroups = respObj.CurrentGroups
log.Printf("User is member in following groups: %v\n", accessGroups)
} else {
log.Fatalln("Could not map a user to the token %v", token)
log.Fatalf("Could not map a user to the token %v", token)
}
return u, accessGroups

Expand Down

0 comments on commit 07620b9

Please sign in to comment.