Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelsz-rb committed Oct 19, 2023
1 parent d6cf3cf commit dcd33e2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion client/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func (c *RollbarAPIClient) UpdateProject(projectID int, name, timezone, timeForm
l.Err(err).Send()
return nil, err
}
l.Debug().Msg("Project successfully created")
l.Debug().Msg("Project successfully updated")
pr := resp.Result().(*projectResponse)
return &pr.Result, nil
}
Expand Down
4 changes: 2 additions & 2 deletions rollbar/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ func setDataSourceHeader(header string, c *client.RollbarAPIClient) {

const (
settingsData = "settings_data"
timeZoneDefault = "US/Pacific"
timeformatDefault = "12h"
timezoneDefault = "US/Pacific"
timeFormatDefault = "12h"
)
12 changes: 6 additions & 6 deletions rollbar/resource_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ func resourceProjectCreate(ctx context.Context, d *schema.ResourceData, m interf
timeFormat := d.Get(projectTimeFormat).(string)

if timezone == "" {
timezone = timeZoneDefault
timezone = timezoneDefault
}
if timeFormat == "" {
timeFormat = timeformatDefault
timeFormat = timeFormatDefault
}

l := log.With().Str(projectName, name).Logger()
Expand Down Expand Up @@ -228,10 +228,10 @@ func resourceProjectRead(ctx context.Context, d *schema.ResourceData, m interfac
}

for k, v := range mProj[settingsData].(map[string]interface{}) {
if k == projectTimezone && v == timeZoneDefault {
if k == projectTimezone && v == timezoneDefault {
continue
}
if k == projectTimeFormat && v == timeformatDefault {
if k == projectTimeFormat && v == timeFormatDefault {
continue
}
mustSet(d, k, v)
Expand Down Expand Up @@ -260,10 +260,10 @@ func resourceProjectUpdate(ctx context.Context, d *schema.ResourceData, m interf
timezone := d.Get(projectTimezone).(string)
timeFormat := d.Get(projectTimeFormat).(string)
if timezone == "" {
timezone = timeZoneDefault
timezone = timezoneDefault
}
if timeFormat == "" {
timeFormat = timeformatDefault
timeFormat = timeFormatDefault
}
l := log.With().
Int("project_id", projectID).
Expand Down
2 changes: 1 addition & 1 deletion rollbar/resource_project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ func (s *AccSuite) configResourceProject() string {
resource "rollbar_project" "foo" {
name = "%s"
timezone = "UTC"
time_format = "24h"
time_format = "24h"
}
`
return fmt.Sprintf(tmpl, s.randName)
Expand Down

0 comments on commit dcd33e2

Please sign in to comment.