Class: HammerCLIForeman::Host::CreateCommand

Inherits:
CreateCommand show all
Includes:
HammerCLIForeman::Hosts::CommonUpdateOptions
Defined in:
lib/hammer_cli_foreman/host.rb

Instance Method Summary collapse

Methods included from HammerCLIForeman::Hosts::CommonUpdateOptions

ask_password, included, #request_params

Methods inherited from CreateCommand

command_name

Methods inherited from Command

alias_name_for_resource, build_options, connection_name, create_option_builder, #customized_options, #dependency_resolver, dependency_resolver, #exception_handler_class, #get_identifier, #get_resource_id, #get_resource_ids, #request_params, resolver, #resolver, resource_alias_name_mapping, resource_config, resource_name_mapping, #searchables, searchables, #send_request, #transform_format

Instance Method Details

#validate_optionsObject



261
262
263
264
265
266
267
268
269
270
271
# File 'lib/hammer_cli_foreman/host.rb', line 261

def validate_options
  super
  unless validator.any(:option_hostgroup_id, :option_hostgroup_name, :option_hostgroup_title).exist?
    if option_managed
      validator.any(:option_architecture_name, :option_architecture_id).required
      validator.any(:option_domain_name, :option_domain_id).required
      validator.any(:option_operatingsystem_title, :option_operatingsystem_id).required
      validator.any(:option_ptable_name, :option_ptable_id).required
    end
  end
end