You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ja...@apache.org on 2013/11/07 13:18:52 UTC

git commit: updated refs/heads/master to 4162065

Updated Branches:
  refs/heads/master 5d75c6b75 -> 416206595


CLOUDSTACK-4736 Fixed issue in default service selection


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

Branch: refs/heads/master
Commit: 416206595edabfeb6245f3a2b13c6727c3f5e65e
Parents: 5d75c6b
Author: Jayapal <ja...@apache.org>
Authored: Thu Nov 7 17:07:30 2013 +0530
Committer: Jayapal <ja...@apache.org>
Committed: Thu Nov 7 17:11:03 2013 +0530

----------------------------------------------------------------------
 .../cloud/network/dao/MonitoringServiceDaoImpl.java    |  2 +-
 .../src/com/cloud/network/dao/MonitoringServiceVO.java | 13 +++++--------
 .../router/VirtualNetworkApplianceManagerImpl.java     |  2 +-
 setup/db/db/schema-421to430.sql                        |  9 +++++----
 systemvm/patches/debian/config/root/monitorServices.py |  4 ++--
 5 files changed, 14 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/41620659/engine/schema/src/com/cloud/network/dao/MonitoringServiceDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/MonitoringServiceDaoImpl.java b/engine/schema/src/com/cloud/network/dao/MonitoringServiceDaoImpl.java
