ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rle...@apache.org
Subject ambari git commit: AMBARI-17043. Fix description of SERVICE.ADD_DELETE_SERVICES permission (rlevas)
Date Tue, 07 Jun 2016 19:08:04 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 9e15b2b65 -> c85d0d15e


AMBARI-17043. Fix description of SERVICE.ADD_DELETE_SERVICES permission (rlevas)


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

Branch: refs/heads/trunk
Commit: c85d0d15e5c015a069c888c25583e7bfe767acd8
Parents: 9e15b2b
Author: Robert Levas <rlevas@hortonworks.com>
Authored: Tue Jun 7 15:07:59 2016 -0400
Committer: Robert Levas <rlevas@hortonworks.com>
Committed: Tue Jun 7 15:08:03 2016 -0400

----------------------------------------------------------------------
 .../org/apache/ambari/server/upgrade/UpgradeCatalog230.java   | 2 +-
 .../org/apache/ambari/server/upgrade/UpgradeCatalog240.java   | 7 +++++--
 ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql  | 2 +-
 ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql  | 2 +-
 ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql | 2 +-
 .../src/main/resources/Ambari-DDL-Postgres-CREATE.sql         | 2 +-
 .../main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql    | 2 +-
 .../src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql      | 2 +-
 .../src/main/resources/Ambari-DDL-SQLServer-CREATE.sql        | 2 +-
 .../apache/ambari/server/upgrade/UpgradeCatalog240Test.java   | 4 +++-
 10 files changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c85d0d15/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog230.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog230.java
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog230.java
index be9c2e2..ec3d765 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog230.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog230.java
@@ -194,7 +194,7 @@ public class UpgradeCatalog230 extends AbstractUpgradeCatalog {
     createRoleAuthorization(roleAuthorizationDAO, "SERVICE.MOVE", "Move to another host");
     createRoleAuthorization(roleAuthorizationDAO, "SERVICE.ENABLE_HA", "Enable HA");
     createRoleAuthorization(roleAuthorizationDAO, "SERVICE.TOGGLE_ALERTS", "Enable/disable
service-level alerts");
-    createRoleAuthorization(roleAuthorizationDAO, "SERVICE.ADD_DELETE_SERVICES", "Add Service
to cluster");
+    createRoleAuthorization(roleAuthorizationDAO, "SERVICE.ADD_DELETE_SERVICES", "Add/delete
services");
 
     createRoleAuthorization(roleAuthorizationDAO, "HOST.VIEW_METRICS", "View metrics");
     createRoleAuthorization(roleAuthorizationDAO, "HOST.VIEW_STATUS_INFO", "View status information");

http://git-wip-us.apache.org/repos/asf/ambari/blob/c85d0d15/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
index 01322b2..11a6a87 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog240.java
@@ -27,7 +27,6 @@ import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -372,6 +371,7 @@ public class UpgradeCatalog240 extends AbstractUpgradeCatalog {
     updateHDFSWidgetDefinition();
     updateTezViewProperty();
     upgradeCapSchedulerView();
+    fixAuthorizationDescriptions();
   }
 
   protected void updateClusterInheritedPermissionsConfig() throws SQLException {
@@ -2426,5 +2426,8 @@ public class UpgradeCatalog240 extends AbstractUpgradeCatalog {
     }
   }
 
-
+  void fixAuthorizationDescriptions() throws SQLException {
+    // Change the description of the SERVICE.ADD_DELETE_SERVICES authorization to "Add/delete
services"
+    dbAccessor.executeUpdate("UPDATE roleauthorization SET authorization_name='Add/delete
services' WHERE authorization_id='SERVICE.ADD_DELETE_SERVICES'");
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/c85d0d15/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
index 940542d..e89c0f1 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Derby-CREATE.sql
@@ -1212,7 +1212,7 @@ INSERT INTO roleauthorization(authorization_id, authorization_name)
   SELECT 'SERVICE.MOVE', 'Move to another host' FROM SYSIBM.SYSDUMMY1 UNION ALL
   SELECT 'SERVICE.ENABLE_HA', 'Enable HA' FROM SYSIBM.SYSDUMMY1 UNION ALL
   SELECT 'SERVICE.TOGGLE_ALERTS', 'Enable/disable service alerts' FROM SYSIBM.SYSDUMMY1 UNION
ALL
-  SELECT 'SERVICE.ADD_DELETE_SERVICES', 'Add Service to cluster' FROM SYSIBM.SYSDUMMY1 UNION
ALL
+  SELECT 'SERVICE.ADD_DELETE_SERVICES', 'Add/Delete services' FROM SYSIBM.SYSDUMMY1 UNION
ALL
   SELECT 'HOST.VIEW_METRICS', 'View metrics' FROM SYSIBM.SYSDUMMY1 UNION ALL
   SELECT 'HOST.VIEW_STATUS_INFO', 'View status information' FROM SYSIBM.SYSDUMMY1 UNION ALL
   SELECT 'HOST.VIEW_CONFIGS', 'View configuration' FROM SYSIBM.SYSDUMMY1 UNION ALL

http://git-wip-us.apache.org/repos/asf/ambari/blob/c85d0d15/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
index eb2b349..f640bb6 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-MySQL-CREATE.sql
@@ -1142,7 +1142,7 @@ INSERT INTO roleauthorization(authorization_id, authorization_name)
   SELECT 'SERVICE.MOVE', 'Move to another host' UNION ALL
   SELECT 'SERVICE.ENABLE_HA', 'Enable HA' UNION ALL
   SELECT 'SERVICE.TOGGLE_ALERTS', 'Enable/disable service-level alerts' UNION ALL
-  SELECT 'SERVICE.ADD_DELETE_SERVICES', 'Add Service to cluster' UNION ALL
+  SELECT 'SERVICE.ADD_DELETE_SERVICES', 'Add/delete services' UNION ALL
   SELECT 'HOST.VIEW_METRICS', 'View metrics' UNION ALL
   SELECT 'HOST.VIEW_STATUS_INFO', 'View status information' UNION ALL
   SELECT 'HOST.VIEW_CONFIGS', 'View configuration' UNION ALL

http://git-wip-us.apache.org/repos/asf/ambari/blob/c85d0d15/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
index de8c2e6..0057982 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
@@ -1161,7 +1161,7 @@ INSERT INTO roleauthorization(authorization_id, authorization_name)
   SELECT 'SERVICE.MOVE', 'Move to another host' FROM dual UNION ALL
   SELECT 'SERVICE.ENABLE_HA', 'Enable HA' FROM dual UNION ALL
   SELECT 'SERVICE.TOGGLE_ALERTS', 'Enable/disable service-level alerts' FROM dual UNION ALL
-  SELECT 'SERVICE.ADD_DELETE_SERVICES', 'Add Service to cluster' FROM dual UNION ALL
+  SELECT 'SERVICE.ADD_DELETE_SERVICES', 'Add/delete services' FROM dual UNION ALL
   SELECT 'HOST.VIEW_METRICS', 'View metrics' FROM dual UNION ALL
   SELECT 'HOST.VIEW_STATUS_INFO', 'View status information' FROM dual UNION ALL
   SELECT 'HOST.VIEW_CONFIGS', 'View configuration' FROM dual UNION ALL

http://git-wip-us.apache.org/repos/asf/ambari/blob/c85d0d15/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
index 0a8d6c9..6a98e84 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
@@ -1133,7 +1133,7 @@ INSERT INTO roleauthorization(authorization_id, authorization_name)
   SELECT 'SERVICE.MOVE', 'Move to another host' UNION ALL
   SELECT 'SERVICE.ENABLE_HA', 'Enable HA' UNION ALL
   SELECT 'SERVICE.TOGGLE_ALERTS', 'Enable/disable service-level alerts' UNION ALL
-  SELECT 'SERVICE.ADD_DELETE_SERVICES', 'Add Service to cluster' UNION ALL
+  SELECT 'SERVICE.ADD_DELETE_SERVICES', 'Add/delete services' UNION ALL
   SELECT 'HOST.VIEW_METRICS', 'View metrics' UNION ALL
   SELECT 'HOST.VIEW_STATUS_INFO', 'View status information' UNION ALL
   SELECT 'HOST.VIEW_CONFIGS', 'View configuration' UNION ALL

http://git-wip-us.apache.org/repos/asf/ambari/blob/c85d0d15/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
index 4b65a69..df8f315 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-EMBEDDED-CREATE.sql
@@ -1295,7 +1295,7 @@ INSERT INTO ambari.roleauthorization(authorization_id, authorization_name)
   SELECT 'SERVICE.MOVE', 'Move to another host' UNION ALL
   SELECT 'SERVICE.ENABLE_HA', 'Enable HA' UNION ALL
   SELECT 'SERVICE.TOGGLE_ALERTS', 'Enable/disable service-level alerts' UNION ALL
-  SELECT 'SERVICE.ADD_DELETE_SERVICES', 'Add Service to cluster' UNION ALL
+  SELECT 'SERVICE.ADD_DELETE_SERVICES', 'Add/delete services' UNION ALL
   SELECT 'HOST.VIEW_METRICS', 'View metrics' UNION ALL
   SELECT 'HOST.VIEW_STATUS_INFO', 'View status information' UNION ALL
   SELECT 'HOST.VIEW_CONFIGS', 'View configuration' UNION ALL

http://git-wip-us.apache.org/repos/asf/ambari/blob/c85d0d15/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
index 5ef07d0..caee4f6 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-SQLAnywhere-CREATE.sql
@@ -1158,7 +1158,7 @@ insert into adminpermission(permission_id, permission_name, resource_type_id,
pe
     SELECT 'SERVICE.MOVE', 'Move to another host' UNION ALL
     SELECT 'SERVICE.ENABLE_HA', 'Enable HA' UNION ALL
     SELECT 'SERVICE.TOGGLE_ALERTS', 'Enable/disable service-level alerts' UNION ALL
-    SELECT 'SERVICE.ADD_DELETE_SERVICES', 'Add Service to cluster' UNION ALL
+    SELECT 'SERVICE.ADD_DELETE_SERVICES', 'Add/delete services' UNION ALL
     SELECT 'HOST.VIEW_METRICS', 'View metrics' UNION ALL
     SELECT 'HOST.VIEW_STATUS_INFO', 'View status information' UNION ALL
     SELECT 'HOST.VIEW_CONFIGS', 'View configuration' UNION ALL

http://git-wip-us.apache.org/repos/asf/ambari/blob/c85d0d15/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
index 0b5f3b8..ffd2040 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
@@ -1161,7 +1161,7 @@ BEGIN TRANSACTION
     SELECT 'SERVICE.MOVE', 'Move service to another host' UNION ALL
     SELECT 'SERVICE.ENABLE_HA', 'Enable HA' UNION ALL
     SELECT 'SERVICE.TOGGLE_ALERTS', 'Enable/disable service-level alerts' UNION ALL
-    SELECT 'SERVICE.ADD_DELETE_SERVICES', 'Add Service to cluster' UNION ALL
+    SELECT 'SERVICE.ADD_DELETE_SERVICES', 'Add/delete services' UNION ALL
     SELECT 'HOST.VIEW_METRICS', 'View metrics' UNION ALL
     SELECT 'HOST.VIEW_STATUS_INFO', 'View status information' UNION ALL
     SELECT 'HOST.VIEW_CONFIGS', 'View configuration' UNION ALL

http://git-wip-us.apache.org/repos/asf/ambari/blob/c85d0d15/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
index 670200c..86d776d 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog240Test.java
@@ -114,7 +114,6 @@ import com.google.inject.Injector;
 import com.google.inject.Module;
 import com.google.inject.Provider;
 
-import junit.framework.Assert;
 import org.junit.rules.TemporaryFolder;
 
 public class UpgradeCatalog240Test {
@@ -501,6 +500,7 @@ public class UpgradeCatalog240Test {
     Method updatePhoenixConfigs = UpgradeCatalog240.class.getDeclaredMethod("updatePhoenixConfigs");
     Method updateKerberosDescriptorArtifacts = AbstractUpgradeCatalog.class.getDeclaredMethod("updateKerberosDescriptorArtifacts");
     Method updateFalconConfigs = UpgradeCatalog240.class.getDeclaredMethod("updateFalconConfigs");
+    Method fixAuthorizationDescriptions = UpgradeCatalog240.class.getDeclaredMethod("fixAuthorizationDescriptions");
 
     Capture<String> capturedStatements = newCapture(CaptureType.ALL);
 
@@ -535,6 +535,7 @@ public class UpgradeCatalog240Test {
             .addMockedMethod(updatePhoenixConfigs)
             .addMockedMethod(updateKerberosDescriptorArtifacts)
             .addMockedMethod(updateFalconConfigs)
+            .addMockedMethod(fixAuthorizationDescriptions)
             .createMock();
 
     Field field = AbstractUpgradeCatalog.class.getDeclaredField("dbAccessor");
@@ -564,6 +565,7 @@ public class UpgradeCatalog240Test {
     upgradeCatalog240.updatePhoenixConfigs();
     upgradeCatalog240.updateKerberosDescriptorArtifacts();
     upgradeCatalog240.updateFalconConfigs();
+    upgradeCatalog240.fixAuthorizationDescriptions();
 
     replay(upgradeCatalog240, dbAccessor);
 


Mime
View raw message