Skip to content

Commit

Permalink
chore: remove unused code and fix ineffectual assignments to err
Browse files Browse the repository at this point in the history
OTT-6230
  • Loading branch information
thatsddr committed Jul 12, 2024
1 parent b18c97a commit 2321e7e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
11 changes: 0 additions & 11 deletions awsmt/helpers_playback_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,3 @@ func readLivePreRollConfiguration(plan playbackConfigurationModel, playbackConfi
}
return plan
}

func readManifestProcessingRules(plan playbackConfigurationModel, playbackConfiguration mediatailor.PutPlaybackConfigurationOutput) playbackConfigurationModel {
if playbackConfiguration.ManifestProcessingRules != nil && *playbackConfiguration.ManifestProcessingRules.AdMarkerPassthrough.Enabled {
plan.ManifestProcessingRules = &manifestProcessingRulesModel{}
if playbackConfiguration.ManifestProcessingRules.AdMarkerPassthrough != nil && playbackConfiguration.ManifestProcessingRules.AdMarkerPassthrough.Enabled != nil {
plan.ManifestProcessingRules.AdMarkerPassthrough = &adMarkerPassthroughModel{}
plan.ManifestProcessingRules.AdMarkerPassthrough.Enabled = playbackConfiguration.ManifestProcessingRules.AdMarkerPassthrough.Enabled
}
}
return plan
}
8 changes: 5 additions & 3 deletions awsmt/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ func (p *awsmtProvider) Configure(ctx context.Context, req provider.ConfigureReq

var region = "eu-central-1"
var profile = ""

var v1err error
var err error
// Old sdk version creation
var sess *session.Session
Expand All @@ -90,7 +92,7 @@ func (p *awsmtProvider) Configure(ctx context.Context, req provider.ConfigureReq

if profile != "" {
// Old sdk
sess, err = session.NewSessionWithOptions(session.Options{
sess, v1err = session.NewSessionWithOptions(session.Options{
SharedConfigState: session.SharedConfigEnable,
Config: aws.Config{
Region: aws.String(region),
Expand All @@ -101,12 +103,12 @@ func (p *awsmtProvider) Configure(ctx context.Context, req provider.ConfigureReq
cfg, err = v2config.LoadDefaultConfig(ctx, v2config.WithSharedConfigProfile(profile), v2config.WithRegion(region))
} else {
// Old sdk
sess, err = session.NewSession(&aws.Config{Region: aws.String(region)})
sess, v1err = session.NewSession(&aws.Config{Region: aws.String(region)})
// New sdk
cfg, err = v2config.LoadDefaultConfig(ctx, v2config.WithRegion(region))
}

if err != nil {
if err != nil || v1err != nil {
resp.Diagnostics.AddError("Failed to Initialize Provider in Region", "unable to initialize provider in the specified region: "+err.Error())
return
}
Expand Down

0 comments on commit 2321e7e

Please sign in to comment.