On 5/8/06, linux-ha-cvs@lists.linux-ha.org
<linux-ha-cvs@lists.linux-ha.org> wrote:
linux-ha CVS committal

Author  : andrew
Host    :
Project : linux-ha
Module  : crm

Dir     : linux-ha/crm/pengine


Modified Files:
        complex.c


Log Message:
If target_role is set to anything other than "default", then any previous
  value for is_managed (either for the resource or the global default) is
  ignored.
Resources that are badly messed up may still be "automatically" marked as
  unmanaged - we may look at changing this in the future.
This should make adding resources and debuging RAs slightly easier.

Zhenh, for the GUI to take advantage of this it needs three options:

Stop : target_role = Stopped
Start : target_role = Started
Automatic : target_role = default (or delete the target_role nvpair
completely which I believe is what you do now.)

Automatic will basically leave it up to the CRM to decide if the
resource should be started.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/complex.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -3 -r1.84 -r1.85
--- complex.c   5 May 2006 13:08:49 -0000       1.84
+++ complex.c   8 May 2006 07:36:01 -0000       1.85
@@ -1,4 +1,4 @@
-/* $Id: complex.c,v 1.84 2006/05/05 13:08:49 andrew Exp $ */
+/* $Id: complex.c,v 1.85 2006/05/08 07:36:01 andrew Exp $ */
 /*
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  *
@@ -296,15 +296,7 @@
        if(value != NULL && safe_str_neq("default", value)) {
                cl_str_to_boolean(value, &((*rsc)->is_managed));
        }
-       if((*rsc)->is_managed == FALSE) {
-               crm_warn("Resource %s is currently not managed", (*rsc)->id);

-       } else if(data_set->symmetric_cluster) {
-               rsc_to_node_t *new_con = rsc2node_new(
-                       "symmetric_default", *rsc, 0, NULL, data_set);
-               new_con->node_list_rh = node_list_dup(data_set->nodes, FALSE);
-       }
-
        crm_debug_2("Options for %s", (*rsc)->id);
        value = g_hash_table_lookup((*rsc)->parameters, "globally_unique");
        if(value != NULL) {
@@ -361,7 +353,8 @@
        value = g_hash_table_lookup(
                (*rsc)->parameters, XML_RSC_ATTR_TARGET_ROLE);

-       if(value != NULL) {
+       if(value != NULL && safe_str_neq("default", value)) {
+               (*rsc)->is_managed = TRUE;
                (*rsc)->next_role = text2role(value);
                if((*rsc)->next_role == RSC_ROLE_UNKNOWN) {
                        pe_config_err("%s: Unknown value for "
@@ -375,6 +368,15 @@
        crm_debug_2("\tDesired next state: %s",
                    
(*rsc)->next_role!=RSC_ROLE_UNKNOWN?role2text((*rsc)->next_role):"default");

+       if((*rsc)->is_managed == FALSE) {
+               crm_warn("Resource %s is currently not managed", (*rsc)->id);
+
+       } else if(data_set->symmetric_cluster) {
+               rsc_to_node_t *new_con = rsc2node_new(
+                       "symmetric_default", *rsc, 0, NULL, data_set);
+               new_con->node_list_rh = node_list_dup(data_set->nodes, FALSE);
+       }
+
        crm_debug_2("\tNotification of start/stop actions: %s",
                    (*rsc)->notify?"required":"not required");



_______________________________________________
Linux-ha-cvs mailing list
Linux-ha-cvs@lists.linux-ha.org
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to