index 53dc7d4..e0b2c20 100644
--- a/engine/schema/src/com/cloud/network/dao/MonitoringServiceDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/MonitoringServiceDaoImpl.java
@@ -35,7 +35,7 @@ public class MonitoringServiceDaoImpl extends GenericDaoBase<MonitoringServiceVO
     public MonitoringServiceDaoImpl() {
         super();
         AllFieldsSearch = createSearchBuilder();
-        AllFieldsSearch.and("isDefault", AllFieldsSearch.entity().getDefault(), SearchCriteria.Op.EQ);
+        AllFieldsSearch.and("isDefault", AllFieldsSearch.entity().isDefaultService(), SearchCriteria.Op.EQ);
         AllFieldsSearch.and("service", AllFieldsSearch.entity().getService(), SearchCriteria.Op.EQ);
         AllFieldsSearch.and("processname", AllFieldsSearch.entity().getProcessname(), SearchCriteria.Op.EQ);
         AllFieldsSearch.and("servicename", AllFieldsSearch.entity().getServiceName(), SearchCriteria.Op.EQ);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/41620659/engine/schema/src/com/cloud/network/dao/MonitoringServiceVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/MonitoringServiceVO.java b/engine/schema/src/com/cloud/network/dao/MonitoringServiceVO.java
index 3f9122c..ebd1f84 100644
--- a/engine/schema/src/com/cloud/network/dao/MonitoringServiceVO.java
+++ b/engine/schema/src/com/cloud/network/dao/MonitoringServiceVO.java
@@ -26,12 +26,13 @@ import java.util.UUID;
 public class MonitoringServiceVO implements MonitoringService {
 
     public MonitoringServiceVO(String service, String processname, String serviceName, String servicePath,
-                            String pidFile) {
+                            String pidFile, boolean defaultService) {
         this.service = service;
         this.processname = processname;
         this.servicename = serviceName;
         this.servicePath = servicePath;
         this.servicePidFile= pidFile;
+        this.defaultService = defaultService;
 
     }
 
@@ -59,7 +60,7 @@ public class MonitoringServiceVO implements MonitoringService {
     private String servicePidFile;
 
     @Column(name="isDefault")
-    private boolean isDefault;
+    private boolean defaultService;
 
 
     @Column(name = "uuid")
@@ -105,12 +106,8 @@ public class MonitoringServiceVO implements MonitoringService {
         return 0;  //To change body of implemented methods use File | Settings | File Templates.
     }
 
-    public boolean getDefault() {
-        return isDefault;
-    }
-
-    public void setDefault(boolean isDefault) {
-        isDefault = isDefault;
+    public boolean isDefaultService() {
+        return defaultService;
     }
 
     public String getProcessname() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/41620659/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index fb75cb7..0f7c5c9 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -2368,7 +2368,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
         List<MonitorServiceTO> servicesTO = new ArrayList<MonitorServiceTO>();
         for (MonitoringServiceVO service: services) {
             MonitorServiceTO serviceTO = new MonitorServiceTO( service.getService(), service.getProcessname(), service.getServiceName(), service.getServicePath(),
-                    service.getPidFile(), service.getDefault());
+                    service.getPidFile(), service.isDefaultService());
             servicesTO.add(serviceTO);
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/41620659/setup/db/db/schema-421to430.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-421to430.sql b/setup/db/db/schema-421to430.sql
index 2dd998b..7bacefe 100644
--- a/setup/db/db/schema-421to430.sql
+++ b/setup/db/db/schema-421to430.sql
@@ -575,10 +575,11 @@ create table `cloud`.`monitoring_services` (
 `isDefault` boolean COMMENT 'Default service', PRIMARY KEY (`id`)
 );
 
-insert into cloud.monitoring_services(id, service, process_name, service_name, service_path, pidfile, isDefault) values(1,'ssh','sshd', 'ssh','/etc/init.d/ssh','/var/run/sshd.pid',true);
-insert into cloud.monitoring_services(id, service, process_name, service_name, service_path, pidfile, isDefault) values(2,'dhcp','dnsmasq','dnsmasq','/etc/init.d/dnsmasq','/var/run/dnsmasq/dnsmasq.pid',false);
-insert into cloud.monitoring_services(id, service, process_name, service_name, service_path, pidfile, isDefault) values(3,'loadbalancing','haproxy','haproxy','/etc/init.d/haproxy','/var/run/haproxy.pid',false);
-insert into cloud.monitoring_services(id, service, process_name,  service_name, service_path, pidfile, isDefault) values(4,'webserver','apache2','apache2','/etc/init.d/apache2','/var/run/apache2.pid', true);
+insert into cloud.monitoring_services(id, uuid, service, process_name, service_name, service_path, pidfile, isDefault) values(1, UUID(), 'ssh','sshd', 'ssh','/etc/init.d/ssh','/var/run/sshd.pid',true);
+insert into cloud.monitoring_services(id, uuid, service, process_name, service_name, service_path, pidfile, isDefault) values(2, UUID(), 'dhcp','dnsmasq','dnsmasq','/etc/init.d/dnsmasq','/var/run/dnsmasq/dnsmasq.pid',false);
+insert into cloud.monitoring_services(id, uuid, service, process_name, service_name, service_path, pidfile, isDefault) values(3, UUID(), 'loadbalancing','haproxy','haproxy','/etc/init.d/haproxy','/var/run/haproxy.pid',false);
+insert into cloud.monitoring_services(id, uuid, service, process_name,  service_name, service_path, pidfile, isDefault) values(4, UUID(), 'webserver','apache2','apache2','/etc/init.d/apache2','/var/run/apache2.pid', true);
+
 ALTER TABLE `cloud`.`service_offering` CHANGE COLUMN `cpu` `cpu` INT(10) UNSIGNED NULL COMMENT '# of cores'  , CHANGE COLUMN `speed` `speed` INT(10) UNSIGNED NULL COMMENT 'speed per core in mhz'  , CHANGE COLUMN `ram_size` `ram_size` BIGINT(20) UNSIGNED NULL  ;
 
 CREATE TABLE `cloud`.`usage_event_details` (

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/41620659/systemvm/patches/debian/config/root/monitorServices.py
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/root/monitorServices.py b/systemvm/patches/debian/config/root/monitorServices.py
index 358c9dc..f0c2afe 100755
--- a/systemvm/patches/debian/config/root/monitorServices.py
+++ b/systemvm/patches/debian/config/root/monitorServices.py
@@ -170,7 +170,7 @@ def checkProcessStatus( process ):
                     if isPidMatchPidFile(pidfile, pids) == StatusCodes.SUCCESS:
                         pidFileMatched = 1;
                         printd("pid file is matched ...")
-                        raisealert(log.INFO, "The process detected as running", process_name)
+                        raisealert(log.ALERT, "The process detected as running", process_name)
                         break
                     else:
                         printd("pid file is not matched ...")
@@ -201,7 +201,7 @@ def checkProcessStatus( process ):
                 if return_val == 0:
                     printd("The process" + process_name +" recovered successfully ")
                     msg="The process " +process_name+" is recovered successfully "
-                    raisealert(log.ALERT,process_name,msg)
+                    raisealert(log.INFO,process_name,msg)
 
                     break;
                 else: