Skip to content

Parse fixes#26

Merged
akofink merged 3 commits intoOpenSCAP:masterfrom
xprazak2:parse-fixes
Dec 11, 2019
Merged

Parse fixes#26
akofink merged 3 commits intoOpenSCAP:masterfrom
xprazak2:parse-fixes

Conversation

@xprazak2
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Collaborator

@akofink akofink left a comment

Choose a reason for hiding this comment

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

Looks good - a couple minor comments.


def text
@parsed_xml.text unless sub
end
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's put this on the XmlNode as it applies to any xml node.

Sub.new(parsed_xml: sub_node)
end

def sub_node
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There can be 0 to n sub nodes according to the spec. IMO this should be pluralized

@xprazak2
Copy link
Copy Markdown
Collaborator Author

xprazak2 commented Dec 6, 2019

Multiple subs for one fixed are now parsed correctly.

Copy link
Copy Markdown
Collaborator

@akofink akofink left a comment

Choose a reason for hiding this comment

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

Works great. Optionally add the missing attributes - but we can also add them later.

def complexity
@complexity ||= @parsed_xml['complexity']
end

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we include disruption and strategy?

def id
@id ||= @parsed_xml['idref']
end

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we add use here?

the xccdf:sub element MAY have a use attribute that indicates whether the xccdf:Value element's title or value should replace the xccdf:sub element.

@xprazak2
Copy link
Copy Markdown
Collaborator Author

I rebased and added parsing for disruption, strategy and use.

Copy link
Copy Markdown
Collaborator

@akofink akofink left a comment

Choose a reason for hiding this comment

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

Thanks @xprazak2!

@akofink akofink merged commit 4561090 into OpenSCAP:master Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants