Skip to content

Commit

Permalink
Merge pull request #190 from dirkmueller/master
Browse files Browse the repository at this point in the history
cib: expose crm_config as well
  • Loading branch information
stefanotorresi authored Apr 20, 2021
2 parents 4fceb77 + c3ae9ee commit eb4566a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions collector/pacemaker/cib/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ https://clusterlabs.org/pacemaker/doc/en-US/Pacemaker/2.0/html-single/Pacemaker_

type Root struct {
Configuration struct {
CrmConfig struct {
ClusterProperties []Attribute `xml:"cluster_property_set>nvpair"`
} `xml:"crm_config"`
Nodes []struct {
Id string `xml:"id,attr"`
Uname string `xml:"uname,attr"`
Expand Down
2 changes: 2 additions & 0 deletions collector/pacemaker/cib/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ func TestParse(t *testing.T) {
data, err := p.Parse()
assert.NoError(t, err)
assert.Equal(t, 2, len(data.Configuration.Nodes))
assert.Equal(t, "cib-bootstrap-options-cluster-name", data.Configuration.CrmConfig.ClusterProperties[3].Id)
assert.Equal(t, "hana_cluster", data.Configuration.CrmConfig.ClusterProperties[3].Value)
assert.Equal(t, "node01", data.Configuration.Nodes[0].Uname)
assert.Equal(t, "node02", data.Configuration.Nodes[1].Uname)
assert.Equal(t, 4, len(data.Configuration.Resources.Primitives))
Expand Down

0 comments on commit eb4566a

Please sign in to comment.