Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1356212 - PostgresAdmin.runcmd fails when overrides to the default options are provided
Summary: PostgresAdmin.runcmd fails when overrides to the default options are provided
Keywords:
Status: CLOSED DUPLICATE of bug 1356213
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance
Version: 5.7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: GA
: 5.7.0
Assignee: Gregg Tanzillo
QA Contact: Dave Johnson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-13 17:15 UTC by Joe Vlcek
Modified: 2016-07-26 01:53 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-20 01:44:35 UTC
Category: ---
Cloudforms Team: ---


Attachments (Terms of Use)

Description Joe Vlcek 2016-07-13 17:15:51 UTC
Description of problem:

When invoking PostgresAdmin.runcmd with overrides to the default options
a traceback is produced.


Version-Release number of selected component (if applicable): 5.7


How reproducible:

This issue can be observed using rails console on an appliance configured
with a database.


Steps to Reproduce:
1. Log into an appliance with a database
2. cd /var/www/miq/vmdb
3. bundle exec rails console
4. Run for following code segment:

require 'util/postgres_admin'

opts={}
opts[:dbname] = "vmdb_production"
opts[:hostname] = "127.0.0.1"
opts[:username] = "root"
opts[:password] = "<specify the configured root password>"

result = PostgresAdmin.runcmd("psql", opts, :command => "SELECT name FROM users ;")


Actual results:

Errno::ENOENT: No such file or directory @ unlink_internal - /root/.pgpass
	from /var/www/miq/vmdb/gems/pending/util/postgres_admin.rb:273:in `delete'
	from /var/www/miq/vmdb/gems/pending/util/postgres_admin.rb:273:in `ensure in with_pgpass_file'
	from /var/www/miq/vmdb/gems/pending/util/postgres_admin.rb:273:in `with_pgpass_file'
	from /var/www/miq/vmdb/gems/pending/util/postgres_admin.rb:258:in `runcmd_with_logging'
	from /var/www/miq/vmdb/gems/pending/util/postgres_admin.rb:253:in `runcmd'
	from (irb):9
	from /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/gems/railties-5.0.0.rc2/lib/rails/commands/console.rb:65:in `start'
	from /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/gems/railties-5.0.0.rc2/lib/rails/commands/console_helper.rb:9:in `start'
	from /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/gems/railties-5.0.0.rc2/lib/rails/commands/commands_tasks.rb:78:in `console'
	from /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/gems/railties-5.0.0.rc2/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
	from /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/gems/railties-5.0.0.rc2/lib/rails/commands.rb:18:in `<top (required)>'
	from bin/rails:4:in `require'
	from bin/rails:4:in `<main>'



Expected results:

irb(main):009:0* result = PostgresAdmin.runcmd("psql", opts, :command => "SELECT name FROM users ;")
=> "           name            \n---------------------------\n Administrator\n Consumption Administrator\n(2 rows)\n\n"


Additional info:

Comment 2 Dave Johnson 2016-07-20 01:44:35 UTC

*** This bug has been marked as a duplicate of bug 1356213 ***


Note You need to log in before you can comment on or make changes to this bug.