From bcbefb2833929d7c002c00fedf535a35935a1b96 Mon Sep 17 00:00:00 2001 From: Ian Southam Date: Tue, 29 Jul 2014 17:28:01 +0200 Subject: [PATCH] Changed from camelCase to json_case --- .../debian/config/etc/init.d/cloud-early-config | 4 ++-- .../var/chef/cookbooks/csip/providers/device.rb | 8 ++++---- .../var/chef/cookbooks/csip/recipes/default.rb | 14 ++++++++++---- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/systemvm/patches/debian/config/etc/init.d/cloud-early-config b/systemvm/patches/debian/config/etc/init.d/cloud-early-config index 7d22ee71c19..369ead814f4 100755 --- a/systemvm/patches/debian/config/etc/init.d/cloud-early-config +++ b/systemvm/patches/debian/config/etc/init.d/cloud-early-config @@ -1339,7 +1339,7 @@ VM_PASSWORD="" CHEF_TMP_FILE=/tmp/cmdline.json COMMA="\t" echo -e "{\n\"id\": \"cmdline\"," > ${CHEF_TMP_FILE} -echo -e "{\n\"cmd_line\": {" > ${CHEF_TMP_FILE} +echo -e "{\n\"cmdline\": {" > ${CHEF_TMP_FILE} for i in $CMDLINE do @@ -1488,7 +1488,7 @@ done echo -e "\n\t}\n}" >> ${CHEF_TMP_FILE} if [ "$TYPE" != "unknown" ] then - mv ${CHEF_TMP_FILE} /var/chef/data_bags/vr/cmd_line.json + mv ${CHEF_TMP_FILE} /var/chef/data_bags/vr/cmdline.json fi [ $ETH0_IP ] && LOCAL_ADDRS=$ETH0_IP diff --git a/systemvm/patches/debian/config/var/chef/cookbooks/csip/providers/device.rb b/systemvm/patches/debian/config/var/chef/cookbooks/csip/providers/device.rb index 9afbb088fde..2dc73bc1c57 100755 --- a/systemvm/patches/debian/config/var/chef/cookbooks/csip/providers/device.rb +++ b/systemvm/patches/debian/config/var/chef/cookbooks/csip/providers/device.rb @@ -28,7 +28,7 @@ def load_current_resource @current_resource.object(@new_resource.object) @current_resource.exists = false if new_resource.cidrs.nil? - @current_resource.cidrs(new_resource.object['publicIp'] + '/' + IPAddr.new( new_resource.object['vlanNetmask']).to_i.to_s(2).count("1").to_s) + @current_resource.cidrs(new_resource.object['public_ip'] + '/' + IPAddr.new( new_resource.object['vlan_netmask']).to_i.to_s(2).count("1").to_s) else @current_resource.cidrs(@new_resource.cidrs) end @@ -66,13 +66,13 @@ def plumbDevice end end if ! current_resource.contrack - if ! execute("iptables -t mangle -A PREROUTING -i #{current_resource.device} -m state --state NEW -j CONNMARK --set-mark #{current_resource.object['nicDevId']}") + if ! execute("iptables -t mangle -A PREROUTING -i #{current_resource.device} -m state --state NEW -j CONNMARK --set-mark #{current_resource.object['nic_dev_id']}") Chef::Log.error "#{ @new_resource.device } failed to set set conmark" return false end end - execute("arping -c 1 -I #{current_resource.device} -A -U -s #{current_resource.object['publicIp']} #{current_resource.object['publicIp']}") - execute("arping -c 1 -I #{current_resource.device} -A -U -s #{current_resource.object['publicIp']} #{current_resource.object['publicIp']}") + execute("arping -c 1 -I #{current_resource.device} -A -U -s #{current_resource.object['public_ip']} #{current_resource.object['public_ip']}") + execute("arping -c 1 -I #{current_resource.device} -A -U -s #{current_resource.object['public_ip']} #{current_resource.object['public_ip']}") return true end diff --git a/systemvm/patches/debian/config/var/chef/cookbooks/csip/recipes/default.rb b/systemvm/patches/debian/config/var/chef/cookbooks/csip/recipes/default.rb index 5a5cad302cf..a30352883a6 100755 --- a/systemvm/patches/debian/config/var/chef/cookbooks/csip/recipes/default.rb +++ b/systemvm/patches/debian/config/var/chef/cookbooks/csip/recipes/default.rb @@ -21,6 +21,12 @@ rescue raise format('Cannot find the %s databag item within the %s databag. Please correct this', 'vr', 'ips') end +begin + cmdline = data_bag_item('vr', 'cmdline') +rescue + raise format('Cannot find the %s databag item within the %s databag. Please correct this', 'vr', 'ips') +end + # List configured ips on this node and remove any that are not in the configuration listIPs(vr_ips).each do |dev, ip| csip_device "#{dev}-#{ip}" do @@ -55,15 +61,15 @@ vr_ips.each do |name,data| csip_route "#{name}-dev" do type "dev" table "Table_#{name}" - ip ipo['publicIp'] - mask ipo['vlanNetmask'] + ip ipo['public_ip'] + mask ipo['vlan_netmask'] dev name end csip_route "#{name}-default" do type "default" table "Table_#{name}" - ip ipo['vlanGateway'] - mask ipo['vlanNetmask'] + ip ipo['vlan_gateway'] + mask ipo['vlan_netmask'] dev name end end