Class: NXOS

Inherits:
Operatingsystem show all
Defined in:
app/models/operatingsystems/nxos.rb

Constant Summary collapse

PXEFILES =

We don't fetch any files here.

{}

Constants inherited from Operatingsystem

Operatingsystem::FAMILIES

Constants included from PxeLoaderSupport

PxeLoaderSupport::PREFERRED_KINDS, PxeLoaderSupport::PXE_KINDS

Instance Method Summary collapse

Methods inherited from Operatingsystem

#additional_media, #boot_file_sources, #boot_files_uri, #bootfile, #deduce_family, deduce_family, #dhcp_record_type, families, families_as_collection, #family, #family=, find_by_to_label, #fullname, #image_extension, inherited, #mediumpath, #pxe_files, #pxe_kernel_options, #pxe_prefix, require_nfs_access_to_medium, #shorten_description, #supports_image, #template_kinds_for_tftp, title_name, #to_label, #to_label=, #to_param, #to_s

Methods included from ParameterValidators

#parameters_symbol, #validate_parameters_names

Methods included from PxeLoaderSupport

#default_boot_filename, #preferred_loader, #pxe_loader_kind

Methods included from Authorizable

#authorized?, #check_permissions_after_save

Methods included from PermissionName

#permission_name

Methods inherited from ApplicationRecord

graphql_type, #logger, logger

Methods included from AuditAssociations::AssociationsDefinitions

#audit_associations, #audited, #configure_dirty_associations, #normalize_associations

Instance Method Details

#available_loadersObject


9
10
11
# File 'app/models/operatingsystems/nxos.rb', line 9

def available_loaders
  ["None"]
end

#boot_filename(host = nil) ⇒ Object


21
22
23
# File 'app/models/operatingsystems/nxos.rb', line 21

def boot_filename(host = nil)
  "poap.cfg/" + host.mac.delete(':').upcase
end

#display_familyObject


48
49
50
# File 'app/models/operatingsystems/nxos.rb', line 48

def display_family
  "NX-OS"
end

#downcase_release_nameObject

release_name can have upper case letters and we want to keep it that way


39
40
41
# File 'app/models/operatingsystems/nxos.rb', line 39

def downcase_release_name
  release_name
end

#initrd(_medium_provider) ⇒ Object


29
30
31
# File 'app/models/operatingsystems/nxos.rb', line 29

def initrd(_medium_provider)
  "none"
end

#kernel(_medium_provider) ⇒ Object


25
26
27
# File 'app/models/operatingsystems/nxos.rb', line 25

def kernel(_medium_provider)
  "none"
end

#pxedir(medium_provider = nil) ⇒ Object


13
14
15
# File 'app/models/operatingsystems/nxos.rb', line 13

def pxedir(medium_provider = nil)
  "boot/$arch/images"
end

#releaseObject

generate a Cisco release number using release_name as an auxiliary field


44
45
46
# File 'app/models/operatingsystems/nxos.rb', line 44

def release
  "#{major}#{('.' + minor.to_s) if minor.present?}#{('.' + release_name) if release_name.present?}"
end

#template_kindsObject


5
6
7
# File 'app/models/operatingsystems/nxos.rb', line 5

def template_kinds
  ["POAP"]
end

#url_for_boot(medium_provider, file) ⇒ Object


17
18
19
# File 'app/models/operatingsystems/nxos.rb', line 17

def url_for_boot(medium_provider, file)
  raise ::Foreman::Exception.new(N_("Function not available for %s"), display_family)
end

#use_release_name?Boolean

release_name can be used to complete Cisco release numbers.

Returns:

  • (Boolean)

34
35
36
# File 'app/models/operatingsystems/nxos.rb', line 34

def use_release_name?
  true
end