Bug #12058

Configuration of inner hash structures overwrite the whole hash

Added by Tomáš Strachota almost 2 years ago. Updated almost 2 years ago.

Status:New
Priority:Normal
Assigned To:-
Category:-
Target version:0.0.2
Difficulty: Pull request:
Bugzilla link:

Description

Having a stack with following host task:

    {
      "name": "deploy8",
      "id": 9,
      "configuration": {
        "host1": {
          "class": "Host::Managed",
          "params": {
            "name": "deployed1",
            "organization_id": 2,
            "location_id": 1,
            "architecture_id": 1,
            "operatingsystem_id": 1,
            "medium_id": 1,
            "ptable_id": 54,
            "host_root_pass": "administrator",
            "interfaces_attributes": {
              "0": {
                "type": "Nic::Managed",
                "mac": "11:22:33:44:44:44",
                "ip": "192.168.200.222",
                "domain_id": 1
              }
            }
          },
          "_type": "task",
          "_name": "CreateResource" 
        }
      },
      "errors": {
        "host1": [
          "Mac can't be blank",
          "Domain can't be blank",
          "Interfaces.domain can't find domain with this id" 
        ]
      }
    }

when you try to provide missing primary flag for the network interface by sending this config structure:

PUT to /deployments/:id/configuration
{
  "values": {
    "host1": {
      "params": {
        "interfaces_attributes": {
          "0":{
            "primary": true
          }
        }
      }
    }
  }
}

the primary: true pair overwrites the existing values defined in the stack. Instead it should only set the primary flag and leave the rest untouched.

History

#1 Updated by Tomáš Strachota almost 2 years ago

  • Target version set to 0.0.2

Also available in: Atom PDF