Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1132161 - product set-sync-plan requires sync plan id eventhough I supply sync plan name
Summary: product set-sync-plan requires sync plan id eventhough I supply sync plan name
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.0.3
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Brad Buckingham
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-20 20:12 UTC by sthirugn@redhat.com
Modified: 2017-01-05 19:15 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-05 19:15:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
sync plan not added (66.53 KB, image/png)
2016-03-28 14:44 UTC, Tazim Kolhar
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1121136 0 high CLOSED Hammer remove-sync-plan adds sync-plan instead of removing it 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1132174 0 unspecified CLOSED hammer product remove-sync-plan - Remove unused options 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1132175 0 unspecified CLOSED hammer product set-sync-plan - fix duplicate options in help text 2021-02-22 00:41:40 UTC

Internal Links: 1121136 1132174 1132175

Description sthirugn@redhat.com 2014-08-20 20:12:16 UTC
Description of problem:
product set-sync-plan requires sync plan id eventhough I supply sync plan name

Version-Release number of selected component (if applicable):
Version Tested:
GA Snap 6 - Satellite-6.0.4-RHEL-6-20140820.1

* apr-util-ldap-1.3.9-3.el6_0.1.x86_64
* candlepin-0.9.23-1.el6_5.noarch
* candlepin-common-1.0.1-1.el6_5.noarch
* candlepin-scl-1-5.el6_4.noarch
* candlepin-scl-quartz-2.1.5-5.el6_4.noarch
* candlepin-scl-rhino-1.7R3-1.el6_4.noarch
* candlepin-scl-runtime-1-5.el6_4.noarch
* candlepin-selinux-0.9.23-1.el6_5.noarch
* candlepin-tomcat6-0.9.23-1.el6_5.noarch
* elasticsearch-0.90.10-6.el6sat.noarch
* foreman-1.6.0.41-1.el6sat.noarch
* foreman-compute-1.6.0.41-1.el6sat.noarch
* foreman-gce-1.6.0.41-1.el6sat.noarch
* foreman-libvirt-1.6.0.41-1.el6sat.noarch
* foreman-ovirt-1.6.0.41-1.el6sat.noarch
* foreman-postgresql-1.6.0.41-1.el6sat.noarch
* foreman-proxy-1.6.0.29-1.el6sat.noarch
* foreman-selinux-1.6.0.7-1.el6sat.noarch
* foreman-vmware-1.6.0.41-1.el6sat.noarch
* katello-1.5.0-29.el6sat.noarch
* katello-ca-1.0-1.noarch
* katello-certs-tools-1.5.6-1.el6sat.noarch
* katello-installer-0.0.60-1.el6sat.noarch
* openldap-2.4.23-34.el6_5.1.x86_64
* openldap-devel-2.4.23-34.el6_5.1.x86_64
* pulp-katello-0.3-3.el6sat.noarch
* pulp-nodes-common-2.4.0-0.30.beta.el6sat.noarch
* pulp-nodes-parent-2.4.0-0.30.beta.el6sat.noarch
* pulp-puppet-plugins-2.4.0-0.30.beta.el6sat.noarch
* pulp-puppet-tools-2.4.0-0.30.beta.el6sat.noarch
* pulp-rpm-plugins-2.4.0-0.30.beta.el6sat.noarch
* pulp-selinux-2.4.0-0.30.beta.el6sat.noarch
* pulp-server-2.4.0-0.30.beta.el6sat.noarch
* python-ldap-2.3.10-1.el6.x86_64
* ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch
* ruby193-rubygem-runcible-1.1.0-2.el6sat.noarch

How reproducible:
Always

Steps to Reproduce:
hammer> product set-sync-plan --name morerepos --organization-id=3 --sync-plan='testsyncplan' 
Could not assign synchronization plan.:
  Error: option '--sync_plan_id' is required
  
  See: ' product set-sync-plan --help'

Actual results:
Even after supplying sync-plan name (and organization id) it errored out asking for sync plan id

Expected results:
Option 1:
- accept sync plan name and not mandate sync plan id

Option 2:
- if we require sync plan id all the time, remove the sync plan name from the command


Additional info:

Comment 1 RHEL Program Management 2014-08-20 20:13:18 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 sthirugn@redhat.com 2014-08-20 20:20:27 UTC
Also happened for remove-sync-plan

hammer> product remove-sync-plan --name morerepos --organization-id=3 --sync-plan='testsyncplan'
Could not remove synchronization plan.:
  Error: sync_plan found more than once

hammer> sync-plan list --organization-id=3
---|--------------|---------------------|---------
ID | NAME         | START DATE          | INTERVAL
---|--------------|---------------------|---------
3  | testsync     | 2014/08/20 19:00:00 | none    
1  | sdfd         | 2014/08/12 16:35:00 | none    
2  | testsyncplan | 2014/08/14 19:50:00 | none    
---|--------------|---------------------|---------

Comment 4 Brad Buckingham 2015-08-27 21:07:23 UTC
I have tested this on a Satellite 6.1.1 GA install and am no longer observing
the behavior described.

RPMs:
ruby193-rubygem-katello-2.2.0.66-1.el7sat.noarch
foreman-1.7.2.34-1.el7sat.noarch

-----------------------------------

hammer> product set-sync-plan --organization-id 1 --name zoo --sync-plan theplan
Synchronization plan assigned.

hammer> product info --organization-id 1 --name zoo
ID:           120
Name:         zoo
Label:        zoo
Description:  
Sync State:   
Sync Plan ID: 1
GPG:          
    GPG Key ID: 
    GPG Key:
Organization: Default Organization
Readonly:     false
Deletable:    
Content:      
 1) Repo Name:    zoo
    URL:          /custom/zoo/zoo
    Content Type: yum

hammer> product remove-sync-plan --organization-id 1 --name zoo --sync-plan theplan
Warning: Option --sync-plan is deprecated. The value was not used because sync plan is determined by product id
Synchronization plan removed.

hammer> product info --organization-id 1 --name zoo
ID:           120
Name:         zoo
Label:        zoo
Description:  
Sync State:   
Sync Plan ID: 
GPG:          
    GPG Key ID: 
    GPG Key:
Organization: Default Organization
Readonly:     false
Deletable:    
Content:      
 1) Repo Name:    zoo
    URL:          /custom/zoo/zoo
    Content Type: yum

hammer>

Comment 5 Tazim Kolhar 2016-03-28 13:28:25 UTC
VERIFIED:

# rpm -qa | grep foreman
tfm-rubygem-hammer_cli_foreman_tasks-0.0.10-2.el7sat.noarch
tfm-rubygem-foreman-tasks-0.7.14.1-1.el7sat.noarch
foreman-libvirt-1.11.0.7-1.el7sat.noarch
tfm-rubygem-foreman_gutterball-0.0.1-6.el7sat.noarch
foreman-discovery-image-3.0.5-3.el7sat.noarch
foreman-selinux-1.11.0-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman-0.5.1.2-1.el7sat.noarch
foreman-gce-1.11.0.7-1.el7sat.noarch
foreman-debug-1.11.0.7-1.el7sat.noarch
tfm-rubygem-foreman_theme_satellite-0.1.3-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_bootdisk-0.1.3-4.el7sat.noarch
foreman-1.11.0.7-1.el7sat.noarch
tfm-rubygem-foreman_bootdisk-6.1.0-1.el7sat.noarch
foreman-postgresql-1.11.0.7-1.el7sat.noarch
amd-ma78gm-01.rhts.eng.bos.redhat.com-foreman-client-1.0-1.noarch
amd-ma78gm-01.rhts.eng.bos.redhat.com-foreman-proxy-1.0-1.noarch
foreman-proxy-1.11.0.2-1.el7sat.noarch
foreman-installer-1.11.0.0-1.el7sat.noarch
foreman-compute-1.11.0.7-1.el7sat.noarch
foreman-ovirt-1.11.0.7-1.el7sat.noarch
tfm-rubygem-foreman-redhat_access-1.0.1-2.el7sat.noarch
tfm-rubygem-foreman_discovery-5.0.0.2-1.el7sat.noarch
foreman-vmware-1.11.0.7-1.el7sat.noarch
foreman-installer-katello-3.0.0.9-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_docker-0.0.4-1.el7sat.noarch
tfm-rubygem-foreman_docker-2.0.1.1-1.el7sat.noarch
tfm-rubygem-foreman_hooks-0.3.9-2.el7sat.noarch
amd-ma78gm-01.rhts.eng.bos.redhat.com-foreman-proxy-client-1.0-1.noarch
tfm-rubygem-foreman_remote_execution-0.3.0.2-1.el7sat.noarch
tfm-rubygem-foreman_openscap-0.5.3.2-1.el7sat.noarch


steps:
# hammer -u admin -p changeme -v -d product set-sync-plan --name test_prod --organization-id 1 --sync-plan="test_sync_plan"
[ INFO 2016-03-28 09:22:35 Init] Initialization of Hammer CLI (0.5.1.3) has started...
[DEBUG 2016-03-28 09:22:35 Init] Running at ruby 2.2.2-p95
[ INFO 2016-03-28 09:22:35 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2016-03-28 09:22:35 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2016-03-28 09:22:35 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded
[ INFO 2016-03-28 09:22:35 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded
[ INFO 2016-03-28 09:22:35 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_tasks.yml has been loaded
[ INFO 2016-03-28 09:22:35 Init] Configuration from the file /etc/hammer/cli.modules.d/gutterball.yml has been loaded
[ INFO 2016-03-28 09:22:35 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded
[ INFO 2016-03-28 09:22:35 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[DEBUG 2016-03-28 09:22:36 Connection] Registered: foreman
[DEBUG 2016-03-28 09:22:36 API] Global headers: {
        :content_type => "application/json",
              :accept => "application/json;version=2",
    "Accept-Language" => "en"
}
[ INFO 2016-03-28 09:22:37 Modules] Extension module hammer_cli_foreman (0.5.1.2) loaded
[ INFO 2016-03-28 09:22:37 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.3) loaded
[ INFO 2016-03-28 09:22:37 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2016-03-28 09:22:37 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2016-03-28 09:22:38 Modules] Extension module hammer_cli_gutterball (1.0.1) loaded
[ INFO 2016-03-28 09:22:38 Modules] Extension module hammer_cli_import (0.10.23) loaded
[ INFO 2016-03-28 09:22:38 Modules] Extension module hammer_cli_katello (0.0.22.2) loaded
[DEBUG 2016-03-28 09:22:38 Init] Using locale 'en'
[DEBUG 2016-03-28 09:22:38 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.3/locale'
[DEBUG 2016-03-28 09:22:38 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.2/locale'
[DEBUG 2016-03-28 09:22:38 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-03-28 09:22:38 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.2/locale'
[ INFO 2016-03-28 09:22:38 HammerCLI::MainCommand] Called with options: {"option_verbose"=>true, "option_debug"=>true, "option_username"=>"admin", "option_password"=>"***"}
[ INFO 2016-03-28 09:22:38 HammerCLIKatello::Product] Called with options: {}
[ INFO 2016-03-28 09:22:38 HammerCLIKatello::Product::SetSyncPlanCommand] Called with options: {"option_name"=>"test_prod", "option_organization_id"=>1, "option_sync_plan_name"=>"test_sync_plan"}
[ INFO 2016-03-28 09:22:38 API] GET /katello/api/organizations/1/sync_plans
[DEBUG 2016-03-28 09:22:38 API] Params: {
    "name" => "test_sync_plan"
}
[DEBUG 2016-03-28 09:22:38 API] Headers: {
    :params => {
        "name" => "test_sync_plan"
    }
}
[DEBUG 2016-03-28 09:22:38 API] Response: {
       "total" => 1,
    "subtotal" => 1,
        "page" => 1,
    "per_page" => 20,
       "error" => nil,
      "search" => nil,
        "sort" => {
           "by" => nil,
        "order" => nil
    },
     "results" => [
        [0] {
                         "id" => 1,
            "organization_id" => 1,
                       "name" => "test_sync_plan",
                "description" => nil,
                  "sync_date" => "2016-03-28 13:19:00 UTC",
                   "interval" => "hourly",
                  "next_sync" => "2016-03-28 14:19:00 UTC",
                 "created_at" => "2016-03-28 13:19:50 UTC",
                 "updated_at" => "2016-03-28 13:19:50 UTC",
                    "enabled" => true,
                   "products" => [],
                "permissions" => {
                   "view_sync_plans" => true,
                   "edit_sync_plans" => true,
                "destroy_sync_plans" => true
            }
        }
    ]
}
[DEBUG 2016-03-28 09:22:38 API] Response headers: {
                      :date => "Mon, 28 Mar 2016 13:22:38 GMT",
                    :server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
           :x_frame_options => "SAMEORIGIN",
          :x_xss_protection => "1; mode=block",
    :x_content_type_options => "nosniff",
           :foreman_version => "1.11.0.7",
       :foreman_api_version => "2",
           :apipie_checksum => "d3a176783bc1fcfffa8746dea2d27b67",
             :cache_control => "max-age=0, private, must-revalidate",
              :x_request_id => "7126c4dd-8169-456e-b588-9c13d40791a9",
                 :x_runtime => "0.262483",
              :x_powered_by => "Phusion Passenger 4.0.18",
                :set_cookie => [
        [0] "_session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJTllZjk4MDE3MTRhMTU0MWM1Y2RmMjBmYTY2NzgxMjg4BjsAVEkiC2xvY2FsZQY7AEYiB2Vu--453f5b4032c255ea85c3ed091b6372b05b70d7d6; path=/; HttpOnly"
    ],
                      :etag => "\"53b02300e3f9732790fba4a7a0a283c4-gzip\"",
                    :status => "200 OK",
                      :vary => "Accept-Encoding",
          :content_encoding => "gzip",
            :content_length => "263",
              :content_type => "application/json; charset=utf-8"
}
[ INFO 2016-03-28 09:22:38 API] GET /katello/api/organizations/1/products
[DEBUG 2016-03-28 09:22:38 API] Params: {
    "name" => "test_prod"
}
[DEBUG 2016-03-28 09:22:38 API] Headers: {
    :params => {
        "name" => "test_prod"
    }
}
[DEBUG 2016-03-28 09:22:39 API] Response: {
       "total" => 1,
    "subtotal" => 1,
        "page" => 1,
    "per_page" => 20,
       "error" => nil,
      "search" => nil,
        "sort" => {
           "by" => nil,
        "order" => nil
    },
     "results" => [
        [0] {
                          "id" => 13,
                       "cp_id" => "1459171288541",
                        "name" => "test_prod",
                       "label" => "test_prod",
                 "description" => nil,
                 "provider_id" => 1,
                "sync_plan_id" => nil,
                "sync_summary" => {},
                  "gpg_key_id" => nil,
                      "redhat" => false,
                  "sync_state" => nil,
                   "last_sync" => nil,
             "last_sync_words" => nil,
                "organization" => {
                 "name" => "Default Organization",
                "label" => "Default_Organization",
                   "id" => 1
            },
                   "sync_plan" => nil,
                 "sync_status" => {
                           "id" => nil,
                   "product_id" => nil,
                     "progress" => nil,
                      "sync_id" => nil,
                        "state" => nil,
                    "raw_state" => nil,
                   "start_time" => nil,
                  "finish_time" => nil,
                     "duration" => nil,
                 "display_size" => nil,
                         "size" => nil,
                   "is_running" => nil,
                "error_details" => nil
            },
            "repository_count" => 0
        }
    ]
}
[DEBUG 2016-03-28 09:22:39 API] Response headers: {
                      :date => "Mon, 28 Mar 2016 13:22:38 GMT",
                    :server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
           :x_frame_options => "SAMEORIGIN",
          :x_xss_protection => "1; mode=block",
    :x_content_type_options => "nosniff",
           :foreman_version => "1.11.0.7",
       :foreman_api_version => "2",
           :apipie_checksum => "d3a176783bc1fcfffa8746dea2d27b67",
             :cache_control => "max-age=0, private, must-revalidate",
              :x_request_id => "aab1a7f8-40ca-460f-a76b-a2ab35dcebac",
                 :x_runtime => "0.299477",
              :x_powered_by => "Phusion Passenger 4.0.18",
                :set_cookie => [
        [0] "_session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJWJkZWJmMTE2MTBkNGY0ZDBmNzYwOGZiNzY4MWZkYmQ0BjsAVEkiC2xvY2FsZQY7AEYiB2Vu--34960f3aca172a1f251b2b71ae35ef215473d6c6; path=/; HttpOnly"
    ],
                      :etag => "\"13f56aa31662afe4211e475963c279f6-gzip\"",
                    :status => "200 OK",
                      :vary => "Accept-Encoding",
          :content_encoding => "gzip",
            :content_length => "341",
              :content_type => "application/json; charset=utf-8"
}
[ INFO 2016-03-28 09:22:39 API] PUT /katello/api/products/13
[DEBUG 2016-03-28 09:22:39 API] Params: {
    "sync_plan_id" => 1,
            "name" => "test_prod"
}
[DEBUG 2016-03-28 09:22:39 API] Headers: {}
[DEBUG 2016-03-28 09:22:46 API] Response: {
               "product_content" => [],
             "available_content" => [],
                            "id" => 13,
                         "cp_id" => "1459171288541",
                          "name" => "test_prod",
                         "label" => "test_prod",
                   "description" => nil,
                   "provider_id" => 1,
                  "sync_plan_id" => 1,
                  "sync_summary" => {},
                    "gpg_key_id" => nil,
                        "redhat" => false,
                    "sync_state" => nil,
                     "last_sync" => nil,
               "last_sync_words" => nil,
                  "organization" => {
         "name" => "Default Organization",
        "label" => "Default_Organization",
           "id" => 1
    },
                     "sync_plan" => {
               "name" => "test_sync_plan",
        "description" => nil,
          "sync_date" => "2016-03-28 13:19:00 UTC",
           "interval" => "hourly",
          "next_sync" => "2016-03-28 14:19:00 UTC"
    },
                   "sync_status" => {
                   "id" => nil,
           "product_id" => nil,
             "progress" => nil,
              "sync_id" => nil,
                "state" => nil,
            "raw_state" => nil,
           "start_time" => nil,
          "finish_time" => nil,
             "duration" => nil,
         "display_size" => nil,
                 "size" => nil,
           "is_running" => nil,
        "error_details" => nil
    },
              "repository_count" => 0,
                    "created_at" => "2016-03-28 13:21:28 UTC",
                    "updated_at" => "2016-03-28 13:22:39 UTC",
                  "repositories" => [],
                      "provider" => {
        "name" => "Anonymous"
    },
                   "permissions" => {
        "destroy_products" => true,
           "edit_products" => true,
           "sync_products" => true
    },
    "published_content_view_ids" => []
}
[DEBUG 2016-03-28 09:22:46 API] Response headers: {
                      :date => "Mon, 28 Mar 2016 13:22:39 GMT",
                    :server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
           :x_frame_options => "SAMEORIGIN",
          :x_xss_protection => "1; mode=block",
    :x_content_type_options => "nosniff",
           :foreman_version => "1.11.0.7",
       :foreman_api_version => "2",
           :apipie_checksum => "d3a176783bc1fcfffa8746dea2d27b67",
             :cache_control => "max-age=0, private, must-revalidate",
              :x_request_id => "298bcda2-2cb3-4992-9a16-03916e6f7c10",
                 :x_runtime => "7.064796",
              :x_powered_by => "Phusion Passenger 4.0.18",
                :set_cookie => [
        [0] "request_method=PUT; path=/",
        [1] "_session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJWFhM2EwZWFmMDk3NTc3Nzg5YzI3MGNkODZjZWM2YThjBjsAVEkiC2xvY2FsZQY7AEYiB2Vu--201520219d8134ae8985e06aebc8096d823a8779; path=/; HttpOnly"
    ],
                      :etag => "\"212772579d5d71ca3c258c653f428264-gzip\"",
                    :status => "200 OK",
                      :vary => "Accept-Encoding",
          :content_encoding => "gzip",
            :content_length => "462",
              :content_type => "application/json; charset=utf-8"
}
Synchronization plan assigned.


Remove Sync-plan
# hammer -u admin -p changeme -v -d product remove-sync-plan --name test_prod --organization-id 1
[ INFO 2016-03-28 09:26:56 Init] Initialization of Hammer CLI (0.5.1.3) has started...
[DEBUG 2016-03-28 09:26:56 Init] Running at ruby 2.2.2-p95
[ INFO 2016-03-28 09:26:56 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2016-03-28 09:26:56 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2016-03-28 09:26:56 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded
[ INFO 2016-03-28 09:26:56 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded
[ INFO 2016-03-28 09:26:56 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_tasks.yml has been loaded
[ INFO 2016-03-28 09:26:56 Init] Configuration from the file /etc/hammer/cli.modules.d/gutterball.yml has been loaded
[ INFO 2016-03-28 09:26:56 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded
[ INFO 2016-03-28 09:26:56 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[DEBUG 2016-03-28 09:26:56 Connection] Registered: foreman
[DEBUG 2016-03-28 09:26:56 API] Global headers: {
        :content_type => "application/json",
              :accept => "application/json;version=2",
    "Accept-Language" => "en"
}
[ INFO 2016-03-28 09:26:57 Modules] Extension module hammer_cli_foreman (0.5.1.2) loaded
[ INFO 2016-03-28 09:26:57 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.3) loaded
[ INFO 2016-03-28 09:26:57 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2016-03-28 09:26:57 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2016-03-28 09:26:57 Modules] Extension module hammer_cli_gutterball (1.0.1) loaded
[ INFO 2016-03-28 09:26:57 Modules] Extension module hammer_cli_import (0.10.23) loaded
[ INFO 2016-03-28 09:26:57 Modules] Extension module hammer_cli_katello (0.0.22.2) loaded
[DEBUG 2016-03-28 09:26:57 Init] Using locale 'en'
[DEBUG 2016-03-28 09:26:57 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.3/locale'
[DEBUG 2016-03-28 09:26:57 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.2/locale'
[DEBUG 2016-03-28 09:26:57 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-03-28 09:26:57 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.2/locale'
[ INFO 2016-03-28 09:26:58 HammerCLI::MainCommand] Called with options: {"option_verbose"=>true, "option_debug"=>true, "option_username"=>"admin", "option_password"=>"***"}
[ INFO 2016-03-28 09:26:58 HammerCLIKatello::Product] Called with options: {}
[ INFO 2016-03-28 09:26:58 HammerCLIKatello::Product::RemoveSyncPlanCommand] Called with options: {"option_name"=>"test_prod", "option_organization_id"=>1}
[ INFO 2016-03-28 09:26:58 API] GET /katello/api/organizations/1/products
[DEBUG 2016-03-28 09:26:58 API] Params: {
    "name" => "test_prod"
}
[DEBUG 2016-03-28 09:26:58 API] Headers: {
    :params => {
        "name" => "test_prod"
    }
}
[DEBUG 2016-03-28 09:26:58 API] Response: {
       "total" => 1,
    "subtotal" => 1,
        "page" => 1,
    "per_page" => 20,
       "error" => nil,
      "search" => nil,
        "sort" => {
           "by" => nil,
        "order" => nil
    },
     "results" => [
        [0] {
                          "id" => 13,
                       "cp_id" => "1459171288541",
                        "name" => "test_prod",
                       "label" => "test_prod",
                 "description" => nil,
                 "provider_id" => 1,
                "sync_plan_id" => 1,
                "sync_summary" => {},
                  "gpg_key_id" => nil,
                      "redhat" => false,
                  "sync_state" => nil,
                   "last_sync" => nil,
             "last_sync_words" => nil,
                "organization" => {
                 "name" => "Default Organization",
                "label" => "Default_Organization",
                   "id" => 1
            },
                   "sync_plan" => {
                       "name" => "test_sync_plan",
                "description" => nil,
                  "sync_date" => "2016-03-28 13:19:00 UTC",
                   "interval" => "hourly",
                  "next_sync" => "2016-03-28 14:19:00 UTC"
            },
                 "sync_status" => {
                           "id" => nil,
                   "product_id" => nil,
                     "progress" => nil,
                      "sync_id" => nil,
                        "state" => nil,
                    "raw_state" => nil,
                   "start_time" => nil,
                  "finish_time" => nil,
                     "duration" => nil,
                 "display_size" => nil,
                         "size" => nil,
                   "is_running" => nil,
                "error_details" => nil
            },
            "repository_count" => 0
        }
    ]
}
[DEBUG 2016-03-28 09:26:58 API] Response headers: {
                      :date => "Mon, 28 Mar 2016 13:26:58 GMT",
                    :server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
           :x_frame_options => "SAMEORIGIN",
          :x_xss_protection => "1; mode=block",
    :x_content_type_options => "nosniff",
           :foreman_version => "1.11.0.7",
       :foreman_api_version => "2",
           :apipie_checksum => "d3a176783bc1fcfffa8746dea2d27b67",
             :cache_control => "max-age=0, private, must-revalidate",
              :x_request_id => "adfde6a1-8a11-4e7c-81bc-5f623b0874f5",
                 :x_runtime => "0.411027",
              :x_powered_by => "Phusion Passenger 4.0.18",
                :set_cookie => [
        [0] "_session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJTlhOGE0YzJjYTM3YzFmZWNmMjBjMjE5N2VjY2Q2MTQyBjsAVEkiC2xvY2FsZQY7AEYiB2Vu--f3fce07c06be97fad4c54c3df164661260fdb84f; path=/; HttpOnly"
    ],
                      :etag => "\"e7456fe939d9dfd1b8843d5073b3dd0c-gzip\"",
                    :status => "200 OK",
                      :vary => "Accept-Encoding",
          :content_encoding => "gzip",
            :content_length => "397",
              :content_type => "application/json; charset=utf-8"
}
[ INFO 2016-03-28 09:26:58 API] PUT /katello/api/products/13
[DEBUG 2016-03-28 09:26:58 API] Params: {
            "name" => "test_prod",
    "sync_plan_id" => nil
}
[DEBUG 2016-03-28 09:26:58 API] Headers: {}
[DEBUG 2016-03-28 09:27:00 API] Response: {
               "product_content" => [],
             "available_content" => [],
                            "id" => 13,
                         "cp_id" => "1459171288541",
                          "name" => "test_prod",
                         "label" => "test_prod",
                   "description" => nil,
                   "provider_id" => 1,
                  "sync_plan_id" => nil,
                  "sync_summary" => {},
                    "gpg_key_id" => nil,
                        "redhat" => false,
                    "sync_state" => nil,
                     "last_sync" => nil,
               "last_sync_words" => nil,
                  "organization" => {
         "name" => "Default Organization",
        "label" => "Default_Organization",
           "id" => 1
    },
                     "sync_plan" => nil,
                   "sync_status" => {
                   "id" => nil,
           "product_id" => nil,
             "progress" => nil,
              "sync_id" => nil,
                "state" => nil,
            "raw_state" => nil,
           "start_time" => nil,
          "finish_time" => nil,
             "duration" => nil,
         "display_size" => nil,
                 "size" => nil,
           "is_running" => nil,
        "error_details" => nil
    },
              "repository_count" => 0,
                    "created_at" => "2016-03-28 13:21:28 UTC",
                    "updated_at" => "2016-03-28 13:26:58 UTC",
                  "repositories" => [],
                      "provider" => {
        "name" => "Anonymous"
    },
                   "permissions" => {
        "destroy_products" => true,
           "edit_products" => true,
           "sync_products" => true
    },
    "published_content_view_ids" => []
}
[DEBUG 2016-03-28 09:27:00 API] Response headers: {
                      :date => "Mon, 28 Mar 2016 13:26:58 GMT",
                    :server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
           :x_frame_options => "SAMEORIGIN",
          :x_xss_protection => "1; mode=block",
    :x_content_type_options => "nosniff",
           :foreman_version => "1.11.0.7",
       :foreman_api_version => "2",
           :apipie_checksum => "d3a176783bc1fcfffa8746dea2d27b67",
             :cache_control => "max-age=0, private, must-revalidate",
              :x_request_id => "55c04eee-19d7-43be-88c5-d537efbb436e",
                 :x_runtime => "1.857020",
              :x_powered_by => "Phusion Passenger 4.0.18",
                :set_cookie => [
        [0] "request_method=PUT; path=/",
        [1] "_session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJWE2MjQ1NDViNzMyMTAwZjdkODk0ODdjNzViNDc2OWZkBjsAVEkiC2xvY2FsZQY7AEYiB2Vu--a32626a307843bb83b87dbacfe67cae030e28559; path=/; HttpOnly"
    ],
                      :etag => "\"232db7853263a297c168e616c15011f6-gzip\"",
                    :status => "200 OK",
                      :vary => "Accept-Encoding",
          :content_encoding => "gzip",
            :content_length => "421",
              :content_type => "application/json; charset=utf-8"
}
Synchronization plan removed.

Comment 6 Tazim Kolhar 2016-03-28 13:34:34 UTC
]# hammer -u admin -p changeme -v -d product info --organization-id 1 --name test_prod
[ INFO 2016-03-28 09:33:34 Init] Initialization of Hammer CLI (0.5.1.3) has started...
[DEBUG 2016-03-28 09:33:34 Init] Running at ruby 2.2.2-p95
[ INFO 2016-03-28 09:33:34 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2016-03-28 09:33:34 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2016-03-28 09:33:34 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded
[ INFO 2016-03-28 09:33:34 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded
[ INFO 2016-03-28 09:33:34 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_tasks.yml has been loaded
[ INFO 2016-03-28 09:33:34 Init] Configuration from the file /etc/hammer/cli.modules.d/gutterball.yml has been loaded
[ INFO 2016-03-28 09:33:34 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded
[ INFO 2016-03-28 09:33:34 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[DEBUG 2016-03-28 09:33:35 Connection] Registered: foreman
[DEBUG 2016-03-28 09:33:35 API] Global headers: {
        :content_type => "application/json",
              :accept => "application/json;version=2",
    "Accept-Language" => "en"
}
[ INFO 2016-03-28 09:33:35 Modules] Extension module hammer_cli_foreman (0.5.1.2) loaded
[ INFO 2016-03-28 09:33:35 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.3) loaded
[ INFO 2016-03-28 09:33:36 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2016-03-28 09:33:36 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2016-03-28 09:33:36 Modules] Extension module hammer_cli_gutterball (1.0.1) loaded
[ INFO 2016-03-28 09:33:36 Modules] Extension module hammer_cli_import (0.10.23) loaded
[ INFO 2016-03-28 09:33:36 Modules] Extension module hammer_cli_katello (0.0.22.2) loaded
[DEBUG 2016-03-28 09:33:36 Init] Using locale 'en'
[DEBUG 2016-03-28 09:33:36 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.3/locale'
[DEBUG 2016-03-28 09:33:36 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.2/locale'
[DEBUG 2016-03-28 09:33:36 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-03-28 09:33:36 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.2/locale'
[ INFO 2016-03-28 09:33:36 HammerCLI::MainCommand] Called with options: {"option_verbose"=>true, "option_debug"=>true, "option_username"=>"admin", "option_password"=>"***"}
[ INFO 2016-03-28 09:33:36 HammerCLIKatello::Product] Called with options: {}
[ INFO 2016-03-28 09:33:36 HammerCLIKatello::Product::InfoCommand] Called with options: {"option_name"=>"test_prod", "option_organization_id"=>1}
[ INFO 2016-03-28 09:33:36 API] GET /katello/api/organizations/1/products
[DEBUG 2016-03-28 09:33:36 API] Params: {
    "name" => "test_prod"
}
[DEBUG 2016-03-28 09:33:36 API] Headers: {
    :params => {
        "name" => "test_prod"
    }
}
[DEBUG 2016-03-28 09:33:42 API] Response: {
       "total" => 1,
    "subtotal" => 1,
        "page" => 1,
    "per_page" => 20,
       "error" => nil,
      "search" => nil,
        "sort" => {
           "by" => nil,
        "order" => nil
    },
     "results" => [
        [0] {
                          "id" => 13,
                       "cp_id" => "1459171288541",
                        "name" => "test_prod",
                       "label" => "test_prod",
                 "description" => nil,
                 "provider_id" => 1,
                "sync_plan_id" => nil,
                "sync_summary" => {},
                  "gpg_key_id" => nil,
                      "redhat" => false,
                  "sync_state" => nil,
                   "last_sync" => nil,
             "last_sync_words" => nil,
                "organization" => {
                 "name" => "Default Organization",
                "label" => "Default_Organization",
                   "id" => 1
            },
                   "sync_plan" => nil,
                 "sync_status" => {
                           "id" => nil,
                   "product_id" => nil,
                     "progress" => nil,
                      "sync_id" => nil,
                        "state" => nil,
                    "raw_state" => nil,
                   "start_time" => nil,
                  "finish_time" => nil,
                     "duration" => nil,
                 "display_size" => nil,
                         "size" => nil,
                   "is_running" => nil,
                "error_details" => nil
            },
            "repository_count" => 0
        }
    ]
}
[DEBUG 2016-03-28 09:33:42 API] Response headers: {
                      :date => "Mon, 28 Mar 2016 13:33:36 GMT",
                    :server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
           :x_frame_options => "SAMEORIGIN",
          :x_xss_protection => "1; mode=block",
    :x_content_type_options => "nosniff",
           :foreman_version => "1.11.0.7",
       :foreman_api_version => "2",
           :apipie_checksum => "d3a176783bc1fcfffa8746dea2d27b67",
             :cache_control => "max-age=0, private, must-revalidate",
              :x_request_id => "d9ff6293-fcbb-470f-80a0-f3e2bbb824be",
                 :x_runtime => "5.442273",
              :x_powered_by => "Phusion Passenger 4.0.18",
                :set_cookie => [
        [0] "_session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJTJlNTc3NzhiMTcwNzNjOTRhYjQwNTU0ZTU2Yjc5NDQ1BjsAVEkiC2xvY2FsZQY7AEYiB2Vu--ca8cbb1f299e4b96c089ef4a1254797d011b395e; path=/; HttpOnly"
    ],
                      :etag => "\"13f56aa31662afe4211e475963c279f6-gzip\"",
                    :status => "200 OK",
                      :vary => "Accept-Encoding",
          :content_encoding => "gzip",
            :content_length => "341",
              :content_type => "application/json; charset=utf-8"
}
[ INFO 2016-03-28 09:33:42 API] GET /katello/api/products/13
[DEBUG 2016-03-28 09:33:42 API] Params: {}
[DEBUG 2016-03-28 09:33:42 API] Headers: {
    :params => {}
}
[DEBUG 2016-03-28 09:33:42 API] Response: {
               "product_content" => [],
             "available_content" => [],
                            "id" => 13,
                         "cp_id" => "1459171288541",
                          "name" => "test_prod",
                         "label" => "test_prod",
                   "description" => nil,
                   "provider_id" => 1,
                  "sync_plan_id" => nil,
                  "sync_summary" => {},
                    "gpg_key_id" => nil,
                        "redhat" => false,
                    "sync_state" => nil,
                     "last_sync" => nil,
               "last_sync_words" => nil,
                  "organization" => {
         "name" => "Default Organization",
        "label" => "Default_Organization",
           "id" => 1
    },
                     "sync_plan" => nil,
                   "sync_status" => {
                   "id" => nil,
           "product_id" => nil,
             "progress" => nil,
              "sync_id" => nil,
                "state" => nil,
            "raw_state" => nil,
           "start_time" => nil,
          "finish_time" => nil,
             "duration" => nil,
         "display_size" => nil,
                 "size" => nil,
           "is_running" => nil,
        "error_details" => nil
    },
              "repository_count" => 0,
                    "created_at" => "2016-03-28 13:21:28 UTC",
                    "updated_at" => "2016-03-28 13:26:58 UTC",
                  "repositories" => [],
                      "provider" => {
        "name" => "Anonymous"
    },
                   "permissions" => {
        "destroy_products" => true,
           "edit_products" => true,
           "sync_products" => true
    },
    "published_content_view_ids" => []
}
[DEBUG 2016-03-28 09:33:42 API] Response headers: {
                      :date => "Mon, 28 Mar 2016 13:33:42 GMT",
                    :server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
           :x_frame_options => "SAMEORIGIN",
          :x_xss_protection => "1; mode=block",
    :x_content_type_options => "nosniff",
           :foreman_version => "1.11.0.7",
       :foreman_api_version => "2",
           :apipie_checksum => "d3a176783bc1fcfffa8746dea2d27b67",
             :cache_control => "max-age=0, private, must-revalidate",
              :x_request_id => "0fe6c8dc-f590-4773-9990-dca06738a6cd",
                 :x_runtime => "0.417972",
              :x_powered_by => "Phusion Passenger 4.0.18",
                :set_cookie => [
        [0] "_session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJTczZjY1NTRlMGY2MjQ1NWFjMzU2ZDAwZjNmNzJhNzQzBjsAVEkiC2xvY2FsZQY7AEYiB2Vu--d261a51185ecf7e09057f32f6f8e56cf6516b18b; path=/; HttpOnly"
    ],
                      :etag => "\"232db7853263a297c168e616c15011f6-gzip\"",
                    :status => "200 OK",
                      :vary => "Accept-Encoding",
          :content_encoding => "gzip",
            :content_length => "421",
              :content_type => "application/json; charset=utf-8"
}
ID:           13
Name:         test_prod
Label:        test_prod
Description:  
Sync State:   
Sync Plan ID: 
GPG:          
    GPG Key ID: 
    GPG Key:
Organization: Default Organization
Readonly:     
Deletable:    
Content:

Comment 7 Tazim Kolhar 2016-03-28 13:39:47 UTC

Set Sync Plan 
[root@amd-ma78gm-01 ~]# hammer -u admin -p changeme -v -d product set-sync-plan --name test_prod --organization-id 1 --sync-plan="test_sync_plan"
[ INFO 2016-03-28 09:37:21 Init] Initialization of Hammer CLI (0.5.1.3) has started...
[DEBUG 2016-03-28 09:37:21 Init] Running at ruby 2.2.2-p95
[ INFO 2016-03-28 09:37:21 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2016-03-28 09:37:21 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2016-03-28 09:37:21 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded
[ INFO 2016-03-28 09:37:21 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded
[ INFO 2016-03-28 09:37:21 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_tasks.yml has been loaded
[ INFO 2016-03-28 09:37:21 Init] Configuration from the file /etc/hammer/cli.modules.d/gutterball.yml has been loaded
[ INFO 2016-03-28 09:37:21 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded
[ INFO 2016-03-28 09:37:21 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[DEBUG 2016-03-28 09:37:21 Connection] Registered: foreman
[DEBUG 2016-03-28 09:37:21 API] Global headers: {
        :content_type => "application/json",
              :accept => "application/json;version=2",
    "Accept-Language" => "en"
}
[ INFO 2016-03-28 09:37:21 Modules] Extension module hammer_cli_foreman (0.5.1.2) loaded
[ INFO 2016-03-28 09:37:21 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.3) loaded
[ INFO 2016-03-28 09:37:21 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2016-03-28 09:37:21 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2016-03-28 09:37:22 Modules] Extension module hammer_cli_gutterball (1.0.1) loaded
[ INFO 2016-03-28 09:37:22 Modules] Extension module hammer_cli_import (0.10.23) loaded
[ INFO 2016-03-28 09:37:22 Modules] Extension module hammer_cli_katello (0.0.22.2) loaded
[DEBUG 2016-03-28 09:37:22 Init] Using locale 'en'
[DEBUG 2016-03-28 09:37:22 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.3/locale'
[DEBUG 2016-03-28 09:37:22 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.2/locale'
[DEBUG 2016-03-28 09:37:22 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-03-28 09:37:22 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.2/locale'
[ INFO 2016-03-28 09:37:22 HammerCLI::MainCommand] Called with options: {"option_verbose"=>true, "option_debug"=>true, "option_username"=>"admin", "option_password"=>"***"}
[ INFO 2016-03-28 09:37:22 HammerCLIKatello::Product] Called with options: {}
[ INFO 2016-03-28 09:37:22 HammerCLIKatello::Product::SetSyncPlanCommand] Called with options: {"option_name"=>"test_prod", "option_organization_id"=>1, "option_sync_plan_name"=>"test_sync_plan"}
[ INFO 2016-03-28 09:37:22 API] GET /katello/api/organizations/1/sync_plans
[DEBUG 2016-03-28 09:37:22 API] Params: {
    "name" => "test_sync_plan"
}
[DEBUG 2016-03-28 09:37:22 API] Headers: {
    :params => {
        "name" => "test_sync_plan"
    }
}
[DEBUG 2016-03-28 09:37:22 API] Response: {
       "total" => 1,
    "subtotal" => 1,
        "page" => 1,
    "per_page" => 20,
       "error" => nil,
      "search" => nil,
        "sort" => {
           "by" => nil,
        "order" => nil
    },
     "results" => [
        [0] {
                         "id" => 1,
            "organization_id" => 1,
                       "name" => "test_sync_plan",
                "description" => nil,
                  "sync_date" => "2016-03-28 13:19:00 UTC",
                   "interval" => "hourly",
                  "next_sync" => "2016-03-28 14:19:00 UTC",
                 "created_at" => "2016-03-28 13:19:50 UTC",
                 "updated_at" => "2016-03-28 13:19:50 UTC",
                    "enabled" => true,
                   "products" => [],
                "permissions" => {
                   "view_sync_plans" => true,
                   "edit_sync_plans" => true,
                "destroy_sync_plans" => true
            }
        }
    ]
}
[DEBUG 2016-03-28 09:37:22 API] Response headers: {
                      :date => "Mon, 28 Mar 2016 13:37:22 GMT",
                    :server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
           :x_frame_options => "SAMEORIGIN",
          :x_xss_protection => "1; mode=block",
    :x_content_type_options => "nosniff",
           :foreman_version => "1.11.0.7",
       :foreman_api_version => "2",
           :apipie_checksum => "d3a176783bc1fcfffa8746dea2d27b67",
             :cache_control => "max-age=0, private, must-revalidate",
              :x_request_id => "727719e1-0152-426f-b833-67236c7908dc",
                 :x_runtime => "0.164302",
              :x_powered_by => "Phusion Passenger 4.0.18",
                :set_cookie => [
        [0] "_session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJTE3NTEwNDk1NGZhOTYwYTI4MmMzYTg3ZjI4NWYzZWY0BjsAVEkiC2xvY2FsZQY7AEYiB2Vu--2a83258d8a902bda07440192a90302034f8a7817; path=/; HttpOnly"
    ],
                      :etag => "\"53b02300e3f9732790fba4a7a0a283c4-gzip\"",
                    :status => "200 OK",
                      :vary => "Accept-Encoding",
          :content_encoding => "gzip",
            :content_length => "263",
              :content_type => "application/json; charset=utf-8"
}
[ INFO 2016-03-28 09:37:22 API] GET /katello/api/organizations/1/products
[DEBUG 2016-03-28 09:37:22 API] Params: {
    "name" => "test_prod"
}
[DEBUG 2016-03-28 09:37:22 API] Headers: {
    :params => {
        "name" => "test_prod"
    }
}
[DEBUG 2016-03-28 09:37:23 API] Response: {
       "total" => 1,
    "subtotal" => 1,
        "page" => 1,
    "per_page" => 20,
       "error" => nil,
      "search" => nil,
        "sort" => {
           "by" => nil,
        "order" => nil
    },
     "results" => [
        [0] {
                          "id" => 13,
                       "cp_id" => "1459171288541",
                        "name" => "test_prod",
                       "label" => "test_prod",
                 "description" => nil,
                 "provider_id" => 1,
                "sync_plan_id" => nil,
                "sync_summary" => {},
                  "gpg_key_id" => nil,
                      "redhat" => false,
                  "sync_state" => nil,
                   "last_sync" => nil,
             "last_sync_words" => nil,
                "organization" => {
                 "name" => "Default Organization",
                "label" => "Default_Organization",
                   "id" => 1
            },
                   "sync_plan" => nil,
                 "sync_status" => {
                           "id" => nil,
                   "product_id" => nil,
                     "progress" => nil,
                      "sync_id" => nil,
                        "state" => nil,
                    "raw_state" => nil,
                   "start_time" => nil,
                  "finish_time" => nil,
                     "duration" => nil,
                 "display_size" => nil,
                         "size" => nil,
                   "is_running" => nil,
                "error_details" => nil
            },
            "repository_count" => 0
        }
    ]
}
[DEBUG 2016-03-28 09:37:23 API] Response headers: {
                      :date => "Mon, 28 Mar 2016 13:37:22 GMT",
                    :server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
           :x_frame_options => "SAMEORIGIN",
          :x_xss_protection => "1; mode=block",
    :x_content_type_options => "nosniff",
           :foreman_version => "1.11.0.7",
       :foreman_api_version => "2",
           :apipie_checksum => "d3a176783bc1fcfffa8746dea2d27b67",
             :cache_control => "max-age=0, private, must-revalidate",
              :x_request_id => "93622af0-8c36-4d19-9d73-3da825d04f39",
                 :x_runtime => "0.510516",
              :x_powered_by => "Phusion Passenger 4.0.18",
                :set_cookie => [
        [0] "_session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJTlhMWFlZTFjMWY1Zjk4YmU4YmEyZTJjZGJlZWUxODI2BjsAVEkiC2xvY2FsZQY7AEYiB2Vu--69cbd3b6f83e559e49f008a9dd2653ce64fb026d; path=/; HttpOnly"
    ],
                      :etag => "\"13f56aa31662afe4211e475963c279f6-gzip\"",
                    :status => "200 OK",
                      :vary => "Accept-Encoding",
          :content_encoding => "gzip",
            :content_length => "341",
              :content_type => "application/json; charset=utf-8"
}
[ INFO 2016-03-28 09:37:23 API] PUT /katello/api/products/13
[DEBUG 2016-03-28 09:37:23 API] Params: {
    "sync_plan_id" => 1,
            "name" => "test_prod"
}
[DEBUG 2016-03-28 09:37:23 API] Headers: {}
[DEBUG 2016-03-28 09:37:25 API] Response: {
               "product_content" => [],
             "available_content" => [],
                            "id" => 13,
                         "cp_id" => "1459171288541",
                          "name" => "test_prod",
                         "label" => "test_prod",
                   "description" => nil,
                   "provider_id" => 1,
                  "sync_plan_id" => 1,
                  "sync_summary" => {},
                    "gpg_key_id" => nil,
                        "redhat" => false,
                    "sync_state" => nil,
                     "last_sync" => nil,
               "last_sync_words" => nil,
                  "organization" => {
         "name" => "Default Organization",
        "label" => "Default_Organization",
           "id" => 1
    },
                     "sync_plan" => {
               "name" => "test_sync_plan",
        "description" => nil,
          "sync_date" => "2016-03-28 13:19:00 UTC",
           "interval" => "hourly",
          "next_sync" => "2016-03-28 14:19:00 UTC"
    },
                   "sync_status" => {
                   "id" => nil,
           "product_id" => nil,
             "progress" => nil,
              "sync_id" => nil,
                "state" => nil,
            "raw_state" => nil,
           "start_time" => nil,
          "finish_time" => nil,
             "duration" => nil,
         "display_size" => nil,
                 "size" => nil,
           "is_running" => nil,
        "error_details" => nil
    },
              "repository_count" => 0,
                    "created_at" => "2016-03-28 13:21:28 UTC",
                    "updated_at" => "2016-03-28 13:37:23 UTC",
                  "repositories" => [],
                      "provider" => {
        "name" => "Anonymous"
    },
                   "permissions" => {
        "destroy_products" => true,
           "edit_products" => true,
           "sync_products" => true
    },
    "published_content_view_ids" => []
}
[DEBUG 2016-03-28 09:37:25 API] Response headers: {
                      :date => "Mon, 28 Mar 2016 13:37:23 GMT",
                    :server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
           :x_frame_options => "SAMEORIGIN",
          :x_xss_protection => "1; mode=block",
    :x_content_type_options => "nosniff",
           :foreman_version => "1.11.0.7",
       :foreman_api_version => "2",
           :apipie_checksum => "d3a176783bc1fcfffa8746dea2d27b67",
             :cache_control => "max-age=0, private, must-revalidate",
              :x_request_id => "a95d6af3-8d09-439d-83e2-d6ba466b4473",
                 :x_runtime => "1.879548",
              :x_powered_by => "Phusion Passenger 4.0.18",
                :set_cookie => [
        [0] "request_method=PUT; path=/",
        [1] "_session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJWUyMmRiMmQ3NjhjZjZhZmYxZWZjMmZlNDg4MmRjMGMyBjsAVEkiC2xvY2FsZQY7AEYiB2Vu--36f4047f380b6da17ee9bb103d4bfbfd5352df72; path=/; HttpOnly"
    ],
                      :etag => "\"44054b36ec270d03458a8c7589c039e5-gzip\"",
                    :status => "200 OK",
                      :vary => "Accept-Encoding",
          :content_encoding => "gzip",
            :content_length => "463",
              :content_type => "application/json; charset=utf-8"
}
Synchronization plan assigned.


Remove Sync plan 

[root@amd-ma78gm-01 ~]# hammer -u admin -p changeme -v -d product remove-sync-plan --name test_prod --organization-id 1
[ INFO 2016-03-28 09:37:31 Init] Initialization of Hammer CLI (0.5.1.3) has started...
[DEBUG 2016-03-28 09:37:31 Init] Running at ruby 2.2.2-p95
[ INFO 2016-03-28 09:37:31 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2016-03-28 09:37:31 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2016-03-28 09:37:31 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded
[ INFO 2016-03-28 09:37:31 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded
[ INFO 2016-03-28 09:37:31 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_tasks.yml has been loaded
[ INFO 2016-03-28 09:37:31 Init] Configuration from the file /etc/hammer/cli.modules.d/gutterball.yml has been loaded
[ INFO 2016-03-28 09:37:31 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded
[ INFO 2016-03-28 09:37:31 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[DEBUG 2016-03-28 09:37:31 Connection] Registered: foreman
[DEBUG 2016-03-28 09:37:31 API] Global headers: {
        :content_type => "application/json",
              :accept => "application/json;version=2",
    "Accept-Language" => "en"
}
[ INFO 2016-03-28 09:37:31 Modules] Extension module hammer_cli_foreman (0.5.1.2) loaded
[ INFO 2016-03-28 09:37:31 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.3) loaded
[ INFO 2016-03-28 09:37:32 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2016-03-28 09:37:32 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2016-03-28 09:37:32 Modules] Extension module hammer_cli_gutterball (1.0.1) loaded
[ INFO 2016-03-28 09:37:32 Modules] Extension module hammer_cli_import (0.10.23) loaded
[ INFO 2016-03-28 09:37:32 Modules] Extension module hammer_cli_katello (0.0.22.2) loaded
[DEBUG 2016-03-28 09:37:32 Init] Using locale 'en'
[DEBUG 2016-03-28 09:37:32 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.3/locale'
[DEBUG 2016-03-28 09:37:32 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.2/locale'
[DEBUG 2016-03-28 09:37:32 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-03-28 09:37:32 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.2/locale'
[ INFO 2016-03-28 09:37:32 HammerCLI::MainCommand] Called with options: {"option_verbose"=>true, "option_debug"=>true, "option_username"=>"admin", "option_password"=>"***"}
[ INFO 2016-03-28 09:37:32 HammerCLIKatello::Product] Called with options: {}
[ INFO 2016-03-28 09:37:32 HammerCLIKatello::Product::RemoveSyncPlanCommand] Called with options: {"option_name"=>"test_prod", "option_organization_id"=>1}
[ INFO 2016-03-28 09:37:32 API] GET /katello/api/organizations/1/products
[DEBUG 2016-03-28 09:37:32 API] Params: {
    "name" => "test_prod"
}
[DEBUG 2016-03-28 09:37:32 API] Headers: {
    :params => {
        "name" => "test_prod"
    }
}
[DEBUG 2016-03-28 09:37:33 API] Response: {
       "total" => 1,
    "subtotal" => 1,
        "page" => 1,
    "per_page" => 20,
       "error" => nil,
      "search" => nil,
        "sort" => {
           "by" => nil,
        "order" => nil
    },
     "results" => [
        [0] {
                          "id" => 13,
                       "cp_id" => "1459171288541",
                        "name" => "test_prod",
                       "label" => "test_prod",
                 "description" => nil,
                 "provider_id" => 1,
                "sync_plan_id" => 1,
                "sync_summary" => {},
                  "gpg_key_id" => nil,
                      "redhat" => false,
                  "sync_state" => nil,
                   "last_sync" => nil,
             "last_sync_words" => nil,
                "organization" => {
                 "name" => "Default Organization",
                "label" => "Default_Organization",
                   "id" => 1
            },
                   "sync_plan" => {
                       "name" => "test_sync_plan",
                "description" => nil,
                  "sync_date" => "2016-03-28 13:19:00 UTC",
                   "interval" => "hourly",
                  "next_sync" => "2016-03-28 14:19:00 UTC"
            },
                 "sync_status" => {
                           "id" => nil,
                   "product_id" => nil,
                     "progress" => nil,
                      "sync_id" => nil,
                        "state" => nil,
                    "raw_state" => nil,
                   "start_time" => nil,
                  "finish_time" => nil,
                     "duration" => nil,
                 "display_size" => nil,
                         "size" => nil,
                   "is_running" => nil,
                "error_details" => nil
            },
            "repository_count" => 0
        }
    ]
}
[DEBUG 2016-03-28 09:37:33 API] Response headers: {
                      :date => "Mon, 28 Mar 2016 13:37:32 GMT",
                    :server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
           :x_frame_options => "SAMEORIGIN",
          :x_xss_protection => "1; mode=block",
    :x_content_type_options => "nosniff",
           :foreman_version => "1.11.0.7",
       :foreman_api_version => "2",
           :apipie_checksum => "d3a176783bc1fcfffa8746dea2d27b67",
             :cache_control => "max-age=0, private, must-revalidate",
              :x_request_id => "cc707c68-eb16-433d-a7a1-ef35db9685da",
                 :x_runtime => "0.375194",
              :x_powered_by => "Phusion Passenger 4.0.18",
                :set_cookie => [
        [0] "_session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJTUyZTQwYzhjMjRlZDVlY2E5YzM0NDIzMGI0ZmFiMmYwBjsAVEkiC2xvY2FsZQY7AEYiB2Vu--ddfc15233fc49ad001520438510932c19722c436; path=/; HttpOnly"
    ],
                      :etag => "\"e7456fe939d9dfd1b8843d5073b3dd0c-gzip\"",
                    :status => "200 OK",
                      :vary => "Accept-Encoding",
          :content_encoding => "gzip",
            :content_length => "397",
              :content_type => "application/json; charset=utf-8"
}
[ INFO 2016-03-28 09:37:33 API] PUT /katello/api/products/13
[DEBUG 2016-03-28 09:37:33 API] Params: {
            "name" => "test_prod",
    "sync_plan_id" => nil
}
[DEBUG 2016-03-28 09:37:33 API] Headers: {}
[DEBUG 2016-03-28 09:37:33 API] Response: {
               "product_content" => [],
             "available_content" => [],
                            "id" => 13,
                         "cp_id" => "1459171288541",
                          "name" => "test_prod",
                         "label" => "test_prod",
                   "description" => nil,
                   "provider_id" => 1,
                  "sync_plan_id" => nil,
                  "sync_summary" => {},
                    "gpg_key_id" => nil,
                        "redhat" => false,
                    "sync_state" => nil,
                     "last_sync" => nil,
               "last_sync_words" => nil,
                  "organization" => {
         "name" => "Default Organization",
        "label" => "Default_Organization",
           "id" => 1
    },
                     "sync_plan" => nil,
                   "sync_status" => {
                   "id" => nil,
           "product_id" => nil,
             "progress" => nil,
              "sync_id" => nil,
                "state" => nil,
            "raw_state" => nil,
           "start_time" => nil,
          "finish_time" => nil,
             "duration" => nil,
         "display_size" => nil,
                 "size" => nil,
           "is_running" => nil,
        "error_details" => nil
    },
              "repository_count" => 0,
                    "created_at" => "2016-03-28 13:21:28 UTC",
                    "updated_at" => "2016-03-28 13:37:33 UTC",
                  "repositories" => [],
                      "provider" => {
        "name" => "Anonymous"
    },
                   "permissions" => {
        "destroy_products" => true,
           "edit_products" => true,
           "sync_products" => true
    },
    "published_content_view_ids" => []
}
[DEBUG 2016-03-28 09:37:33 API] Response headers: {
                      :date => "Mon, 28 Mar 2016 13:37:33 GMT",
                    :server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
           :x_frame_options => "SAMEORIGIN",
          :x_xss_protection => "1; mode=block",
    :x_content_type_options => "nosniff",
           :foreman_version => "1.11.0.7",
       :foreman_api_version => "2",
           :apipie_checksum => "d3a176783bc1fcfffa8746dea2d27b67",
             :cache_control => "max-age=0, private, must-revalidate",
              :x_request_id => "a20432c5-fbb7-4165-920e-92ba632c3f39",
                 :x_runtime => "0.708748",
              :x_powered_by => "Phusion Passenger 4.0.18",
                :set_cookie => [
        [0] "request_method=PUT; path=/",
        [1] "_session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJWZiYzMwMmY1MTA4MjNlZjc2ZDZjMDNiM2ViMjAyZjIyBjsAVEkiC2xvY2FsZQY7AEYiB2Vu--72a30d5e26092bd6ebb6966c5d07f8d8ae7bf549; path=/; HttpOnly"
    ],
                      :etag => "\"cabe93802a1a38fd4a213dd27ad6c36e-gzip\"",
                    :status => "200 OK",
                      :vary => "Accept-Encoding",
          :content_encoding => "gzip",
            :content_length => "423",
              :content_type => "application/json; charset=utf-8"
}
Synchronization plan removed.


Product Info

[root@amd-ma78gm-01 ~]# hammer -u admin -p changeme -v -d product info --organization-id 1 --name test_prod
[ INFO 2016-03-28 09:37:38 Init] Initialization of Hammer CLI (0.5.1.3) has started...
[DEBUG 2016-03-28 09:37:38 Init] Running at ruby 2.2.2-p95
[ INFO 2016-03-28 09:37:38 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2016-03-28 09:37:38 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2016-03-28 09:37:38 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded
[ INFO 2016-03-28 09:37:38 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded
[ INFO 2016-03-28 09:37:38 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_tasks.yml has been loaded
[ INFO 2016-03-28 09:37:38 Init] Configuration from the file /etc/hammer/cli.modules.d/gutterball.yml has been loaded
[ INFO 2016-03-28 09:37:38 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded
[ INFO 2016-03-28 09:37:38 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[DEBUG 2016-03-28 09:37:38 Connection] Registered: foreman
[DEBUG 2016-03-28 09:37:38 API] Global headers: {
        :content_type => "application/json",
              :accept => "application/json;version=2",
    "Accept-Language" => "en"
}
[ INFO 2016-03-28 09:37:38 Modules] Extension module hammer_cli_foreman (0.5.1.2) loaded
[ INFO 2016-03-28 09:37:38 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.3) loaded
[ INFO 2016-03-28 09:37:39 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2016-03-28 09:37:39 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2016-03-28 09:37:39 Modules] Extension module hammer_cli_gutterball (1.0.1) loaded
[ INFO 2016-03-28 09:37:39 Modules] Extension module hammer_cli_import (0.10.23) loaded
[ INFO 2016-03-28 09:37:39 Modules] Extension module hammer_cli_katello (0.0.22.2) loaded
[DEBUG 2016-03-28 09:37:39 Init] Using locale 'en'
[DEBUG 2016-03-28 09:37:39 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.5.1.3/locale'
[DEBUG 2016-03-28 09:37:39 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.2/locale'
[DEBUG 2016-03-28 09:37:39 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-03-28 09:37:39 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.2/locale'
[ INFO 2016-03-28 09:37:39 HammerCLI::MainCommand] Called with options: {"option_verbose"=>true, "option_debug"=>true, "option_username"=>"admin", "option_password"=>"***"}
[ INFO 2016-03-28 09:37:40 HammerCLIKatello::Product] Called with options: {}
[ INFO 2016-03-28 09:37:40 HammerCLIKatello::Product::InfoCommand] Called with options: {"option_name"=>"test_prod", "option_organization_id"=>1}
[ INFO 2016-03-28 09:37:40 API] GET /katello/api/organizations/1/products
[DEBUG 2016-03-28 09:37:40 API] Params: {
    "name" => "test_prod"
}
[DEBUG 2016-03-28 09:37:40 API] Headers: {
    :params => {
        "name" => "test_prod"
    }
}
[DEBUG 2016-03-28 09:37:40 API] Response: {
       "total" => 1,
    "subtotal" => 1,
        "page" => 1,
    "per_page" => 20,
       "error" => nil,
      "search" => nil,
        "sort" => {
           "by" => nil,
        "order" => nil
    },
     "results" => [
        [0] {
                          "id" => 13,
                       "cp_id" => "1459171288541",
                        "name" => "test_prod",
                       "label" => "test_prod",
                 "description" => nil,
                 "provider_id" => 1,
                "sync_plan_id" => nil,
                "sync_summary" => {},
                  "gpg_key_id" => nil,
                      "redhat" => false,
                  "sync_state" => nil,
                   "last_sync" => nil,
             "last_sync_words" => nil,
                "organization" => {
                 "name" => "Default Organization",
                "label" => "Default_Organization",
                   "id" => 1
            },
                   "sync_plan" => nil,
                 "sync_status" => {
                           "id" => nil,
                   "product_id" => nil,
                     "progress" => nil,
                      "sync_id" => nil,
                        "state" => nil,
                    "raw_state" => nil,
                   "start_time" => nil,
                  "finish_time" => nil,
                     "duration" => nil,
                 "display_size" => nil,
                         "size" => nil,
                   "is_running" => nil,
                "error_details" => nil
            },
            "repository_count" => 0
        }
    ]
}
[DEBUG 2016-03-28 09:37:40 API] Response headers: {
                      :date => "Mon, 28 Mar 2016 13:37:40 GMT",
                    :server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
           :x_frame_options => "SAMEORIGIN",
          :x_xss_protection => "1; mode=block",
    :x_content_type_options => "nosniff",
           :foreman_version => "1.11.0.7",
       :foreman_api_version => "2",
           :apipie_checksum => "d3a176783bc1fcfffa8746dea2d27b67",
             :cache_control => "max-age=0, private, must-revalidate",
              :x_request_id => "b2e1503a-d102-4fde-9123-3bfe520f4e25",
                 :x_runtime => "0.297694",
              :x_powered_by => "Phusion Passenger 4.0.18",
                :set_cookie => [
        [0] "_session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJTAzMTk2NzY3NGZlZDViMDZmNGYwODdkZjI1MWYzNzUwBjsAVEkiC2xvY2FsZQY7AEYiB2Vu--7988bb8eb94b21c26a96dda9492a23e1c3ddf127; path=/; HttpOnly"
    ],
                      :etag => "\"13f56aa31662afe4211e475963c279f6-gzip\"",
                    :status => "200 OK",
                      :vary => "Accept-Encoding",
          :content_encoding => "gzip",
            :content_length => "341",
              :content_type => "application/json; charset=utf-8"
}
[ INFO 2016-03-28 09:37:40 API] GET /katello/api/products/13
[DEBUG 2016-03-28 09:37:40 API] Params: {}
[DEBUG 2016-03-28 09:37:40 API] Headers: {
    :params => {}
}
[DEBUG 2016-03-28 09:37:40 API] Response: {
               "product_content" => [],
             "available_content" => [],
                            "id" => 13,
                         "cp_id" => "1459171288541",
                          "name" => "test_prod",
                         "label" => "test_prod",
                   "description" => nil,
                   "provider_id" => 1,
                  "sync_plan_id" => nil,
                  "sync_summary" => {},
                    "gpg_key_id" => nil,
                        "redhat" => false,
                    "sync_state" => nil,
                     "last_sync" => nil,
               "last_sync_words" => nil,
                  "organization" => {
         "name" => "Default Organization",
        "label" => "Default_Organization",
           "id" => 1
    },
                     "sync_plan" => nil,
                   "sync_status" => {
                   "id" => nil,
           "product_id" => nil,
             "progress" => nil,
              "sync_id" => nil,
                "state" => nil,
            "raw_state" => nil,
           "start_time" => nil,
          "finish_time" => nil,
             "duration" => nil,
         "display_size" => nil,
                 "size" => nil,
           "is_running" => nil,
        "error_details" => nil
    },
              "repository_count" => 0,
                    "created_at" => "2016-03-28 13:21:28 UTC",
                    "updated_at" => "2016-03-28 13:37:33 UTC",
                  "repositories" => [],
                      "provider" => {
        "name" => "Anonymous"
    },
                   "permissions" => {
        "destroy_products" => true,
           "edit_products" => true,
           "sync_products" => true
    },
    "published_content_view_ids" => []
}
[DEBUG 2016-03-28 09:37:40 API] Response headers: {
                      :date => "Mon, 28 Mar 2016 13:37:40 GMT",
                    :server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
           :x_frame_options => "SAMEORIGIN",
          :x_xss_protection => "1; mode=block",
    :x_content_type_options => "nosniff",
           :foreman_version => "1.11.0.7",
       :foreman_api_version => "2",
           :apipie_checksum => "d3a176783bc1fcfffa8746dea2d27b67",
             :cache_control => "max-age=0, private, must-revalidate",
              :x_request_id => "122b04c1-3656-4ceb-9262-9d7e7ae0dedb",
                 :x_runtime => "0.338224",
              :x_powered_by => "Phusion Passenger 4.0.18",
                :set_cookie => [
        [0] "_session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJWJhNmI2MGIyMDM5ZGRjNWJkNGRjODE3ZTA4MTAyNzE2BjsAVEkiC2xvY2FsZQY7AEYiB2Vu--ad5dfa37bdf1cad5e73942d83f84e7522a9aa4d8; path=/; HttpOnly"
    ],
                      :etag => "\"cabe93802a1a38fd4a213dd27ad6c36e-gzip\"",
                    :status => "200 OK",
                      :vary => "Accept-Encoding",
          :content_encoding => "gzip",
            :content_length => "423",
              :content_type => "application/json; charset=utf-8"
}
ID:           13
Name:         test_prod
Label:        test_prod
Description:  
Sync State:   
Sync Plan ID: 
GPG:          
    GPG Key ID: 
    GPG Key:
Organization: Default Organization
Readonly:     
Deletable:    
Content:

Comment 8 Tazim Kolhar 2016-03-28 14:03:36 UTC
# hammer -u admin -p changeme product create --name test_prod2 --organization-id 1
Product created


# hammer -u admin -p changeme product info --organization-id 1 --name test_prod2
ID:           14
Name:         test_prod2
Label:        test_prod2
Description:  
Sync State:   
Sync Plan ID: 
GPG:          
    GPG Key ID: 
    GPG Key:
Organization: Default Organization
Readonly:     
Deletable:    
Content:


# hammer -u admin -p changeme product set-sync-plan --name test_prod --organization-id 1 --sync-plan="test_sync_plan"
Synchronization plan assigned.


# hammer -u admin -p changeme product info --organization-id 1 --name test_prod2
ID:           14
Name:         test_prod2
Label:        test_prod2
Description:  
Sync State:   
Sync Plan ID: 
GPG:          
    GPG Key ID: 
    GPG Key:
Organization: Default Organization
Readonly:     
Deletable:    
Content:

# hammer -u admin -p changeme product remove-sync-plan --name test_prod --organization-id 1
Synchronization plan removed.


# hammer -u admin -p changeme product info --organization-id 1 --name test_prod2
ID:           14
Name:         test_prod2
Label:        test_prod2
Description:  
Sync State:   
Sync Plan ID: 
GPG:          
    GPG Key ID: 
    GPG Key:
Organization: Default Organization
Readonly:     
Deletable:    
Content:

Comment 9 Og Maciel 2016-03-28 14:19:47 UTC
This should be re-tested as I believe that it does not pass verification since sync plans cannot be added by name (need to check if one can add/remove by ID as well) as shown by the info command.

Comment 10 Tazim Kolhar 2016-03-28 14:41:43 UTC
FAILEDQA:

# rpm -qa | grep foreman
tfm-rubygem-hammer_cli_foreman_tasks-0.0.10-2.el7sat.noarch
tfm-rubygem-foreman-tasks-0.7.14.1-1.el7sat.noarch
foreman-libvirt-1.11.0.7-1.el7sat.noarch
tfm-rubygem-foreman_gutterball-0.0.1-6.el7sat.noarch
foreman-discovery-image-3.0.5-3.el7sat.noarch
foreman-selinux-1.11.0-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman-0.5.1.2-1.el7sat.noarch
foreman-gce-1.11.0.7-1.el7sat.noarch
foreman-debug-1.11.0.7-1.el7sat.noarch
tfm-rubygem-foreman_theme_satellite-0.1.3-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_bootdisk-0.1.3-4.el7sat.noarch
foreman-1.11.0.7-1.el7sat.noarch
tfm-rubygem-foreman_bootdisk-6.1.0-1.el7sat.noarch
foreman-postgresql-1.11.0.7-1.el7sat.noarch
amd-ma78gm-01.rhts.eng.bos.redhat.com-foreman-client-1.0-1.noarch
amd-ma78gm-01.rhts.eng.bos.redhat.com-foreman-proxy-1.0-1.noarch
foreman-proxy-1.11.0.2-1.el7sat.noarch
foreman-installer-1.11.0.0-1.el7sat.noarch
foreman-compute-1.11.0.7-1.el7sat.noarch
foreman-ovirt-1.11.0.7-1.el7sat.noarch
tfm-rubygem-foreman-redhat_access-1.0.1-2.el7sat.noarch
tfm-rubygem-foreman_discovery-5.0.0.2-1.el7sat.noarch
foreman-vmware-1.11.0.7-1.el7sat.noarch
foreman-installer-katello-3.0.0.9-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_docker-0.0.4-1.el7sat.noarch
tfm-rubygem-foreman_docker-2.0.1.1-1.el7sat.noarch
tfm-rubygem-foreman_hooks-0.3.9-2.el7sat.noarch
amd-ma78gm-01.rhts.eng.bos.redhat.com-foreman-proxy-client-1.0-1.noarch
tfm-rubygem-foreman_remote_execution-0.3.0.2-1.el7sat.noarch
tfm-rubygem-foreman_openscap-0.5.3.2-1.el7sat.noarch


Steps:

# hammer -u admin -p changeme product create --name test_prod2 --organization-id 1
Product created


# hammer -u admin -p changeme product info --organization-id 1 --name test_prod2
ID:           14
Name:         test_prod2
Label:        test_prod2
Description:  
Sync State:   
Sync Plan ID: 
GPG:          
    GPG Key ID: 
    GPG Key:
Organization: Default Organization
Readonly:     
Deletable:    
Content:


# hammer -u admin -p changeme product set-sync-plan --name test_prod --organization-id 1 --sync-plan="test_sync_plan"
Synchronization plan assigned.


# hammer -u admin -p changeme product info --organization-id 1 --name test_prod2
ID:           14
Name:         test_prod2
Label:        test_prod2
Description:  
Sync State:   
Sync Plan ID: 
GPG:          
    GPG Key ID: 
    GPG Key:
Organization: Default Organization
Readonly:     
Deletable:    
Content:

# hammer -u admin -p changeme product remove-sync-plan --name test_prod --organization-id 1
Synchronization plan removed.


# hammer -u admin -p changeme product info --organization-id 1 --name test_prod2
ID:           14
Name:         test_prod2
Label:        test_prod2
Description:  
Sync State:   
Sync Plan ID: 
GPG:          
    GPG Key ID: 
    GPG Key:
Organization: Default Organization
Readonly:     
Deletable:    
Content:

The UI also does not show sync plan to be added

However, when we try to add the product by id it works:

# hammer -u admin -p changeme product create --name test_prod3 --organization-id 1
Product created


# hammer -u admin -p changeme product set-sync-plan --name test_prod3 --organization-id 1 --sync-plan-id 1
Synchronization plan assigned.

# hammer -u admin -p changeme product info --name test_prod3 --organization-id 1
ID:           15
Name:         test_prod3
Label:        test_prod3
Description:  
Sync State:   
Sync Plan ID: 1
GPG:          
    GPG Key ID: 
    GPG Key:
Organization: Default Organization
Readonly:     
Deletable:    
Content:

# hammer -u admin -p changeme product remove-sync-plan --name test_prod3 --organization-id 1
Synchronization plan removed.


# hammer -u admin -p changeme product info --name test_prod3 --organization-id 1
ID:           15
Name:         test_prod3
Label:        test_prod3
Description:  
Sync State:   
Sync Plan ID: 
GPG:          
    GPG Key ID: 
    GPG Key:
Organization: Default Organization
Readonly:     
Deletable:    
Content:

Comment 11 Tazim Kolhar 2016-03-28 14:44:24 UTC
Created attachment 1140891 [details]
sync plan not added

Comment 13 Bryan Kearney 2017-01-05 19:15:34 UTC
This is an older bug which I do not envision being fixed in the near term. I am closing this out. If you belive doing so is an issue, please feel free to re-open and provide additional business information. Thank you.


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