Class: Nova::Remote::Fake::OperatingSystem Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/nova/remote/fake/operating_system.rb

Overview

This class is abstract.

Handles operating system tasks like installing packages or creating users.

Instance Method Summary collapse

Instance Method Details

#create_user(name, options = {}) ⇒ Boolean

This method is abstract.
Note:

Does nothing. As such, it always returns false.

Creates a user with the given name and options.

Parameters:

  • name (String, Symbol)

    the name of the user.

  • options (Hash<Symbol, Object>) (defaults to: {})

    the options for the user.

Options Hash (options):

  • :system (Boolean)

    whether or not the user is a system user. Defaults to false.

  • :nologin (Boolean)

    whether or not the user is able to log in. Defaults to false.

  • :password (String)

    the user’s password. Defaults to nil.

Returns:

  • (Boolean)

    whether or not the user creation was successful.



26
27
28
# File 'lib/nova/remote/fake/operating_system.rb', line 26

def create_user(name, options = {})
  false
end

#install_packages(packages) ⇒ Boolean

This method is abstract.
Note:

Does nothing. As such, it always returns false.

Installs packages for the corresponding operating system.

Parameters:

  • packages (Hash<Symbol, Array<String>>)

    the symbol is the name of the OS, the array is the packages to install for that OS.

Options Hash (packages):

  • :ubuntu (Array<String>)

    the packages to install for debian-based OSs (Ubuntu, Debian, Mint).

  • :red_hat (Array<String>)

    the packages to install for red hat-based OSs (REHL, Fedora, CentOS).

  • :arch (Array<String>)

    the packages to install for arch.

Returns:

  • (Boolean)

    whether or not the package installation was successful.



45
46
47
# File 'lib/nova/remote/fake/operating_system.rb', line 45

def install_packages(packages)
  false
end