Move away from 'text_list' to 'textarea'

text_list type is not supported by stable version of fuel plugin builder
(plugin build process fails due to validation check).

Example value produces multiple text fields for each character written
to 'value' which cannot be removed or edited.

Change-Id: Ief60cef42d10d48bc61d77cd9ca21424679002fe
This commit is contained in:
Igor Zinovik 2016-09-12 11:13:11 +03:00
parent fcaa0cc3e5
commit a8caf3e740
4 changed files with 12 additions and 18 deletions

View File

@ -5,7 +5,7 @@ EOS
) do |args|
pnics = args[0]
vtep_interfaces = []
pnics.each do |pnic_pair|
pnics.each_line do |pnic_pair|
device,uplink = pnic_pair.split(':')
vtep_interfaces.push(device.strip)
end

View File

@ -139,11 +139,7 @@ Puppet::Type.type(:nsxt_create_transport_node).provide(:nsxt_create_transport_no
def create_pnics_array(pnics)
result_pnic_pairs = []
# https://projects.puppetlabs.com/issues/9850
if not pnics.instance_of? Array
pnics = [pnics]
end
pnics.each do |pnic_pair|
pnics.each_line do |pnic_pair|
device,uplink = pnic_pair.split(':')
result_pnic_pairs.push({'device_name' => device.strip, 'uplink_name' => uplink.strip})
end

View File

@ -38,8 +38,8 @@ Puppet::Type.newtype(:nsxt_create_transport_node) do
desc 'Ids of Uplink HostSwitch profiles to be associated with this HostSwitch.'
end
newparam(:pnics, :array_matching => :all) do
desc 'Array of string with "device_name : uplink_name" pairs.'
newparam(:pnics) do
desc 'Multiline string with "device_name : uplink_name" pairs.'
end
newparam(:static_ip_pool_id) do

View File

@ -94,12 +94,11 @@ attributes:
error: 'Enter IP pool ID'
type: "text"
controller_pnics_pairs:
value:
- 'enp0s1:uplink-1'
label: 'Colon separated pnics pairs for controller nodes'
min: 1
value: "enp0s1:uplink-1"
label: 'STT pnic:uplink pairs for openstack controllers'
description: 'Colon separated pnics pairs for controllers, each pair on separate line'
weight: 55
type: "text_list"
type: "textarea"
compute_ip_pool_uuid:
value: ''
label: 'IP pool ID for compute VTEPs'
@ -109,12 +108,11 @@ attributes:
error: 'Enter IP pool ID'
type: "text"
compute_pnics_pairs:
value:
- 'enp0s1:uplink-1'
label: 'Colon separated pnics pairs for compute nodes'
min: 1
value: "enp0s1:uplink-1"
label: 'STT pnic:uplink pairs for openstack computes'
description: 'Colon separated pnics pairs for compute nodes, each pair on separate line'
weight: 65
type: "text_list"
type: "textarea"
floating_ip_range:
value: ''
label: 'Floating IP range'