[Pkg-nagios-changes] [SCM] UNNAMED PROJECT branch, debian/master, updated. 810edbdd3feedbfe37f4a65bee50b57b2f60fa2a

Naparuba naparuba at gmail.com
Tue Feb 28 22:17:41 UTC 2012


The following commit has been merged in the debian/master branch:
commit b9e5efe8a0454459e09fa7f88d1c0c49cd32bcaa
Author: Naparuba <naparuba at gmail.com>
Date:   Mon Jan 30 11:15:00 2012 +0100

    *Fix : (reported by : denetariko) manage spaces before and after type name in define line.
    *Fix : remove mockups things in the webui.

diff --git a/shinken/objects/config.py b/shinken/objects/config.py
index 2cdc75b..ef59491 100644
--- a/shinken/objects/config.py
+++ b/shinken/objects/config.py
@@ -519,8 +519,10 @@ class Config(Item):
                 tmp.append("imported_from "+ filefrom)
                 # Get new type
                 elts = re.split('\s', line)
-                tmp_type = elts[1]
-                tmp_type = tmp_type.split('{')[0]
+                # Maybe there was space before and after the type
+                # so we must get all and strip it
+                tmp_type = ' '.join(elts[1:]).strip()
+                tmp_type = tmp_type.split('{')[0].strip()
             else:
                 if in_define:
                     tmp.append(line)
diff --git a/shinken/webui/plugins/eltdetail/views/eltdetail.tpl b/shinken/webui/plugins/eltdetail/views/eltdetail.tpl
index a130789..128b51b 100644
--- a/shinken/webui/plugins/eltdetail/views/eltdetail.tpl
+++ b/shinken/webui/plugins/eltdetail/views/eltdetail.tpl
@@ -249,9 +249,9 @@ Invalid element name
 	<a href="#" onclick="acknowledge('{{elt.get_full_name()}}')">{{!helper.get_button('Acknowledge it', img='/static/images/wrench.png')}}</a>
 	<a href="#" onclick="recheck_now('{{elt.get_full_name()}}')">{{!helper.get_button('Recheck now', img='/static/images/delay.gif')}}</a>
 	<a href="/depgraph/{{elt.get_full_name()}}" class="mb" title="Impact map of {{elt.get_full_name()}}">{{!helper.get_button('Show impact map', img='/static/images/state_ok.png')}}</a>
-	{{!helper.get_button('Submit Check Result', img='/static/images/passiveonly.gif')}}
-	{{!helper.get_button('Send Custom Notification', img='/static/images/notification.png')}}
-	{{!helper.get_button('Schedule Downtime', img='/static/images/downtime.png')}}
+	%#{{!helper.get_button('Submit Check Result', img='/static/images/passiveonly.gif')}}
+	%#{{!helper.get_button('Send Custom Notification', img='/static/images/notification.png')}}
+	%#{{!helper.get_button('Schedule Downtime', img='/static/images/downtime.png')}}
 
 
 	<div class="clear"></div>
diff --git a/shinken/webui/plugins/system/views/system.tpl b/shinken/webui/plugins/system/views/system.tpl
index 9709801..5cc071a 100644
--- a/shinken/webui/plugins/system/views/system.tpl
+++ b/shinken/webui/plugins/system/views/system.tpl
@@ -8,7 +8,7 @@
 	<div id="nav_left">
 		<ul>
 			<li><a href="/system">System</a></li>
-			<li><a href="/system/log">Log</a></li>
+			%#<li><a href="/system/log">Log</a></li>
 		</ul>
 	</div>
 </div>
diff --git a/test/etc/1r_1h_1s/commands.cfg b/test/etc/define_with_space/commands.cfg
similarity index 100%
copy from test/etc/1r_1h_1s/commands.cfg
copy to test/etc/define_with_space/commands.cfg
diff --git a/test/etc/1r_1h_1s/contacts.cfg b/test/etc/define_with_space/contacts.cfg
similarity index 100%
copy from test/etc/1r_1h_1s/contacts.cfg
copy to test/etc/define_with_space/contacts.cfg
diff --git a/test/etc/1r_1h_1s/hostgroups.cfg b/test/etc/define_with_space/hostgroups.cfg
similarity index 100%
copy from test/etc/1r_1h_1s/hostgroups.cfg
copy to test/etc/define_with_space/hostgroups.cfg
diff --git a/test/etc/check_timeout/hosts.cfg b/test/etc/define_with_space/hosts.cfg
similarity index 96%
copy from test/etc/check_timeout/hosts.cfg
copy to test/etc/define_with_space/hosts.cfg
index eae41e8..5b8e178 100644
--- a/test/etc/check_timeout/hosts.cfg
+++ b/test/etc/define_with_space/hosts.cfg
@@ -35,7 +35,8 @@ define host{
   use                            generic-host
 }
 
-define host{
+#Here we fuckup the define line, Like groundwork is doing....
+define    host   {
   address                        127.0.0.1
   alias                          up_0
   check_command                  check-host-alive-parent!up!$HOSTSTATE:test_router_0$
diff --git a/test/etc/1r_1h_1s/servicegroups.cfg b/test/etc/define_with_space/servicegroups.cfg
similarity index 100%
copy from test/etc/1r_1h_1s/servicegroups.cfg
copy to test/etc/define_with_space/servicegroups.cfg
diff --git a/test/etc/1r_1h_1s/services.cfg b/test/etc/define_with_space/services.cfg
similarity index 100%
copy from test/etc/1r_1h_1s/services.cfg
copy to test/etc/define_with_space/services.cfg
diff --git a/test/etc/1r_1h_1s/shinken-specific.cfg b/test/etc/define_with_space/shinken-specific.cfg
similarity index 100%
copy from test/etc/1r_1h_1s/shinken-specific.cfg
copy to test/etc/define_with_space/shinken-specific.cfg
diff --git a/test/etc/10r_1000h_20000s/timeperiods.cfg b/test/etc/define_with_space/timeperiods.cfg
similarity index 100%
copy from test/etc/10r_1000h_20000s/timeperiods.cfg
copy to test/etc/define_with_space/timeperiods.cfg
diff --git a/test/etc/nagios_1r_1h_1s.cfg b/test/etc/nagios_define_with_space.cfg
similarity index 89%
copy from test/etc/nagios_1r_1h_1s.cfg
copy to test/etc/nagios_define_with_space.cfg
index 1566c73..f115c8c 100644
--- a/test/etc/nagios_1r_1h_1s.cfg
+++ b/test/etc/nagios_define_with_space.cfg
@@ -8,14 +8,14 @@ auto_rescheduling_interval=30
 auto_rescheduling_window=180
 cached_host_check_horizon=15
 cached_service_check_horizon=15
-cfg_file=1r_1h_1s/hosts.cfg
-cfg_file=1r_1h_1s/services.cfg
-cfg_file=1r_1h_1s/contacts.cfg
-cfg_file=1r_1h_1s/commands.cfg
-cfg_file=1r_1h_1s/timeperiods.cfg
-cfg_file=1r_1h_1s/hostgroups.cfg
-cfg_file=1r_1h_1s/servicegroups.cfg
-cfg_file=1r_1h_1s/shinken-specific.cfg
+cfg_file=define_with_space/hosts.cfg
+cfg_file=define_with_space/services.cfg
+cfg_file=define_with_space/contacts.cfg
+cfg_file=define_with_space/commands.cfg
+cfg_file=define_with_space/timeperiods.cfg
+cfg_file=define_with_space/hostgroups.cfg
+cfg_file=define_with_space/servicegroups.cfg
+cfg_file=define_with_space/shinken-specific.cfg
 check_external_commands=1
 check_for_orphaned_hosts=1
 check_for_orphaned_services=1
diff --git a/test/jenkins/longtests.txt b/test/jenkins/longtests.txt
index d713d5f..4e7d407 100644
--- a/test/jenkins/longtests.txt
+++ b/test/jenkins/longtests.txt
@@ -91,6 +91,7 @@ test_no_host_template.py
 test_notif_too_much.py
 test_timeperiods_state_logs.py
 test_groups_with_no_alias.py
+test_define_with_space.py
 test_parse_perfdata.py
 
 # takes long
diff --git a/test/jenkins/shorttests.txt b/test/jenkins/shorttests.txt
index d3b50ee..081ffbb 100644
--- a/test/jenkins/shorttests.txt
+++ b/test/jenkins/shorttests.txt
@@ -98,4 +98,5 @@ test_no_host_template.py
 test_notif_too_much.py
 test_groups_with_no_alias.py
 test_timeperiods_state_logs.py
+test_define_with_space.py
 test_parse_perfdata.py
diff --git a/test/quick_tests.sh b/test/quick_tests.sh
index b7c8100..0165bed 100755
--- a/test/quick_tests.sh
+++ b/test/quick_tests.sh
@@ -136,6 +136,7 @@ launch_and_assert test_no_host_template.py
 launch_and_assert test_groups_with_no_alias.py
 launch_and_assert test_notif_too_much.py
 launch_and_assert test_timeperiods_state_logs.py
+launch_and_assert test_define_with_space.py
 
 launch_and_assert test_maintenance_period.py
 #Live status is a bit longer than the previous, so we put it at the end.
diff --git a/test/test_hostgroup_no_host.py b/test/test_define_with_space.py
similarity index 76%
copy from test/test_hostgroup_no_host.py
copy to test/test_define_with_space.py
index 7d9d412..b56fc70 100755
--- a/test/test_hostgroup_no_host.py
+++ b/test/test_define_with_space.py
@@ -26,16 +26,17 @@
 from shinken_test import *
 
 
-class TestHostGroupNoHost(ShinkenTest):
+class TestDefineWithSpaces(ShinkenTest):
     #Uncomment this is you want to use a specific configuration
     #for your test
     def setUp(self):
-        self.setup_with_file('etc/nagios_hostgroup_no_host.cfg')
+        self.setup_with_file('etc/nagios_define_with_space.cfg')
 
     
-    #Change ME :)
-    def test_hostgroup_wit_no_host(self):
-        self.assert_(self.sched.conf.conf_is_correct)
+    # We got a problem with define    host for example, the type read was "" and not host
+    def testdefine_with_spaces(self):
+        host = self.sched.hosts.find_by_name("test_host_0")
+        self.assert_(host is not None)
 
 
 if __name__ == '__main__':

-- 
UNNAMED PROJECT



More information about the Pkg-nagios-changes mailing list