cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [1/2] git commit: updated refs/heads/saml-production-grade to 6dfed25
Date Thu, 04 Jun 2015 17:08:53 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/saml-production-grade b36cf775c -> 6dfed2588


CLOUDSTACK-8457: Fix configurations in 4.5.1 to 4.5.2 upgrade path

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


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

Branch: refs/heads/saml-production-grade
Commit: bed8b652991b84e597327bde3436fa4be041cf8a
Parents: b36cf77
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Thu Jun 4 18:05:04 2015 +0200
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Thu Jun 4 18:05:04 2015 +0200

----------------------------------------------------------------------
 .../com/cloud/upgrade/dao/Upgrade451to452.java  | 19 +++++++++++++----
 .../cloudstack/api/command/ListIdpsCmd.java     |  6 +++++-
 setup/db/db/schema-451to452-cleanup.sql         | 20 ++++++++++++++++++
 setup/db/db/schema-451to452.sql                 | 22 ++++++++++++++++++++
 4 files changed, 62 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bed8b652/engine/schema/src/com/cloud/upgrade/dao/Upgrade451to452.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade451to452.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade451to452.java
index 3b7b643..870e534 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade451to452.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade451to452.java
@@ -17,11 +17,13 @@
 
 package com.cloud.upgrade.dao;
 
+import com.cloud.utils.exception.CloudRuntimeException;
+import com.cloud.utils.script.Script;
+import org.apache.log4j.Logger;
+
 import java.io.File;
 import java.sql.Connection;
 
-import org.apache.log4j.Logger;
-
 public class Upgrade451to452 implements DbUpgrade {
     final static Logger s_logger = Logger.getLogger(Upgrade451to452.class);
 
@@ -42,7 +44,11 @@ public class Upgrade451to452 implements DbUpgrade {
 
     @Override
     public File[] getPrepareScripts() {
-        return new File[] {};
+        String script = Script.findScript("", "db/schema-451to452.sql");
+        if (script == null) {
+            throw new CloudRuntimeException("Unable to find db/schema-451to452.sql");
+        }
+        return new File[] {new File(script)};
     }
 
     @Override
@@ -51,6 +57,11 @@ public class Upgrade451to452 implements DbUpgrade {
 
     @Override
     public File[] getCleanupScripts() {
-        return null;
+        String script = Script.findScript("", "db/schema-451to452-cleanup.sql");
+        if (script == null) {
+            throw new CloudRuntimeException("Unable to find db/schema-451to452-cleanup.sql");
+        }
+
+        return new File[] {new File(script)};
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bed8b652/plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/ListIdpsCmd.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/ListIdpsCmd.java
b/plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/ListIdpsCmd.java
index 4786a62..d6d867c 100644
--- a/plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/ListIdpsCmd.java
+++ b/plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/ListIdpsCmd.java
@@ -78,7 +78,11 @@ public class ListIdpsCmd extends BaseCmd implements APIAuthenticator {
         for (SAMLProviderMetadata metadata: _samlAuthManager.getAllIdPMetadata()) {
             IdpResponse idpResponse = new IdpResponse();
             idpResponse.setId(metadata.getEntityId());
-            idpResponse.setOrgName(metadata.getOrganizationName());
+            if (metadata.getOrganizationName() != null || !metadata.getOrganizationName().isEmpty())
{
+                idpResponse.setOrgName(metadata.getOrganizationName());
+            } else {
+                idpResponse.setOrgName(metadata.getEntityId());
+            }
             idpResponse.setOrgUrl(metadata.getOrganizationUrl());
             idpResponse.setObjectName("idp");
             idpResponseList.add(idpResponse);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bed8b652/setup/db/db/schema-451to452-cleanup.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-451to452-cleanup.sql b/setup/db/db/schema-451to452-cleanup.sql
new file mode 100644
index 0000000..9f5e62a
--- /dev/null
+++ b/setup/db/db/schema-451to452-cleanup.sql
@@ -0,0 +1,20 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+--   http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied.  See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+--;
+-- Schema cleanup from 4.5.1 to 4.5.2;
+--;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bed8b652/setup/db/db/schema-451to452.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-451to452.sql b/setup/db/db/schema-451to452.sql
new file mode 100644
index 0000000..cd7f229
--- /dev/null
+++ b/setup/db/db/schema-451to452.sql
@@ -0,0 +1,22 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+--   http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied.  See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+--;
+-- Schema upgrade from 4.5.1 to 4.5.2;
+--;
+
+DELETE FROM `cloud`.`configuration` WHERE name like 'saml%';


Mime
View raw message