Module: OsCtld::ContainerControl::Utils::Wall::Frontend

Included in:
Commands::Stop::Frontend, Commands::StopByHalt::Frontend, Commands::StopRunit::Frontend, Commands::Wall::Frontend
Defined in:
lib/osctld/container_control/utils/wall.rb

Instance Method Summary collapse

Instance Method Details

#make_message(message, banner: true) ⇒ String

Parameters:

  • message (String)
  • banner (Boolean) (defaults to: true)

Returns:

  • (String)


7
8
9
10
11
12
13
14
15
16
# File 'lib/osctld/container_control/utils/wall.rb', line 7

def make_message(message, banner: true)
  ret =
    if banner
      "Message from host machine #{Socket.gethostname} (#{Time.now}):\n\n#{message}"
    else
      message
    end

  "\n\n#{ret}\n\n"
end