On 08/06/12 02:30, Francesco Vollero wrote:
> Hi Dave,
>
> On Thu, Jun 7, 2012 at 6:24 PM, Dave Johnson <[email protected]> wrote:
>> Ultimately needed for some unrelated conductor QE testing
>
> Nack.
+1 - needs a bit more explanation about what/why this is needed.
Depending on what this is needed for, a more palatable solution may be
to keep the existing functionality and do what you are seeking as an
addition. This could be a separate method in mock driver (def
check_credentials_regex) or within the existing check_credentials but
without overriding expected/default behaviour (as Francesco alludes to -
this is used in our tests): like
def check_credentials(credentials, strict=true)
if strict
raise 'AuthFailure' if (( credentials.user != 'mockuser' ) or (
credentials.password != 'mockpassword' ))
else
raise 'AuthFailure' if ( ! credentials.user.include? 'mockuser'
) or (
! credentials.password.include? 'mockpassword' )
end
end
> I would expect a more deeper description in order to accept it.
> Why you would like to have an user like mockuser01 or such things ?
> You can please also cite the Bugzilla or Redmine for conductor so we
> can figure out the real purpose of this patch ?
> Moreover, if you modify this line you should also write/fix the tests.
>
> Cheers,
> Francesco
>
>> ---
>> server/lib/deltacloud/drivers/mock/mock_driver.rb | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/server/lib/deltacloud/drivers/mock/mock_driver.rb
>> b/server/lib/deltacloud/drivers/mock/mock_driver.rb
>> index ba817c6..cce4f48 100644
>> --- a/server/lib/deltacloud/drivers/mock/mock_driver.rb
>> +++ b/server/lib/deltacloud/drivers/mock/mock_driver.rb
>> @@ -460,7 +460,7 @@ module Deltacloud::Drivers::Mock
>>
>> def check_credentials(credentials)
>> safely do
>> - if ( credentials.user != 'mockuser' ) or ( credentials.password !=
>> 'mockpassword' )
>> + if ( ! credentials.user.include? 'mockuser' ) or ( !
>> credentials.password.include? 'mockpassword' )
>> raise 'AuthFailure'
>> end
>> end
>> --
>> 1.7.7.6
>>