openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From csantan...@apache.org
Subject [incubator-openwhisk] branch master updated: Don't fail if no Docker containers running (#3074)
Date Fri, 08 Dec 2017 03:14:18 GMT
This is an automated email from the ASF dual-hosted git repository.

csantanapr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new 3d92ec2  Don't fail if no Docker containers running (#3074)
3d92ec2 is described below

commit 3d92ec26486a18a2bdfe13ba0f0cebd1051ce0fb
Author: Sven Lange-Last <sven.lange-last@de.ibm.com>
AuthorDate: Fri Dec 8 04:14:13 2017 +0100

    Don't fail if no Docker containers running (#3074)
    
    The initial version failed if no Docker containers were running because an invalid regular
expression was constructed for `find` command.
    
    With this change, the regular expression for filtering active virtual ethernet interfaces
is only included active interfaces can be found. If Docker containers are running, there are
always active interfaces. If no Docker containers are running, there may be no actives interfaces.
---
 ansible/roles/invoker/tasks/clean.yml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ansible/roles/invoker/tasks/clean.yml b/ansible/roles/invoker/tasks/clean.yml
index 9d519f5..c4e5024 100644
--- a/ansible/roles/invoker/tasks/clean.yml
+++ b/ansible/roles/invoker/tasks/clean.yml
@@ -44,8 +44,8 @@
 # Remove inactive files older than 60 minutes
 - name: "Clean orphaned ifstate.veth* files on Ubuntu 14.04"
   shell: |
-    ACTIVE_IFACES_REGEXP=$(ip -oneline link show | grep --only-matching --extended-regexp
'veth[0-9a-f]+' | tr '\n' '|' | sed -e 's/.$//' | xargs -I '{}' /bin/echo '/run/network/ifstate\.({})')
-    find /run/network -regextype posix-egrep \( -not -regex ${ACTIVE_IFACES_REGEXP} \) -and
-name 'ifstate.veth*' -and -mmin +60 -delete
-  ignore_errors: True
+    ACTIVE_VETH_IFACES=$(ip -oneline link show | grep --only-matching --extended-regexp 'veth[0-9a-f]+'
| tr '\n' '|' | sed -e 's/.$//')
+    EXCLUDE_REGEX=$(if [ -z ${ACTIVE_VETH_IFACES} ]; then echo 'No active veth interfaces
found' >&2; else printf '( -not -regex  /run/network/ifstate\.(%s) ) -and ' ${ACTIVE_VETH_IFACES};
fi)
+    find /run/network -regextype posix-egrep ${EXCLUDE_REGEX} -name 'ifstate.veth*' -and
-mmin +60 -delete
   become: True
   when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '14.04'

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <commits@openwhisk.apache.org>'].

Mime
View raw message