File fix-unboundlocalerror-in-file.get_diff.patch of Package salt.7664

From f9677d889b77207cb9c0317c6ad0a0a369dc7af7 Mon Sep 17 00:00:00 2001
From: Erik Johnson <palehose@gmail.com>
Date: Mon, 30 Apr 2018 10:25:40 -0500
Subject: [PATCH] Fix UnboundLocalError in file.get_diff

This was only in 2018.3 head and not part of a release

Add unit test for file.get_diff

Use a lambda instead of defining a one-line function
---
 salt/modules/file.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/salt/modules/file.py b/salt/modules/file.py
index e8ef08546a..74051064f2 100644
--- a/salt/modules/file.py
+++ b/salt/modules/file.py
@@ -4943,7 +4943,8 @@ def get_diff(file1,
                         *salt.utils.data.decode(args)
                     )
                 )
-    return ret
+        return ret
+    return ''
 
 
 def manage_file(name,
-- 
2.17.1


openSUSE Build Service is sponsored by