From f49cf0a89a1b49bf3536f7f34595146d0f4d6924 Mon Sep 17 00:00:00 2001
From: Rafael Monnerat <rafael@nexedi.com>
Date: Tue, 19 Aug 2014 18:12:24 +0200
Subject: [PATCH] slapos_crm: Remove unneed alarm

Test if allocation works is a job of a Test Agent Instance, because there is not a user that should be assigned to handle it in reality.
---
 .../slapos_check_cloud_is_full.xml            | 103 ------------------
 .../Alarm_checkCloudIsFull.xml                |  82 --------------
 .../SoftwareRelease_testForAllocation.xml     |  93 ----------------
 master/bt5/slapos_crm/bt/revision             |   2 +-
 master/bt5/slapos_crm/bt/template_path_list   |   1 -
 5 files changed, 1 insertion(+), 280 deletions(-)
 delete mode 100644 master/bt5/slapos_crm/PathTemplateItem/portal_alarms/slapos_check_cloud_is_full.xml
 delete mode 100644 master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_checkCloudIsFull.xml
 delete mode 100644 master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SoftwareRelease_testForAllocation.xml

diff --git a/master/bt5/slapos_crm/PathTemplateItem/portal_alarms/slapos_check_cloud_is_full.xml b/master/bt5/slapos_crm/PathTemplateItem/portal_alarms/slapos_check_cloud_is_full.xml
deleted file mode 100644
index 7529fddeb..000000000
--- a/master/bt5/slapos_crm/PathTemplateItem/portal_alarms/slapos_check_cloud_is_full.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="Alarm" module="erp5.portal_type"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>active_sense_method_id</string> </key>
-            <value> <string>Alarm_checkCloudIsFull</string> </value>
-        </item>
-        <item>
-            <key> <string>description</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>enabled</string> </key>
-            <value> <int>0</int> </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>slapos_check_cloud_is_full</string> </value>
-        </item>
-        <item>
-            <key> <string>periodicity_hour</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-        <item>
-            <key> <string>periodicity_hour_frequency</string> </key>
-            <value> <int>1</int> </value>
-        </item>
-        <item>
-            <key> <string>periodicity_minute</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-        <item>
-            <key> <string>periodicity_minute_frequency</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>periodicity_month</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-        <item>
-            <key> <string>periodicity_month_day</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-        <item>
-            <key> <string>periodicity_start_date</string> </key>
-            <value>
-              <object>
-                <klass>
-                  <global name="DateTime" module="DateTime.DateTime"/>
-                </klass>
-                <tuple>
-                  <none/>
-                </tuple>
-                <state>
-                  <tuple>
-                    <float>1377608640.0</float>
-                    <string>GMT</string>
-                  </tuple>
-                </state>
-              </object>
-            </value>
-        </item>
-        <item>
-            <key> <string>periodicity_week</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-        <item>
-            <key> <string>portal_type</string> </key>
-            <value> <string>Alarm</string> </value>
-        </item>
-        <item>
-            <key> <string>sense_method_id</string> </key>
-            <value>
-              <none/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string>Check if vifib cloud is full</string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_checkCloudIsFull.xml b/master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_checkCloudIsFull.xml
deleted file mode 100644
index 01eab2cac..000000000
--- a/master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_checkCloudIsFull.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>Script_magic</string> </key>
-            <value> <int>3</int> </value>
-        </item>
-        <item>
-            <key> <string>_bind_names</string> </key>
-            <value>
-              <object>
-                <klass>
-                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
-                </klass>
-                <tuple/>
-                <state>
-                  <dictionary>
-                    <item>
-                        <key> <string>_asgns</string> </key>
-                        <value>
-                          <dictionary>
-                            <item>
-                                <key> <string>name_container</string> </key>
-                                <value> <string>container</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_context</string> </key>
-                                <value> <string>context</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_m_self</string> </key>
-                                <value> <string>script</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_subpath</string> </key>
-                                <value> <string>traverse_subpath</string> </value>
-                            </item>
-                          </dictionary>
-                        </value>
-                    </item>
-                  </dictionary>
-                </state>
-              </object>
-            </value>
-        </item>
-        <item>
-            <key> <string>_body</string> </key>
-            <value> <string>portal = context.getPortalObject()\n
-\n
-software_release_preference = portal.portal_preferences.getPreferredSoftwareReleaseToTestForSpace()\n
-\n
-if software_release_preference != \'\':\n
-  software_release_list = software_release_preference.split("\\n")\n
-\n
-  portal.portal_catalog.searchAndActivate(\n
-    portal_type = \'Software Release\',\n
-    url_string = software_release_list,\n
-\n
-    method_id = \'SoftwareRelease_testForAllocation\',\n
-    activate_kw = {\'tag\':tag}  \n
-  )\n
-\n
-context.activate(after_tag=tag).getId()\n
-</string> </value>
-        </item>
-        <item>
-            <key> <string>_params</string> </key>
-            <value> <string>tag, fixit, params</string> </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>Alarm_checkCloudIsFull</string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SoftwareRelease_testForAllocation.xml b/master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SoftwareRelease_testForAllocation.xml
deleted file mode 100644
index db64f9e72..000000000
--- a/master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SoftwareRelease_testForAllocation.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>Script_magic</string> </key>
-            <value> <int>3</int> </value>
-        </item>
-        <item>
-            <key> <string>_bind_names</string> </key>
-            <value>
-              <object>
-                <klass>
-                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
-                </klass>
-                <tuple/>
-                <state>
-                  <dictionary>
-                    <item>
-                        <key> <string>_asgns</string> </key>
-                        <value>
-                          <dictionary>
-                            <item>
-                                <key> <string>name_container</string> </key>
-                                <value> <string>container</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_context</string> </key>
-                                <value> <string>context</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_m_self</string> </key>
-                                <value> <string>script</string> </value>
-                            </item>
-                            <item>
-                                <key> <string>name_subpath</string> </key>
-                                <value> <string>traverse_subpath</string> </value>
-                            </item>
-                          </dictionary>
-                        </value>
-                    </item>
-                  </dictionary>
-                </state>
-              </object>
-            </value>
-        </item>
-        <item>
-            <key> <string>_body</string> </key>
-            <value> <string>portal = context.getPortalObject()\n
-software_release = context\n
-software_release_url = software_release.getUrlString()\n
-\n
-user = portal.person_module.allocation_tester\n
-\n
-result = user.Person_restrictMethodAsShadowUser(\n
-        shadow_document=user,\n
-        callable_object=user.Person_findPartition,\n
-        argument_list=[\n
-          software_release_url,\n
-          \'\',\n
-          \'Software Instance\',\n
-          {}\n
-        ],\n
-        argument_dict={\n
-          \'test_mode\': True})\n
-\n
-if not result:\n
-  title = "Can\'t allocate new instances for software release %s" % software_release_url\n
-  description = "Need more public computers that can instanciate the software release %s" % software_release_url\n
-\n
-  return software_release.Base_generateSupportRequestForSlapOS(\n
-    title,\n
-    description,\n
-    software_release.getRelativeUrl()\n
-  )\n
-</string> </value>
-        </item>
-        <item>
-            <key> <string>_params</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>SoftwareRelease_testForAllocation</string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/master/bt5/slapos_crm/bt/revision b/master/bt5/slapos_crm/bt/revision
index c5b431b6c..7003e7fe1 100644
--- a/master/bt5/slapos_crm/bt/revision
+++ b/master/bt5/slapos_crm/bt/revision
@@ -1 +1 @@
-50
\ No newline at end of file
+51
\ No newline at end of file
diff --git a/master/bt5/slapos_crm/bt/template_path_list b/master/bt5/slapos_crm/bt/template_path_list
index 82bd891c8..52f9a2856 100644
--- a/master/bt5/slapos_crm/bt/template_path_list
+++ b/master/bt5/slapos_crm/bt/template_path_list
@@ -1,6 +1,5 @@
 event_module/slapos_crm_web_message_template
 person_module/allocation_tester
-portal_alarms/slapos_check_cloud_is_full
 portal_alarms/slapos_check_computer_state
 portal_alarms/slapos_check_software_instance_state
 portal_alarms/slapos_crm_cancel_invoice
-- 
2.30.9