Bug 1582272

Summary: deep merge broken when using facts in hash
Product: Red Hat Satellite Reporter: Taft Sanders <tasander>
Component: PuppetAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WONTFIX QA Contact: Peter Ondrejka <pondrejk>
Severity: high Docs Contact:
Priority: high    
Version: 6.3.1CC: andrew.schofield, kabbott, oprazak
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-15 20:30:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Taft Sanders 2018-05-24 16:58:01 UTC
Description of problem:
When 'merge overrides' is not selected then this works. When I switch on the 'merge overrides' option, then this fails with the below mentioned back traces. As mentioned in the below notes it looks like when erb is inserted then this is added as a string into the matcher (as evidenced by the API call):


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

How reproducible:
Always

Steps to Reproduce:
1.
2.
3.

Actual results:
https://testsatellite.example.com/api/v2/smart_class_parameters/349/override_values) this means the deep_merge is going to fail to merge:

{
    "total": 1,
    "subtotal": 1,
    "page": 1,
    "per_page": 30,
    "search": null,
    "sort": {
        "by": null,
        "order": null
    },
    "results": [
        {
            "created_at": "2018-05-10 20:16:53 UTC",
            "updated_at": "2018-05-10 20:18:39 UTC",
            "id": 6923,
            "match": "fqdn=testclient.example.com",
            "value": "test:\r\n  value: <%= @host.facts['memorysize_mb'] %>\r\n",
            "omit": false,
            "use_puppet_default": false
        }
    ]
}

With no erb this is stored in its correct type (hash):

https://testsatellite.example.com/api/v2/smart_class_parameters/349/override_values

{
    "total": 1,
    "subtotal": 1,
    "page": 1,
    "per_page": 30,
    "search": null,
    "sort": {
        "by": null,
        "order": null
    },
    "results": [
        {
            "created_at": "2018-05-10 20:16:53 UTC",
            "updated_at": "2018-05-10 20:16:53 UTC",
            "id": 6923,
            "match": "fqdn=testclient.example.com",
            "value": {
                "test": {
                    "value": 24
                }
            },
            "omit": false,
            "use_puppet_default": false
        }
    ]
}
Expected results:
 with erb enabled, facts would be stored as a hash and not a string

Additional info:
http://projects.theforeman.org/issues/9949

Comment 2 Ondřej Pražák 2019-01-16 08:58:52 UTC
Connecting redmine issue http://projects.theforeman.org/issues/9949 from this bug

Comment 3 Bryan Kearney 2019-12-03 16:35:02 UTC
The Satellite Team is attempting to provide an accurate backlog of bugzilla requests which we feel will be resolved in the next few releases. We do not believe this bugzilla will meet that criteria, and have plans to close it out in 1 month. This is not a reflection on the validity of the request, but a reflection of the many priorities for the product. If you have any concerns about this, feel free to contact Red Hat Technical Support or your account team. If we do not hear from you, we will close this bug out. Thank you.

Comment 4 Bryan Kearney 2020-01-15 20:30:53 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this, please do not reopen. Instead, feel free to contact Red Hat Technical Support. Thank you.