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 included from Logging
Methods inherited from SshTask
Methods inherited from Task
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 |