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

Commit

Permalink
Fixes error in json unmarshaling of cpolicy node
Browse files Browse the repository at this point in the history
  • Loading branch information
IRCody authored and pittma committed May 24, 2016
1 parent 8f373ab commit 1251bef
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions control/plugin/cpolicy/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,9 @@ func (c *ConfigPolicyNode) UnmarshalJSON(data []byte) error {
if err := decoder.Decode(&m); err != nil {
return err
}
if n, ok := m["PolicyNode"]; ok {
if pn, ok := n.(map[string]interface{}); ok {
if rs, ok := pn["rules"]; ok {
if rules, ok := rs.(map[string]interface{}); ok {
addRulesToConfigPolicyNode(rules, c)
}
}
if rs, ok := m["rules"]; ok {
if rules, ok := rs.(map[string]interface{}); ok {
addRulesToConfigPolicyNode(rules, c)
}
}
return nil
Expand Down

0 comments on commit 1251bef

Please sign in to comment.