[ARVADOS] updated: ea10340803abade2d35212866fcbc1beb1acd533

Git user git at public.curoverse.com
Wed Oct 18 18:39:53 EDT 2017


Summary of changes:
 tools/arv-sync-groups/arv-sync-groups.go | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

       via  ea10340803abade2d35212866fcbc1beb1acd533 (commit)
       via  d6866ae54d8fe7eb0fb6c9df8a80d9b6a90e8759 (commit)
      from  00a299d80ee03e3ae227eb8e237a43f29a6cc667 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit ea10340803abade2d35212866fcbc1beb1acd533
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Wed Oct 18 19:39:14 2017 -0300

    12018: Skip CSV register if one of its fields is empty
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/tools/arv-sync-groups/arv-sync-groups.go b/tools/arv-sync-groups/arv-sync-groups.go
index c63ae9e..58fa775 100644
--- a/tools/arv-sync-groups/arv-sync-groups.go
+++ b/tools/arv-sync-groups/arv-sync-groups.go
@@ -357,6 +357,7 @@ func doMain() error {
 	groupsCreated := 0
 	membersAdded := 0
 	membersRemoved := 0
+	membersSkipped := 0
 
 	csvReader := csv.NewReader(f)
 	for {
@@ -369,9 +370,15 @@ func doMain() error {
 		}
 		groupName := record[0]
 		groupMember := record[1] // User ID (username or email)
+		if groupName == "" || groupMember == "" {
+			log.Printf("Warning: CSV record has at least one field empty (%s, %s). Skipping", groupName, groupMember)
+			membersSkipped++
+			continue
+		}
 		if _, found := userIDToUUID[groupMember]; !found {
 			// User not present on the system, skip.
 			log.Printf("Warning: there's no user with %s %q on the system, skipping.", *userID, groupMember)
+			membersSkipped++
 			continue
 		}
 		if _, found := groupNameToUUID[groupName]; !found {
@@ -471,7 +478,7 @@ func doMain() error {
 			membersRemoved++
 		}
 	}
-	log.Printf("Groups created: %d, members added: %d, members removed: %d", groupsCreated, membersAdded, membersRemoved)
+	log.Printf("Groups created: %d, members added: %d, members removed: %d, members skipped: %d", groupsCreated, membersAdded, membersRemoved, membersSkipped)
 
 	return nil
 }

commit d6866ae54d8fe7eb0fb6c9df8a80d9b6a90e8759
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Wed Oct 18 18:36:22 2017 -0300

    12018: Removed superfluous check
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/tools/arv-sync-groups/arv-sync-groups.go b/tools/arv-sync-groups/arv-sync-groups.go
index b8c94ed..c63ae9e 100644
--- a/tools/arv-sync-groups/arv-sync-groups.go
+++ b/tools/arv-sync-groups/arv-sync-groups.go
@@ -262,9 +262,6 @@ func doMain() error {
 		if err != nil {
 			return fmt.Errorf("error searching for parent group with UUID %q: %s", *parentGroupUUID, err)
 		}
-		if parentGroup.UUID == "" {
-			return fmt.Errorf("parent group with UUID %q not found", *parentGroupUUID)
-		}
 		if parentGroup.OwnerUUID != sysUserUUID {
 			return fmt.Errorf("parent group %q (%s) must be owned by system user", parentGroup.Name, *parentGroupUUID)
 		}

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list