Add distro check functions for Ubuntu and Fedora

Add is_fedora & is_ubuntu functions, based on names of the checks used
in devstack itself.

Change-Id: I60763d5655344dd008f307b1caad8776277afb3b
This commit is contained in:
Ian Wienand
2014-05-08 01:30:51 +00:00
parent 299ce250a1
commit 882690fcce

View File

@@ -16,6 +16,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# Distro check functions
function is_fedora {
lsb_release -i 2>/dev/null | grep -iq "fedora"
}
function is_ubuntu {
lsb_release -i 2>/dev/null | grep -iq "ubuntu"
}
function function_exists {
type $1 2>/dev/null | grep -q 'is a function'
}