Class: HammerCLIForeman::Host::CreateCommand

Inherits:
CreateCommand show all
Includes:
CommonHostUpdateOptions
Defined in:
lib/hammer_cli_foreman/host.rb

Instance Method Summary collapse

Methods included from CommonHostUpdateOptions

ask_password, included, #request_params

Methods inherited from CreateCommand

command_name

Methods inherited from Command

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

Instance Method Details

#validate_optionsObject



371
372
373
374
375
376
377
378
379
380
381
382
383
# File 'lib/hammer_cli_foreman/host.rb', line 371

def validate_options
  super
  unless validator.any(:option_hostgroup_id, :option_hostgroup_name).exist?
    if option_managed
      validator.all(:option_environment_id, :option_architecture_id, :option_domain_id,
                    :option_puppet_proxy_id, :option_operatingsystem_id,
                    :option_ptable_id).required
    else
      # unmanaged host only requires environment
      validator.option(:option_environment_id).required
    end
  end
end