Role & database resources for PostgreSQL: error - not connected

Hello,

Similar to the database resource in the MySQL cookbook, I am trying to
add role and database resources to the PostgreSQL cookbook.

https://github.com/atriso/chef-repo-pas

Most of the code is in place (cleanup needed), but I am stuck with an
error that my Postgres client tells me I’m not connected, just after
my connection is made.

Generated at Mon Jun 06 23:47:37 -0700 2011
PGError: postgresql_role[openerp] (openerp::database line 30) had an
error: not connected
/tmp/vagrant-chef/cookbooks-0/postgresql/providers/role.rb:69:in exec' /tmp/vagrant-chef/cookbooks-0/postgresql/providers/role.rb:69:inexists?’
/tmp/vagrant-chef/cookbooks-0/postgresql/providers/role.rb:24:in
class_from_file' /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/provider.rb:104:ininstance_eval’
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/…/lib/chef/provider.rb:104:in
action_create' /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource.rb:417:insend’
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/…/lib/chef/resource.rb:417:in
run_action' /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/runner.rb:45:inrun_action’
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/…/lib/chef/runner.rb:78:in
converge' /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/runner.rb:78:ineach’
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/…/lib/chef/runner.rb:78:in
converge' /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection.rb:94 /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:incall’
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/…/lib/chef/resource_collection/stepable_iterator.rb:116:in
call_iterator_block' /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:instep’
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/…/lib/chef/resource_collection/stepable_iterator.rb:104:in
iterate' /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:ineach_with_index’
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/…/lib/chef/resource_collection.rb:92:in
execute_each_resource' /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/runner.rb:76:inconverge’
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/…/lib/chef/client.rb:312:in
converge' /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/client.rb:160:inrun’
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/…/lib/chef/application/solo.rb:192:in
run_application' /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/application/solo.rb:183:inloop’
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/…/lib/chef/application/solo.rb:183:in
run_application' /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/application.rb:66:inrun’
/usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/chef-solo:25
/usr/bin/chef-solo:19:in `load’
/usr/bin/chef-solo:19

Could anyone have a look at the code and see where I missed something?

Ringo