Backport Grenade updates

Backport changes made in Grenade's copy of functions since the last sync:
* d0654b9,i 4c7726e - get_release_name_from_branch()
* 7907766 - edits to install_package()

Change-Id: I0714c0b1072f1360c3c08fe24225e65e2a550fad
diff --git a/functions-common b/functions-common
index 0cecb0b..d92e39c 100644
--- a/functions-common
+++ b/functions-common
@@ -460,6 +460,17 @@
 # Git Functions
 # =============
 
+# Returns openstack release name for a given branch name
+# ``get_release_name_from_branch branch-name``
+function get_release_name_from_branch(){
+    local branch=$1
+    if [[ $branch =~ "stable/" ]]; then
+        echo ${branch#*/}
+    else
+        echo "master"
+    fi
+}
+
 # git clone only if directory doesn't exist already.  Since ``DEST`` might not
 # be owned by the installation user, we create the directory and change the
 # ownership to the proper user.
@@ -792,7 +803,9 @@
 # install_package package [package ...]
 function install_package() {
     if is_ubuntu; then
-        [[ "$NO_UPDATE_REPOS" = "True" ]] || apt_get update
+        # if there are transient errors pulling the updates, that's fine. It may
+        # be secondary repositories that we don't really care about.
+        [[ "$NO_UPDATE_REPOS" = "True" ]] || apt_get update || /bin/true
         NO_UPDATE_REPOS=True
 
         apt_get install "$@"