Skip to content

Commit

Permalink
Merge pull request #135 from linkernetworks/johnlin/bridgename
Browse files Browse the repository at this point in the history
Johnlin/bridgename
  • Loading branch information
Hung-Wei Chiu authored Jul 20, 2018
2 parents 093c94b + a4abd53 commit 6ce5303
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/networkprovider/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ func GetNetworkProvider(network *entity.Network) (NetworkProvider, error) {
func GenerateBridgeName(datapathType, networkName string) string {
tmp := fmt.Sprintf("%s%s", datapathType, networkName)
str := utils.SHA256String(tmp)
return fmt.Sprintf("ovs-%s-%s", datapathType, str[0:6])
return fmt.Sprintf("%s-%s", datapathType, str[0:6])
}
2 changes: 1 addition & 1 deletion src/networkprovider/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ func TestGetNetworkProviderFail(t *testing.T) {

func TestGenerateBridgeName(t *testing.T) {
ans := GenerateBridgeName("netdev", "my network 1")
assert.Equal(t, "ovs-netdev-de0165", ans)
assert.Equal(t, "netdev-de0165", ans)
}

0 comments on commit 6ce5303

Please sign in to comment.