2013-02-28 03:12:34 +00:00
|
|
|
module Vagrant
|
|
|
|
module LXC
|
|
|
|
class MachineState < Vagrant::MachineState
|
2013-03-01 03:34:51 +00:00
|
|
|
CREATED_STATES = %w( running poweroff ).map!(&:to_sym)
|
2013-02-28 03:12:34 +00:00
|
|
|
|
2013-03-01 03:34:51 +00:00
|
|
|
def initialize(state_id)
|
|
|
|
short = state_id.to_s.gsub("_", " ")
|
|
|
|
long = I18n.t("vagrant.commands.status.#{state_id}")
|
|
|
|
super(state_id, short, long)
|
2013-02-28 03:12:34 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def created?
|
|
|
|
CREATED_STATES.include?(self.id)
|
|
|
|
end
|
|
|
|
|
|
|
|
def off?
|
|
|
|
self.id == :poweroff
|
|
|
|
end
|
|
|
|
|
|
|
|
def running?
|
|
|
|
self.id == :running
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|