On Mon, Aug 26, 2013 at 3:53 PM, Thomas Thrainer <[email protected]>wrote:

>
>
>
> On Thu, Aug 22, 2013 at 10:16 AM, Helga Velroyen <[email protected]>wrote:
>
>> This change makes sure that 'gnt-cluster verify' only
>> checks for the DRBD usermode helper, if DRBD is actually
>> enabled.
>>
>> Signed-off-by: Helga Velroyen <[email protected]>
>> ---
>>  lib/cmdlib/cluster.py | 37 ++++++++++++++++++++++---------------
>>  1 file changed, 22 insertions(+), 15 deletions(-)
>>
>> diff --git a/lib/cmdlib/cluster.py b/lib/cmdlib/cluster.py
>> index 858ccff..b563409 100644
>> --- a/lib/cmdlib/cluster.py
>> +++ b/lib/cmdlib/cluster.py
>> @@ -2282,17 +2282,8 @@ class LUClusterVerifyGroup(LogicalUnit,
>> _VerifyErrors):
>>                      "File %s found with %s different checksums (%s)",
>>                      filename, len(checksums), "; ".join(variants))
>>
>> -  def _VerifyNodeDrbd(self, ninfo, nresult, instanceinfo, drbd_helper,
>> -                      drbd_map):
>> -    """Verifies and the node DRBD status.
>> -
>> -    @type ninfo: L{objects.Node}
>> -    @param ninfo: the node to check
>> -    @param nresult: the remote results for the node
>> -    @param instanceinfo: the dict of instances
>> -    @param drbd_helper: the configured DRBD usermode helper
>> -    @param drbd_map: the DRBD map as returned by
>> -        L{ganeti.config.ConfigWriter.ComputeDRBDMap}
>> +  def _VerifyNodeDrbdHelper(self, drbd_helper, nresult, ninfo):
>>
>
> NIT: Most methods take `ninfo` as first parameter, then `nresult`, then
> the rest as far as I can see...
>

Sure, FYI interdiff:

diff --git a/lib/cmdlib/cluster.py b/lib/cmdlib/cluster.py
index b563409..4886a47 100644
--- a/lib/cmdlib/cluster.py
+++ b/lib/cmdlib/cluster.py
@@ -2282,7 +2282,7 @@ class LUClusterVerifyGroup(LogicalUnit,
_VerifyErrors):
                     "File %s found with %s different checksums (%s)",
                     filename, len(checksums), "; ".join(variants))

-  def _VerifyNodeDrbdHelper(self, drbd_helper, nresult, ninfo):
+  def _VerifyNodeDrbdHelper(self, ninfo, nresult, drbd_helper):
     """Verify the drbd helper.

     """
@@ -2313,7 +2313,7 @@ class LUClusterVerifyGroup(LogicalUnit,
_VerifyErrors):
         L{ganeti.config.ConfigWriter.ComputeDRBDMap}

     """
-    self._VerifyNodeDrbdHelper(drbd_helper, nresult, ninfo)diff --git
a/lib/cmdlib/cluster.py b/lib/cmdlib/cluster.py
index b563409..4886a47 100644
--- a/lib/cmdlib/cluster.py
+++ b/lib/cmdlib/cluster.py
@@ -2282,7 +2282,7 @@ class LUClusterVerifyGroup(LogicalUnit,
_VerifyErrors):
                     "File %s found with %s different checksums (%s)",
                     filename, len(checksums), "; ".join(variants))

-  def _VerifyNodeDrbdHelper(self, drbd_helper, nresult, ninfo):
+  def _VerifyNodeDrbdHelper(self, ninfo, nresult, drbd_helper):
     """Verify the drbd helper.

     """
@@ -2313,7 +2313,7 @@ class LUClusterVerifyGroup(LogicalUnit,
_VerifyErrors):
         L{ganeti.config.ConfigWriter.ComputeDRBDMap}

     """
-    self._VerifyNodeDrbdHelper(drbd_helper, nresult, ninfo)
+    self._VerifyNodeDrbdHelper(ninfo, nresult, drbd_helper)

     # compute the DRBD minors
     node_drbd = {}

+    self._VerifyNodeDrbdHelper(ninfo, nresult, drbd_helper)

     # compute the DRBD minors
     node_drbd = {}



>
>
>> +    """Verify the drbd helper.
>>
>>      """
>>      if drbd_helper:
>> @@ -2309,6 +2300,21 @@ class LUClusterVerifyGroup(LogicalUnit,
>> _VerifyErrors):
>>          self._ErrorIf(test, constants.CV_ENODEDRBDHELPER, ninfo.name,
>>                        "wrong drbd usermode helper: %s", payload)
>>
>> +  def _VerifyNodeDrbd(self, ninfo, nresult, instanceinfo, drbd_helper,
>> +                      drbd_map):
>> +    """Verifies and the node DRBD status.
>> +
>> +    @type ninfo: L{objects.Node}
>> +    @param ninfo: the node to check
>> +    @param nresult: the remote results for the node
>> +    @param instanceinfo: the dict of instances
>> +    @param drbd_helper: the configured DRBD usermode helper
>> +    @param drbd_map: the DRBD map as returned by
>> +        L{ganeti.config.ConfigWriter.ComputeDRBDMap}
>> +
>> +    """
>> +    self._VerifyNodeDrbdHelper(drbd_helper, nresult, ninfo)
>> +
>>      # compute the DRBD minors
>>      node_drbd = {}
>>      for minor, inst_uuid in drbd_map[ninfo.uuid].items():
>> @@ -2848,10 +2854,11 @@ class LUClusterVerifyGroup(LogicalUnit,
>> _VerifyErrors):
>>        node_verify_param[constants.NV_LVLIST] = vg_name
>>        node_verify_param[constants.NV_PVLIST] = [vg_name]
>>
>> -    if drbd_helper:
>> -      node_verify_param[constants.NV_DRBDVERSION] = None
>> -      node_verify_param[constants.NV_DRBDLIST] = None
>> -      node_verify_param[constants.NV_DRBDHELPER] = drbd_helper
>> +    if cluster.IsDiskTemplateEnabled(constants.DT_DRBD8):
>> +      if drbd_helper:
>> +        node_verify_param[constants.NV_DRBDVERSION] = None
>> +        node_verify_param[constants.NV_DRBDLIST] = None
>> +        node_verify_param[constants.NV_DRBDHELPER] = drbd_helper
>>
>>      if cluster.IsFileStorageEnabled() or \
>>          cluster.IsSharedFileStorageEnabled():
>> --
>> 1.8.3
>>
>>
> Rest LGTM, thanks.
>

Thx.

Helga

Reply via email to