Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Fixes #525 swap plugins of diff types #623

Merged
merged 1 commit into from
Dec 10, 2015

Conversation

tiffanyfay
Copy link
Contributor

#525

Based on feedback from @danielscottt, mock 1 and mock 2 plugin names should just be mock since they're different versions of mock plugins. Made this change.

Also swap now verifies that the plugins are the same type and name.

@@ -395,16 +395,41 @@ func (p *pluginControl) SwapPlugins(in *core.RequestedPlugin, out core.Cataloged
return err
}

// Make sure plugin types and names are the same
if lp.TypeName() != out.TypeName() || lp.Name() != out.Name() {
fmt.Println(lp.TypeName())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Want to pull out these Printlns?

serr := serror.New(errors.New("Plugin types and names must match."))
serr.SetFields(map[string]interface{}{
"in Type": lp.TypeName(),
"out Type": out.TypeName(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think by convention these keys shouldn't contain spaces.

Technically it's valid, but I'd prefer something like in_type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did in-type to match the format of the ones already there.

@pittma
Copy link
Contributor

pittma commented Dec 10, 2015

🚢 it.

Nicely done.

@tiffanyfay
Copy link
Contributor Author

Thanks.

tiffanyfay added a commit that referenced this pull request Dec 10, 2015
Fixes #525 swap plugins of diff types
@tiffanyfay tiffanyfay merged commit 1f73420 into intelsdi-x:master Dec 10, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants