Skip to content

Commit a6bc73e

Browse files
author
Jordan Caussat
committed
Update project resource: remove shared_with_group debug and tf fmt tests
1 parent 30304ba commit a6bc73e

File tree

2 files changed

+25
-28
lines changed

2 files changed

+25
-28
lines changed

gitlab/resource_gitlab_project.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ func resourceGitlabProjectCreate(d *schema.ResourceData, meta interface{}) error
173173
options := expandSharedWithGroupsOptions(v.([]interface{}))
174174

175175
for _, option := range options {
176-
log.Printf("[DEBUG] project shared with group %v", option)
177176
_, err := client.Projects.ShareProjectWithGroup(project.ID, option)
178177
if err != nil {
179178
return err
@@ -401,7 +400,6 @@ func updateSharedWithGroups(d *schema.ResourceData, meta interface{}) error {
401400

402401
// Unshare groups to delete and update
403402
for _, group := range groupsToUnshare {
404-
log.Printf("[DEBUG] update shared_with_group: unshare %d", *group.GroupID)
405403
_, err := client.Projects.DeleteSharedProjectFromGroup(d.Id(), *group.GroupID)
406404
if err != nil {
407405
return err
@@ -410,7 +408,6 @@ func updateSharedWithGroups(d *schema.ResourceData, meta interface{}) error {
410408

411409
// Share groups to add and update
412410
for _, group := range groupsToShare {
413-
log.Printf("[DEBUG] update shared_with_group: share %d", *group.GroupID)
414411
_, err := client.Projects.ShareProjectWithGroup(d.Id(), group)
415412
if err != nil {
416413
return err

gitlab/resource_gitlab_project_test.go

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -339,23 +339,23 @@ resource "gitlab_project" "foo" {
339339
func testAccGitlabProjectSharedWithGroup(rInt int) string {
340340
return fmt.Sprintf(`
341341
resource "gitlab_project" "foo" {
342-
name = "foo-%d"
343-
path = "foo.%d"
344-
description = "Terraform acceptance tests"
342+
name = "foo-%d"
343+
path = "foo.%d"
344+
description = "Terraform acceptance tests"
345345
visibility_level = "public"
346346
347347
shared_with_groups = [
348348
{
349-
group_id = "${gitlab_group.foo.id}"
350-
group_access_level = "developer"
351-
}
349+
group_id = "${gitlab_group.foo.id}"
350+
group_access_level = "developer"
351+
},
352352
]
353353
}
354354
355355
resource "gitlab_group" "foo" {
356-
name = "foo-name-%d"
357-
path = "foo-path-%d"
358-
description = "Terraform acceptance tests!"
356+
name = "foo-name-%d"
357+
path = "foo-path-%d"
358+
description = "Terraform acceptance tests!"
359359
visibility_level = "public"
360360
}
361361
`, rInt, rInt, rInt, rInt)
@@ -364,34 +364,34 @@ resource "gitlab_group" "foo" {
364364
func testAccGitlabProjectSharedWithGroup2(rInt int) string {
365365
return fmt.Sprintf(`
366366
resource "gitlab_project" "foo" {
367-
name = "foo-%d"
368-
path = "foo.%d"
369-
description = "Terraform acceptance tests"
367+
name = "foo-%d"
368+
path = "foo.%d"
369+
description = "Terraform acceptance tests"
370370
visibility_level = "public"
371371
372372
shared_with_groups = [
373373
{
374-
group_id = "${gitlab_group.foo.id}"
375-
group_access_level = "guest"
376-
},
377-
{
378-
group_id = "${gitlab_group.foo2.id}"
379-
group_access_level = "developer"
380-
}
374+
group_id = "${gitlab_group.foo.id}"
375+
group_access_level = "guest"
376+
},
377+
{
378+
group_id = "${gitlab_group.foo2.id}"
379+
group_access_level = "developer"
380+
},
381381
]
382382
}
383383
384384
resource "gitlab_group" "foo" {
385-
name = "foo-name-%d"
386-
path = "foo-path-%d"
387-
description = "Terraform acceptance tests!"
385+
name = "foo-name-%d"
386+
path = "foo-path-%d"
387+
description = "Terraform acceptance tests!"
388388
visibility_level = "public"
389389
}
390390
391391
resource "gitlab_group" "foo2" {
392-
name = "foo2-name-%d"
393-
path = "foo2-path-%d"
394-
description = "Terraform acceptance tests!"
392+
name = "foo2-name-%d"
393+
path = "foo2-path-%d"
394+
description = "Terraform acceptance tests!"
395395
visibility_level = "public"
396396
}
397397
`, rInt, rInt, rInt, rInt, rInt, rInt)

0 commit comments

Comments
 (0)