Bug 1324618 - hammer hostgroup create failed
Summary: hammer hostgroup create failed
Keywords:
Status: CLOSED DUPLICATE of bug 1309107
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Host Group
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: sthirugn@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-06 19:25 UTC by sthirugn@redhat.com
Modified: 2019-04-01 20:27 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-18 15:37:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description sthirugn@redhat.com 2016-04-06 19:25:22 UTC
Description of problem:


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


How reproducible:


Steps to Reproduce:
hammer> hostgroup create --name=rhel7hg --organization-ids=1 --location-ids=2
Hostgroup created

hammer> hostgroup create --name=rhel7hg_new --organization-ids=1 --location-ids=2 --content-view=rhel7cv --lifecycle-environment=QE
Could not create the hostgroup:
  Error: Could not find organization, please set one of options --organizations, --organization-ids.


Actual results:
hammer debug error:
[ INFO 2016-04-06 15:20:23 Init] Initialization of Hammer CLI (0.5.1.4) has started...
[DEBUG 2016-04-06 15:20:23 Init] Running at ruby 2.2.2-p95
[ INFO 2016-04-06 15:20:23 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2016-04-06 15:20:23 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2016-04-06 15:20:23 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded
[ INFO 2016-04-06 15:20:23 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded
[ INFO 2016-04-06 15:20:23 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_tasks.yml has been loaded
[ INFO 2016-04-06 15:20:23 Init] Configuration from the file /etc/hammer/cli.modules.d/gutterball.yml has been loaded
[ INFO 2016-04-06 15:20:23 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded
[ INFO 2016-04-06 15:20:23 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[DEBUG 2016-04-06 15:20:24 Connection] Registered: foreman
[DEBUG 2016-04-06 15:20:24 API] Global headers: {
        :content_type => "application/json",
              :accept => "application/json;version=2",
    "Accept-Language" => "en"
}
[ INFO 2016-04-06 15:20:24 Modules] Extension module hammer_cli_foreman (0.5.1.3) loaded
[ INFO 2016-04-06 15:20:24 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.3) loaded
[ INFO 2016-04-06 15:20:24 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2016-04-06 15:20:24 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2016-04-06 15:20:25 Modules] Extension module hammer_cli_gutterball (1.0.1) loaded
[ INFO 2016-04-06 15:20:25 Modules] Extension module hammer_cli_import (0.10.23) loaded
[ INFO 2016-04-06 15:20:25 Modules] Extension module hammer_cli_katello (0.0.22.5) loaded
[DEBUG 2016-04-06 15:20:25 Init] Using locale 'en'
[DEBUG 2016-04-06 15:20:25 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.4/locale'
[DEBUG 2016-04-06 15:20:25 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.3/locale'
[DEBUG 2016-04-06 15:20:25 Init] 'mo' files for locale domain 'hammer_cli_foreman_docker' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman_docker-0.0.4/locale'
[DEBUG 2016-04-06 15:20:25 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_katello-0.0.22.5/locale'
[ INFO 2016-04-06 15:20:25 HammerCLI::MainCommand] Called with options: {"option_verbose"=>true, "option_debug"=>true}
[ INFO 2016-04-06 15:20:25 HammerCLIForeman::Hostgroup] Called with options: {}
[ INFO 2016-04-06 15:20:25 HammerCLIForeman::Hostgroup::CreateCommand] Called with options: {"option_content_view_name"=>"rhel7cv", "option_lifecycle_environment_name"=>"QE", "option_name"=>"rhel7hg_dupe", "option_location_ids"=>["2"], "option_organization_ids"=>["1"]}
[ INFO 2016-04-06 15:20:25 HammerCLIForeman::Hostgroup::CreateCommand] Error occured while searching for content_view
[ERROR 2016-04-06 15:20:25 Exception] Error: Could not find organization, please set one of options --organizations, --organization-ids.
Could not create the hostgroup:
  Error: Could not find organization, please set one of options --organizations, --organization-ids.
[ERROR 2016-04-06 15:20:25 Exception] 

HammerCLIForeman::MissingSeachOptions (Could not find organization, please set one of options --organizations, --organization-ids.):
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.3/lib/hammer_cli_foreman/commands.rb:202:in `rescue in send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.5.1.3/lib/hammer_cli_foreman/commands.rb:189:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.4/lib/hammer_cli/apipie/command.rb:34:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.4/lib/hammer_cli/abstract.rb:22:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.4/lib/hammer_cli/abstract.rb:22:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.4/lib/hammer_cli/abstract.rb:22:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.4/bin/hammer:125:in `<top (required)>'
    /usr/bin/hammer:23:in `load'
    /usr/bin/hammer:23:in `<main>'


Expected results:
No error or meaningful error.  I am supplying --organization-ids here.

Additional info:

Comment 2 sthirugn@redhat.com 2016-04-06 19:35:51 UTC
Version: Satellite 6.2.0-beta-snap2.1

Comment 3 Brad Buckingham 2016-04-06 20:57:36 UTC
This may not be a regression for Satellite 6.2.  I see the same issue on my Satellite 6.1.5 instance.  E.g.

hammer> organization list
---|----------------------|----------------------|------------
ID | NAME                 | LABEL                | DESCRIPTION
---|----------------------|----------------------|------------
1  | Default Organization | Default_Organization |            
3  | stage-test           | stage-test           |            
4  | test-wizard          | test-wizard          |            
---|----------------------|----------------------|------------
hammer> location list
---|-----------------
ID | NAME            
---|-----------------
2  | Default Location
---|-----------------
hammer> lifecycle-environment list --organization-id 1
---|---------|------
ID | NAME    | PRIOR
---|---------|------
1  | Library |      
---|---------|------
hammer> content-view list --organization-id 1
----------------|---------------------------|---------------------------|-----------|---------------
CONTENT VIEW ID | NAME                      | LABEL                     | COMPOSITE | REPOSITORY IDS
----------------|---------------------------|---------------------------|-----------|---------------
1               | Default Organization View | Default_Organization_View |           |               
2               | zoo view exclude          | zoo_view_exclude          |           | 1             
3               | zoo view include          | zoo_view_include          |           | 1             
----------------|---------------------------|---------------------------|-----------|---------------
hammer> hostgroup create --organization-ids 1 --location-ids 2 --name testgroup1
Hostgroup created
hammer> hostgroup create --organization-ids 1 --location-ids 2 --name testgroup2 --content-view "zoo view include" --lifecycle-environment Library
Could not create the hostgroup:
  Error: Could not find organization, please set one of options --organizations, --organization-ids.
hammer>

Comment 4 Brad Buckingham 2016-04-06 21:06:09 UTC
One additional observation, it is possible to create the host group if specifying the id for content view and lifecycle environment.   E.g.

hammer> hostgroup create --name group2 --organization-ids 1 --location-ids 2 --content-view-id 9 --lifecycle-environment-id 1
Hostgroup created

Comment 5 sthirugn@redhat.com 2016-04-06 21:13:20 UTC
Moving to GA as per comment 3.

Comment 6 Andrew Kofink 2016-04-18 15:37:36 UTC
Also in 6.1.5

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


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