Skip to content

Commit

Permalink
Merge pull request #150 from caskdata/feature/CDAP-12148-ranger
Browse files Browse the repository at this point in the history
CDAP-12148 Fix namespace lookup
  • Loading branch information
rohitsinha54 authored Aug 30, 2017
2 parents 10561e0 + de59104 commit 0b376f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,14 @@ public List<String> call() {
// note that in the the list calls resourceMap is used to exclude entities which has already been added
// to the list being displayed to the user as an option for selection.
List<String> list = null;
NamespaceId namespace =
resourceMap.containsKey(RangerCommon.KEY_NAMESPACE) &&
!resourceMap.get(RangerCommon.KEY_NAMESPACE).isEmpty() ?
new NamespaceId(resourceMap.get(RangerCommon.KEY_NAMESPACE).get(0)) : null;
NamespaceId namespace = null;
// if user is still entering the namespace the resourceMap.get(RangerCommon.KEY_NAMESPACE).get(0) will
// be empty string in that case we don't want to initialize the namespaceId
if (resourceMap.containsKey(RangerCommon.KEY_NAMESPACE) &&
!resourceMap.get(RangerCommon.KEY_NAMESPACE).isEmpty() &&
!resourceMap.get(RangerCommon.KEY_NAMESPACE).get(0).isEmpty()) {
namespace = new NamespaceId(resourceMap.get(RangerCommon.KEY_NAMESPACE).get(0));
}
switch (resource.trim().toLowerCase()) {
case RangerCommon.KEY_NAMESPACE:
list = getNamespaces(resourceMap.get(RangerCommon.KEY_NAMESPACE));
Expand Down
2 changes: 1 addition & 1 deletion cdap-ranger/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

<properties>
<hadoop.version>2.3.0</hadoop.version>
<ranger.version>0.7.1</ranger.version>
<ranger.version>0.7.0</ranger.version>
</properties>

<repositories>
Expand Down

0 comments on commit 0b376f4

Please sign in to comment.