On 04/06/10 20:55 +0100, [email protected] wrote:
>ack
>
>the brief listing stuff is very very cool... solves the timeouts with
>image listing in terremark. I didn't test the Client stuff but all 7
>applied cleanly and build/work fine.
>
>Why do you remove the feature from mock driver in patch 5/7? Also,
I remove that, because it unfortunatelly breaks Cucumber tests ;-)
But your are right, I should include this feature and also update cucumber.
>sorry if this is obvious, but how do we check from within the driver
>methods (e.g. in 'def images') if a feature is enabled? I want to put
>a conditional in terremark for brief_listing or full_listing.
Good question actually. We have a helper method for that in
application_helper.rb:
def driver_has_feature?(feature_name)
not driver.features(:instances).select{ |f| f.name.eql?(feature_name)
}.empty?
end
As you can see, this helper should test if instance have some feature.
I modified this slightly to:
def driver_has_feature?(feature_name, default_collection = :instances)
not driver.features(default_collection).select{ |f|
f.name.eql?(feature_name) }.empty?
end
So now you can check, if some feature is available for a specific collection
(eg. :images in your case). Modification should be included in this patchset.
It should be accessible from inside driver, but I didn't test that yet.
-- Michal
>On 03/06/10 11:37, [email protected] wrote:
>>Hi,
>>
>>I added few more patches to go:
>>
>>4/7: Fixed missing ID elements in storage_volumes and hardware_profiles
>>5/7: Added comments to feature for brief listing. I want to keep these
>> features commented here just for testing in future.
>>6/7: This will be a little bit longer patch :)
>> I removed old client completely and rewrote it from scratch. I used
>> some meta magic to get auto-generated classes and methods.
>> This approach will allow us to add a new elements/attribute in future
>> to API
>> and 'client' library will update itself.
>> Also REXML was removed completely and replaced by faster Nokogiri.
>> Just one small thing is still missing here. I don't have '.to_plain'
>> methods
>> implemented yet, so command line client will not work... (Need +1 day ;)
>>7/7: As a bonus, *all* RSpec tests now pass nicely.
>>
>>There are +2 incompatibilities:
>>
>>instance.instance_profile => instance.hardware_profile
>>realm.limit => NoMethod exception (when no limit is set for realm)
>>
>> -- Michal
>>
>>PS: Apply this patch to latest 'master'.
>>
>>
>>_______________________________________________
>>deltacloud-devel mailing list
>>[email protected]
>>https://fedorahosted.org/mailman/listinfo/deltacloud-devel
>
--
--------------------------------------------------------
Michal Fojtik, [email protected], +420 532 294 4307
Ruby / Ruby On Rails Developer
Deltacloud API: http://deltacloud.org
--------------------------------------------------------
_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel