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 1375881 - Inconsistent name for variable_type in GET/PUT /api/smart_variables/:id
Summary: Inconsistent name for variable_type in GET/PUT /api/smart_variables/:id
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Smart Variables
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: Unspecified
Assignee: orabin
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-14 07:22 UTC by Stanislav Tkachenko
Modified: 2019-04-01 20:27 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 16:51:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 17153 0 None None None 2016-11-01 09:19:09 UTC

Description Stanislav Tkachenko 2016-09-14 07:22:15 UTC
Description of problem:
According to apidoc for Smart Variables (see https://sat.example.com/apidoc/v2/smart_variables.html) it is possible to specify variable_type while create/update Smart Variable. However, it is not possible to read it back.

> Making HTTP GET request to https://example.com/api/v2/smart_variables/231 with options {'verify': False, 'auth': ('admin', 'changeme'), 'headers': {'content-type': 'application/json'}} and no data.
> Received HTTP 200 response: 
{
    "description":"test",
    "parameter_type":null,
    "default_value":null,
    "hidden_value?":false,
    "hidden_value":"*****",
    "validator_type":null,
    "validator_rule":null,
    "override_value_order":"fqdn\nhostgroup\nos\ndomain",
    "override_values_count":0,
    "merge_overrides":false,
    "merge_default":false,
    "avoid_duplicates":false,
    "puppetclass_id":2,
    "puppetclass_name":"ntp",
    "created_at":"2016-09-14 06:18:00 UTC",
    "updated_at":"2016-09-14 06:21:58 UTC",
    "variable":"𧍾𨨑𢸁嵒𡱓𩳊饄𣲓𨞞㘮𡓤𡾪螀퓔𩕕𡰿𪔧𠽍抑ሙ𪷐𤽭",
    "id":231,
    "override_values":[]
}

Version-Release number of selected component (if applicable):
Satellite 6.2.2 (build 09/12/2016)

How reproducible:
Always

Steps to Reproduce:
1. Create Smart Variable
2. Perform GET request to show smart variable
3. Check if smart_variable[variable_type] is present

Actual results:
smart_variable[variable_type] is missing

Expected results:


Additional info:
Environment info:
>       OS: redhat
>  RELEASE: Red Hat Enterprise Linux Server release 7.2 (Maipo)
>  FOREMAN: 1.11.0.53
>     RUBY: ruby 2.0.0p598 (2014-11-13) [x86_64-linux]
>   PUPPET: 3.8.6
>  DENIALS: 0

Installed packages:
* candlepin-0.9.54.7-1.el7.noarch
* candlepin-selinux-0.9.54.7-1.el7.noarch
* foreman-1.11.0.53-1.el7sat.noarch
* foreman-compute-1.11.0.53-1.el7sat.noarch
* foreman-debug-1.11.0.53-1.el7sat.noarch
* foreman-discovery-image-3.1.1-17.el7sat.noarch
* foreman-ec2-1.11.0.53-1.el7sat.noarch
* foreman-gce-1.11.0.53-1.el7sat.noarch
* foreman-installer-1.11.0.10-1.el7sat.noarch
* foreman-installer-katello-3.0.0.57-1.el7sat.noarch
* foreman-libvirt-1.11.0.53-1.el7sat.noarch
* foreman-openstack-1.11.0.53-1.el7sat.noarch
* foreman-ovirt-1.11.0.53-1.el7sat.noarch
* foreman-postgresql-1.11.0.53-1.el7sat.noarch
* foreman-proxy-1.11.0.6-1.el7sat.noarch
* foreman-rackspace-1.11.0.53-1.el7sat.noarch
* foreman-selinux-1.11.0.2-1.el7sat.noarch
* foreman-vmware-1.11.0.53-1.el7sat.noarch
* katello-3.0.0-12.el7sat.noarch
* katello-certs-tools-2.4.0-1.el7sat.noarch
* katello-client-bootstrap-1.1.0-2.el7sat.noarch
* katello-common-3.0.0-12.el7sat.noarch
* katello-debug-3.0.0-12.el7sat.noarch
* katello-default-ca-1.0-1.noarch
* katello-installer-base-3.0.0.57-1.el7sat.noarch
* katello-selinux-3.0.1.2-1.el7sat.noarch
* katello-server-ca-1.0-1.noarch
* katello-service-3.0.0-12.el7sat.noarch
* openldap-2.4.40-9.el7_2.x86_64
* pulp-client-1.0-1.noarch
* pulp-docker-plugins-2.0.1.1-1.el7sat.noarch
* pulp-katello-1.0.1-1.el7sat.noarch
* pulp-ostree-plugins-1.1.1-2.el7sat.noarch
* pulp-puppet-plugins-2.8.3.3-1.el7sat.noarch
* pulp-puppet-tools-2.8.3.3-1.el7sat.noarch
* pulp-rpm-plugins-2.8.3.5-1.el7sat.noarch
* pulp-selinux-2.8.3.4-1.el7sat.noarch
* pulp-server-2.8.3.4-1.el7sat.noarch
* python-ldap-2.4.15-2.el7.x86_64
* tfm-rubygem-ldap_fluff-0.4.3-1.el7sat.noarch
* tfm-rubygem-net-ldap-0.13.0-1.el7sat.noarch

Comment 2 orabin 2016-11-01 08:32:24 UTC
parameter_type is the value of what you sent in variable_type

Comment 3 Bryan Kearney 2016-11-01 16:06:24 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17153 has been resolved.

Comment 4 Stanislav Tkachenko 2017-01-20 18:01:37 UTC
Verified on Satellite 6.3 Snap 8 / Foreman 13.2

GET https://sat6.com/api/v2/smart_variables/4421

{
  "description": null,
  "parameter_type": "string",
  "variable_type": "string",
...
  "id": 4421,
}

Comment 5 Satellite Program 2018-02-21 16:51:07 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
> 
> For information on the advisory, and where to find the updated files, follow the link below.
> 
> If the solution does not work for you, open a new bug report.
> 
> https://access.redhat.com/errata/RHSA-2018:0336


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