Project

General

Profile

Bug #9240

Updated by Dominic Cleal almost 10 years ago

We like to use the puppetlabs/lvm module via Foreman api. 

 Adding this hash via WebUI works fine: 

 <pre> 
 ###################################### 
 testvg: 
   physical_volumes: 
   - /dev/sdb 
   - /dev/sdc 
   logical_volumes: 
     test1: 
       size: 128M 
       mountpath: /opt/test1 
     test2: 
       size: 128M 
       mountpath: /opt/test2 
     test3: 
       size: 128M 
       mountpath: /opt/test3 
     test4: 
       size: 128M 
       mountpath: /opt/test4 
     test5: 
       size: 128M 
       mountpath: /opt/test5 
 ###################################### 
 </pre> 

 When using the API with this rest call: 

 <pre> 
 curl -k -u username:password -H "Accept: version=2,application/json" -H "Content-Type: application/json" -X POST -d '{"override_value": {"match": "fqdn=server.example.com","value": {"testvg":{"physical_volumes":["/dev/sdb","/dev/sdc"],"logical_volumes":{"test1":{"size":"128M","mountpath":"/opt/test1"},"test2":{"size":"128M","mountpath":"/opt/test2"},"test3":{"size":"128M","mountpath":"/opt/test3"},"test4":{"size":"128M","mountpath":"/opt/test4"},"test5":{"size":"128M","mountpath":"/opt/test5"}}}}}}' https://foreman.example.com/api/smart_class_parameters/386/override_values 
 </pre> 

 The call is accepted, but the entry in Foreman looks like this: 

 <pre> 
 ###################################### 
 --- !ruby/hash:ActiveSupport::HashWithIndifferentAccess 
 testvg: !ruby/hash:ActiveSupport::HashWithIndifferentAccess 
   physical_volumes: 
   - /dev/sdb 
   - /dev/sdc 
   logical_volumes: !ruby/hash:ActiveSupport::HashWithIndifferentAccess 
     test1: !ruby/hash:ActiveSupport::HashWithIndifferentAccess 
       size: 128M 
       mountpath: /opt/test1 
     test2: !ruby/hash:ActiveSupport::HashWithIndifferentAccess 
       size: 128M 
       mountpath: /opt/test2 
     test3: !ruby/hash:ActiveSupport::HashWithIndifferentAccess 
       size: 128M 
       mountpath: /opt/test3 
     test4: !ruby/hash:ActiveSupport::HashWithIndifferentAccess 
       size: 128M 
       mountpath: /opt/test4 
     test5: !ruby/hash:ActiveSupport::HashWithIndifferentAccess 
       size: 128M 
       mountpath: /opt/test5 
 ###################################### 
 </pre>

Back