Fix neutron OCF scripts for Ubuntu 14.04

* pgrep in Ubuntu 14.04 and CentOS 7 introduces option -a along with -o
* firewall is turned on for 2224 (pcsd). It allows pcs to show "Offline"
  status immediately instead of hanging due to DROP rule

Implements: blueprint support-ubuntu-trusty
Closes-Bug: 1420745

Change-Id: I57e9377b740455bde13251604ad64d4f0633f786
Signed-off-by: Sergii Golovatiuk <sgolovatiuk@mirantis.com>
This commit is contained in:
Sergii Golovatiuk 2015-02-17 14:52:58 +01:00
parent 8384b8ca4d
commit ae6d5ab9d8
5 changed files with 53 additions and 10 deletions

View File

@ -251,7 +251,16 @@ END
}
get_worker_pid() {
pid=`pgrep -u ${OCF_RESKEY_user} -fol ${OCF_RESKEY_binary} | grep -E "python\s+\/usr\/bin" | awk '{print $1}'`
local options
local pid
# FIXME: Remove if condition and set 'falo' statically once Fuel
# discontinue support of Ubuntu 12.04 and CentOs 6.x where -a was not defined.
if pgrep -V | awk 'match($0, /[0-9]\.[0-9].*/) {if (substr($0, RSTART, RLENGTH) < 3.3) {exit 1}}'; then
options='falo'
else
options='flo'
fi
pid=`pgrep -u ${OCF_RESKEY_user} -${options} ${OCF_RESKEY_binary} | awk '/python \/usr\/bin/ {print $1}'`
echo $pid
}

View File

@ -272,7 +272,16 @@ END
}
get_worker_pid() {
pid=`pgrep -u ${OCF_RESKEY_user} -fol ${OCF_RESKEY_binary} | grep -E "python\s+\/usr\/bin" | awk '{print $1}'`
local options
local pid
# FIXME: Remove if condition and set 'falo' statically once Fuel
# discontinue support of Ubuntu 12.04 and CentOs 6.x where -a was not defined.
if pgrep -V | awk 'match($0, /[0-9]\.[0-9].*/) {if (substr($0, RSTART, RLENGTH) < 3.3) {exit 1}}'; then
options='falo'
else
options='flo'
fi
pid=`pgrep -u ${OCF_RESKEY_user} -${options} ${OCF_RESKEY_binary} | awk '/python \/usr\/bin/ {print $1}'`
echo $pid
}

View File

@ -146,7 +146,16 @@ END
}
get_worker_pid() {
pid=`pgrep -u ${OCF_RESKEY_user} -fol ${OCF_RESKEY_binary} | grep -E "python\s+\/usr\/bin" | awk '{print $1}'`
local options
local pid
# FIXME: Remove if condition and set 'falo' statically once Fuel
# discontinue support of Ubuntu 12.04 and CentOs 6.x where -a was not defined.
if pgrep -V | awk 'match($0, /[0-9]\.[0-9].*/) {if (substr($0, RSTART, RLENGTH) < 3.3) {exit 1}}'; then
options='falo'
else
options='flo'
fi
pid=`pgrep -u ${OCF_RESKEY_user} -${options} ${OCF_RESKEY_binary} | awk '/python \/usr\/bin/ {print $1}'`
echo $pid
}

View File

@ -173,7 +173,16 @@ END
}
get_worker_pid() {
pid=`pgrep -u ${OCF_RESKEY_user} -fol ${OCF_RESKEY_binary} | grep -E "python\s+\/usr\/bin" | awk '{print $1}'`
local options
local pid
# FIXME: Remove if condition and set 'falo' statically once Fuel
# discontinue support of Ubuntu 12.04 and CentOs 6.x where -a was not defined.
if pgrep -V | awk 'match($0, /[0-9]\.[0-9].*/) {if (substr($0, RSTART, RLENGTH) < 3.3) {exit 1}}'; then
options='falo'
else
options='flo'
fi
pid=`pgrep -u ${OCF_RESKEY_user} -${options} ${OCF_RESKEY_binary} | awk '/python \/usr\/bin/ {print $1}'`
echo $pid
}

View File

@ -35,6 +35,7 @@ class openstack::firewall (
$ntp_server_port = 123,
$corosync_input_port = 5404,
$corosync_output_port = 5405,
$pcsd_port = 2224,
$openvswitch_db_port = 58882,
$libvirt_port = 16509,
$nrpe_server_port = 5666,
@ -186,38 +187,44 @@ class openstack::firewall (
action => 'accept',
}
firewall {'115 openvswitch db':
firewall {'115 pcsd-server':
port => $pcsd_port,
proto => 'tcp',
action => 'accept',
}
firewall {'116 openvswitch db':
port => $openvswitch_db_port,
proto => 'udp',
action => 'accept',
}
firewall {'116 nrpe-server':
firewall {'117 nrpe-server':
port => $nrpe_server_port,
proto => 'tcp',
action => 'accept',
}
firewall {'117 libvirt':
firewall {'118 libvirt':
port => $libvirt_port,
proto => 'tcp',
action => 'accept',
}
firewall {'118 libvirt migration':
firewall {'119 libvirt migration':
port => '49152-49215',
proto => 'tcp',
action => 'accept',
}
firewall {'118 vnc ports':
firewall {'120 vnc ports':
port => '5900-6100',
proto => 'tcp',
source => $nova_vnc_ip_range,
action => 'accept',
}
firewall {'119 ceilometer':
firewall {'121 ceilometer':
port => $ceilometer_port,
proto => 'tcp',
action => 'accept',