diff --git a/salt/modules/ebuild.py b/salt/modules/ebuild.py
index <HASH>..<HASH> 100644
--- a/salt/modules/ebuild.py
+++ b/salt/modules/ebuild.py
@@ -17,6 +17,7 @@ import re
 import salt.utils
 
 # Import third party libs
+HAS_PORTAGE = False
 try:
     import portage
     HAS_PORTAGE = True
@@ -30,8 +31,7 @@ except ImportError:
             import portage
             HAS_PORTAGE = True
         except ImportError:
-            HAS_PORTAGE = False
-
+            pass
 
 log = logging.getLogger(__name__)
Bring `HAS_PORTAGE` to global scope, wrongly removed(by me).