On 02/24/2012 10:46 PM, Jim Meyering wrote:
jprovazn(a)redhat.com wrote:
> From: Jan Provaznik<jprovazn(a)redhat.com>
>
> Theis patch allows locally stopping of instances or deployments if
> the instance's/deployment's provider is not accessible.
>
> It fixes a bug in passing user param to queue_action method, also simplifies
> used error messages - only (stop|reboot)_invalid_action can be raised.
>
> This patch doesn't cover deletion of deployments which are not accessible - this
is difficult
> because there is a before_destroy hook on deployment which tries to destroy
instances
> on provider side.
...
Hi Jan,
I noticed that these regexps can be simplified:
> diff --git a/src/features/step_definitions/deployment_steps.rb
b/src/features/step_definitions/deployment_steps.rb
...
> +Given /^"([^"]*)" deployment's provider is not accessible$/ do
|arg1|
Using non-greedy matching like this is equivalent, and more readable:
Given /^"(.*?)" deployment's provider is not accessible$/ do |arg1|
...
> diff --git a/src/features/step_definitions/instance_steps.rb
b/src/features/step_definitions/instance_steps.rb
...
> +Given /^"([^"]*)" instance's provider is not accessible$/ do
|arg1|
Given /^"(.*?)" instance's provider is not accessible$/ do |arg1|
Hi Jim, this is nice tip.
Cucumber pregenerates current version (Given /^([^"]*)"" ...$/ do
|arg1|) and prints it on stderr when it finds a test with missing step
definition - so a user can just copy&paste this into step definition
file. So this improvement could be ideally done on upper (cucumber) level.
Jan