issue91: do not accept resume/suspend when a task is ongoing.

But please not that there is a condtional expression  ! ( active or
resumed)
To replace that by a swich.. case I have to list all the  task_states :
resuming, rebooting_hard, rebooting_soft,scheduling, building etc...



2014-11-20 14:49 GMT+01:00 Julien Vey <notifications@github.com>:

> In source/lib/vagrant-openstack-provider/action.rb:
>
> > @@ -137,6 +139,8 @@ def self.action_suspend
> >                b2.use Message, I18n.t('vagrant_openstack.not_created')
> >              elsif env[:machine_state_id] == :suspended
> >                b2.use Message, I18n.t('vagrant_openstack.already_suspended')
> > +            elsif !(env[:machine_state_id] == :active || env[:machine_state_id] == :resumed)
> > +              b2.use Message, I18n.t('vagrant_openstack.ongoing_task_or_not_resumed')
>
> I'd really like if you could switch this method to the switch..case
> pattern like the method def self.action_up for instance.
>
> It would really help for the readability
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/ggiamarchi/vagrant-openstack-provider/pull/172/files#r20645606>
> .
>