Project

General

Profile

Actions

Bug #15706

closed

hammer gives poor error message when :host: in ~/.hammer/cli_config.yml is missing https

Added by Bryan Kearney almost 8 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Hammer core
Target version:
-
Difficulty:
Triaged:
Team Backlog:
Marek
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1356720
Description of problem:

Installing             Done                                               [100%] [...............................................................................................................................]
  Success!
  * Katello is running at https://satellite.ttc.com
      Initial credentials are admin / redhat
  * To install additional capsule on separate machine continue by running:

      capsule-certs-generate --capsule-fqdn "$CAPSULE" --certs-tar "~/$CAPSULE-certs.tar" 

  The full log is at /var/log/foreman-installer/satellite.log

wget -O /root/Manifest.zip http://file.rdu.redhat.com/~rjerrido/manifests/Sat61_Field_Manifest_Generated_05May2016_2.zip
--2016-07-14 15:45:34--  http://file.rdu.redhat.com/~rjerrido/manifests/Sat61_Field_Manifest_Generated_05May2016_2.zip
Resolving file.rdu.redhat.com (file.rdu.redhat.com)... 10.11.5.7
Connecting to file.rdu.redhat.com (file.rdu.redhat.com)|10.11.5.7|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1265248 (1.2M) [application/zip]
Saving to: ‘/root/Manifest.zip’

100%[=========================================================================================================================================================================>] 1,265,248   1.19MB/s   in 1.0s  

2016-07-14 15:45:35 (1.19 MB/s) - ‘/root/Manifest.zip’ saved [1265248/1265248]

hammer subscription upload --organization "$ORG" --file /root/Manifest.zip
Error: undefined method `request' for #<String:0x000000035bd0f8>

Error message was very unhelpful.
rjerrido noticed I was missing something in ~/.hammer/cli_config.yml:

[root@satellite ~]# file .hammer/cli_config.yml
.hammer/cli_config.yml: ASCII text
[root@satellite ~]# cat .hammer/cli_config.yml
:foreman:
:host: 'satellite.ttc.com'
:username: 'admin'
:password: 'redhat'

I changed :host: to 'https://satellite.ttc.com' and it worked.

Version-Release number of selected component (if applicable):
tfm-rubygem-hammer_cli-0.5.1.10-1.el7sat.noarch

How reproducible:
Always

Steps to Reproduce:
1. On a new install, make sure .hammer/cli_config.yml is set up as above
2. Attempt a hammer command
3. Witness the unhelpful error message

Actual results:
Error: undefined method `request' for #<String:0x000000035bd0f8>

Expected results:
Either https:// is assumed (if it's missing) or an error message that points out a configuration error in .hammer/cli_config.yml should appear

Additional info:

Actions

Also available in: Atom PDF