Class: AvstCloud::PostProvisionCleanup
- Inherits:
-
SshCommandTask
- Object
- Task
- SshTask
- SshCommandTask
- AvstCloud::PostProvisionCleanup
- Defined in:
- lib/avst-cloud/task.rb
Instance Method Summary collapse
-
#initialize(os, debug, tmp_folder = "/tmp/avst_cloud_tmp_#{Time.now.to_i}") ⇒ PostProvisionCleanup
constructor
A new instance of PostProvisionCleanup.
- #make_commands(os, tmp_folder) ⇒ Object
Methods inherited from SshCommandTask
Methods inherited from SshTask
Methods inherited from Task
Methods included from Logging
included, logger, #logger, logger=, mask_message, show_passwords=
Constructor Details
#initialize(os, debug, tmp_folder = "/tmp/avst_cloud_tmp_#{Time.now.to_i}") ⇒ PostProvisionCleanup
Returns a new instance of PostProvisionCleanup.
245 246 247 |
# File 'lib/avst-cloud/task.rb', line 245 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
249 250 251 252 253 254 255 256 257 258 259 260 |
# File 'lib/avst-cloud/task.rb', line 249 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 |