diff --git a/app/controllers/api/v2/hosts_controller.rb b/app/controllers/api/v2/hosts_controller.rb index 41cef4da9a45..5cf6ddbea5fb 100644 --- a/app/controllers/api/v2/hosts_controller.rb +++ b/app/controllers/api/v2/hosts_controller.rb @@ -64,6 +64,7 @@ def index param :show_hidden_parameters, :bool, :desc => N_("Display hidden parameter values") def show + @host.name = @host.name.split(".")[0] @parameters = true @all_parameters = true end diff --git a/app/models/host/base.rb b/app/models/host/base.rb index 2398ef8d42f4..3fcf933c4913 100644 --- a/app/models/host/base.rb +++ b/app/models/host/base.rb @@ -115,6 +115,7 @@ def dup :domain=, :domain_id=, :domain_name=, :to => :primary_interface attr_writer :updated_virtuals + def updated_virtuals @updated_virtuals ||= [] end @@ -351,6 +352,10 @@ def render_template(template:, **params) template.render(host: self, **params) end + def to_s + name.to_s.split('.')[0] + end + private def parse_ip_address(address, ignore_link_local: true)