Class: VagrantPlugins::OCI::Action::IsTerminated
- Inherits:
-
Object
- Object
- VagrantPlugins::OCI::Action::IsTerminated
- Defined in:
- lib/vagrant-oci/action/is_terminated.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ IsTerminated
constructor
A new instance of IsTerminated.
Constructor Details
#initialize(app, env) ⇒ IsTerminated
Returns a new instance of IsTerminated.
5 6 7 |
# File 'lib/vagrant-oci/action/is_terminated.rb', line 5 def initialize(app, env) @app = app end |
Instance Method Details
#call(env) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/vagrant-oci/action/is_terminated.rb', line 9 def call(env) ocid = env[:machine].id instance_data = env[:oci_compute].get_instance(ocid).data.to_hash env[:result] = %w[TERMINATED TERMINATING].include? instance_data[:lifecycleState].upcase @app.call(env) end |