Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for new Description tag in site and group configs #70

Merged
merged 6 commits into from
Jul 17, 2014
Next Next commit
add support for new <Description> tag in AssetGroupConfig
  • Loading branch information
gschneider-r7 committed Jul 7, 2014
commit c9e8997976b0ade629a35f1435030371d6905b00
6 changes: 6 additions & 0 deletions lib/nexpose/group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def to_xml
xml = %(<AssetGroup id="#{@id}" name="#{replace_entities(@name)}")
xml << %( description="#{replace_entities(@description)}") if @description
xml << '>'
xml << "<Description>#{replace_entities(@description)}</Description>"
xml << '<Devices>'
@assets.each do |asset|
xml << %(<device id="#{asset.id}"/>)
Expand Down Expand Up @@ -149,6 +150,11 @@ def self.parse(xml)
group.attributes['description'],
group.attributes['id'].to_i,
group.attributes['riskscore'].to_f)

group.elements.each('Description') do |desc|
asset_group.description = desc
end

group.elements.each('Devices/device') do |dev|
asset_group.assets << Device.new(dev.attributes['id'].to_i,
dev.attributes['address'],
Expand Down