Class: AvstCloud::PostProvisionCleanup

Inherits:
SshCommandTask show all
Defined in:
lib/avst-cloud/task.rb

Instance Method Summary collapse

Methods inherited from SshCommandTask

#ssh_command

Methods included from Logging

included, #logger, #logger=

Methods inherited from SshTask

#execute, #ssh_command

Methods inherited from Task

#execute

Constructor Details

#initialize(os, debug, tmp_folder = "/tmp/avst_cloud_tmp_#{Time.now.to_i}") ⇒ PostProvisionCleanup

Returns a new instance of PostProvisionCleanup.



234
235
236
# File 'lib/avst-cloud/task.rb', line 234

def initialize(os, debug, tmp_folder = "/tmp/avst_cloud_tmp_#{Time.now.to_i}")
    super(make_commands(os, tmp_folder), debug, false)
end

Instance Method Details

#make_commands(os, tmp_folder) ⇒ Object



238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/avst-cloud/task.rb', line 238

def make_commands(os, tmp_folder)
    cmds = []
    case os
        when /ubuntu/, /debian/
            cmds << 'apt-get clean'

        when /centos/, /redhat/
            cmds << 'yum clean all'
    end
    cmds << "rm -rf #{tmp_folder}"
    cmds
end