+++ This bug was initially created as a clone of Bug #1121222 +++ Description of problem: oo-accept-node inconsistently checks for the non-existence of /sbin/ip in the tests that use it: find_ext_net_dev rescues if there is a Errno::ENOENT exception whereas check_node_public_resolution fails ungracefully with an unrescued exception. How reproducible: Completely. Steps to Reproduce: 1. Install an OpenShift Enterprise PaaS with 1 node. 2. Move /sbin/ip to /sbin/ip on the node from Step 1. 3. Run oo-accept-node -v on the node. Actual results: At Step 3, oo-accept-node rescues gracefully in the find_ext_net_dev test but subsequently fails ungracefully with an unrescued exception in the check_node_public_resolution test: # oo-accept-node -v INFO: using default accept-node extensions INFO: loading node configuration file /etc/openshift/node.conf INFO: loading resource limit file /etc/openshift/resource_limits.conf INFO: finding external network device FAIL: SEVERE: could not find ip command (/sbin/ip). INFO: checking node public hostname resolution /usr/sbin/oo-accept-node:318:in ``': No such file or directory - /sbin/ip addr show scope global (Errno::ENOENT) from /usr/sbin/oo-accept-node:318:in `check_node_public_resolution' from /usr/sbin/oo-accept-node:914:in `<main>' # Expected results: At Step 3, oo-accept-node should always gracefully handle Errno::ENOENT errors: # oo-accept-node -v INFO: using default accept-node extensions INFO: loading node configuration file /etc/openshift/node.conf INFO: loading resource limit file /etc/openshift/resource_limits.conf INFO: finding external network device FAIL: SEVERE: could not find ip command (/sbin/ip). INFO: checking node public hostname resolution FAIL: SEVERE: could not find ip command (/sbin/ip). INFO: checking selinux status INFO: checking selinux openshift-origin policy INFO: checking selinux booleans INFO: checking package list INFO: checking services INFO: checking kernel semaphores >= 512 INFO: checking cgroups configuration INFO: checking cgroups processes INFO: find district uuid: 538646d0eaa253c5da000001 INFO: determining node uid range: 1000 to 6999 INFO: traffic control not enabled in /etc/openshift/node.conf, set TRAFFIC_CONTROL_ENABLED=true to enable INFO: checking filesystem quotas INFO: checking quota db file selinux label INFO: checking 5 user accounts INFO: checking application dirs INFO: checking system httpd configs INFO: checking cartridge repository 2 ERRORS #
PR: https://github.com/openshift/origin-server/pull/5624
Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/d25e6a61c587186ab743ee75e24f88bed3da7fa8 oo-accept-node: Handle non-existence of /sbin/ip Modify check_node_public_resolution to rescue from Errno::ENOENT when running /sbin/ip in case the command does not exist. This change makes check_node_public_resolution consistent with the find_ext_net_dev test. This commit fixes bug 1121224.
[root@broker sbin]# oo-accept-node -v INFO: using default accept-node extensions INFO: loading node configuration file /etc/openshift/node.conf INFO: loading resource limit file /etc/openshift/resource_limits.conf INFO: finding external network device FAIL: SEVERE: could not find ip command (/sbin/ip). INFO: checking that external network device has a globally scoped IPv4 address FAIL: SEVERE: could not find ip command (/sbin/ip). INFO: checking node public hostname resolution FAIL: SEVERE: could not find ip command (/sbin/ip). INFO: checking selinux status INFO: checking selinux openshift-origin policy INFO: checking selinux booleans INFO: checking package list INFO: checking services INFO: checking kernel semaphores >= 512 INFO: checking cgroups configuration INFO: checking cgroups processes INFO: find district uuid: 5602021582611d7053000001 INFO: determining node uid range: 1000 to 6999 INFO: checking presence of tc qdisc INFO: checking for cgroup filter INFO: checking presence of tc classes INFO: checking filesystem quotas INFO: checking quota db file selinux label INFO: checking 0 user accounts INFO: checking application dirs INFO: checking system httpd configs INFO: checking cartridge repository 3 ERRORS