From 67e91f780184626db723701a9a617cd68f8355c9 Mon Sep 17 00:00:00 2001
From: Andreas Jaeger <aj@suse.com>
Date: Mon, 18 Apr 2016 09:19:58 +0200
Subject: [PATCH] Translations: Handle non-translated module

extract_messages removes the pot file if it does not contain any
translations. But then git add will fail since nothing is to add.

This currently breaks keystone proposal:
http://logs.openstack.org/periodic/keystone-propose-translation-update/2ef243f

Add a test for empty directory and exist early if it exists.

Change-Id: I3cce7f81856d579dde36445f722ba513a29fae61
---
 jenkins/scripts/propose_translation_update.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/jenkins/scripts/propose_translation_update.sh b/jenkins/scripts/propose_translation_update.sh
index 175cc86f23..611589f8ac 100755
--- a/jenkins/scripts/propose_translation_update.sh
+++ b/jenkins/scripts/propose_translation_update.sh
@@ -80,6 +80,12 @@ function propose_python {
     extract_messages "$modulename"
     extract_messages_log "$modulename"
 
+    # Check for empty directory and exit early
+    local content=$(ls -A $modulename/locale/)
+    if [[ "$content" == "" ]] ; then
+        return
+    fi
+
     # Now add all changed files to git.
     # Note we add them here to not have to differentiate in the functions
     # between new files and files already under git control.