Skip to content

Commit

Permalink
Merge pull request #1268 from dradis/nodes/add-service-properties-con…
Browse files Browse the repository at this point in the history
…stant

Add service_properties constant to node properties
  • Loading branch information
caitmich committed Jun 25, 2024
2 parents 5842f50 + 385e1a3 commit 6093383
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/concerns/node_properties.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ def self.included(base)
end

SERVICE_KEYS = %i[protocol port state product reason name version]
SERVICE_PROPERTIES = %w[services services_extras]

# -------------------------------------------- Individual property management
# Sets a property, storing value as Array when needed
# and taking care of duplications
def set_property(key, value)
if [:services, :services_extras].include?(key.to_sym) # let's get defensive
if SERVICE_PROPERTIES.include?(key.to_s) # let's get defensive
raise ArgumentError, 'don\'t use set_property for :services or '\
':services_extras, use set_service instead'
end
Expand Down Expand Up @@ -101,7 +102,6 @@ def set_service(data)
end
end


# -------------------------------------- :raw_properties accessors for the UI
def raw_properties
if self.has_any_property?
Expand Down

0 comments on commit 6093383

Please sign in to comment.