metron-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject incubator-metron git commit: METRON-561 ShellEditor tests hang if vim is set as EDITOR in your profile (ottobackwards) closes apache/incubator-metron#351
Date Wed, 16 Nov 2016 03:35:24 GMT
Repository: incubator-metron
Updated Branches:
  refs/heads/master 7aea4ba35 -> c7bf73b46


METRON-561 ShellEditor tests hang if vim is set as EDITOR in your profile (ottobackwards)
closes apache/incubator-metron#351


Project: http://git-wip-us.apache.org/repos/asf/incubator-metron/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-metron/commit/c7bf73b4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-metron/tree/c7bf73b4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-metron/diff/c7bf73b4

Branch: refs/heads/master
Commit: c7bf73b462d2b807ed5b389ad591ef13baa0c408
Parents: 7aea4ba
Author: ottobackwards <ottobackwards@gmail.com>
Authored: Tue Nov 15 21:56:50 2016 -0500
Committer: Otto Fowler <otto@apache.org>
Committed: Tue Nov 15 21:56:50 2016 -0500

----------------------------------------------------------------------
 .../org/apache/metron/management/ShellFunctions.java  | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/c7bf73b4/metron-platform/metron-management/src/main/java/org/apache/metron/management/ShellFunctions.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-management/src/main/java/org/apache/metron/management/ShellFunctions.java
b/metron-platform/metron-management/src/main/java/org/apache/metron/management/ShellFunctions.java
index cf7afeb..5ab506a 100644
--- a/metron-platform/metron-management/src/main/java/org/apache/metron/management/ShellFunctions.java
+++ b/metron-platform/metron-management/src/main/java/org/apache/metron/management/ShellFunctions.java
@@ -209,14 +209,16 @@ public class ShellFunctions {
   public static class Edit implements StellarFunction {
 
     private String getEditor() {
-      String editor = System.getenv().get("EDITOR");
-      if(editor == null) {
-        editor = System.getenv("VISUAL");
+      // if we have editor in the system properties, it should
+      // override the env so we check that first
+      String editor = System.getProperty("EDITOR");
+      if(org.apache.commons.lang3.StringUtils.isEmpty(editor)) {
+        editor = System.getenv().get("EDITOR");
       }
-      if(editor == null) {
-        editor = System.getProperty("EDITOR");
+      if(org.apache.commons.lang3.StringUtils.isEmpty(editor)) {
+        editor = System.getenv("VISUAL");
       }
-      if(editor == null) {
+      if(org.apache.commons.lang3.StringUtils.isEmpty(editor)) {
         editor = "/bin/vi";
       }
       return editor;


Mime
View raw message