Martin Peřina has posted comments on this change.

Change subject: kdump: Add kdump plugin
......................................................................


Patch Set 2:

(3 comments)

You wrote in ps1 this simpler logic:
 1. read original arguments comment
 2. put original arguments within comment if no (1)
 3. put our own

So here are use cases for each option, because handling is different
(rest of the orig file is copied into new one):

 I. fence_kdump_nodes option

  1. Original content: without fence_kdump_options
     New content:
       fence_kdump_nodes DESTINATION_ADDRESS

  2. Original content:
       fence_kdump_nodes node1 node2

     New content:
       # oVirt backup: fence_kdump_nodes node1 node2
       fence_kdump_nodes node1 node2 DESTINATION_ADDRESS

  2. Original content:
       fence_kdump_nodes node1 node2 DESTINATION_ADDRESS

     New content:
       fence_kdump_nodes node1 node2 DESTINATION_ADDRESS

  3. Original content
       # oVirt backup: fence_kdump_nodes node1
       fence_kdump_nodes node1 node2 node3

     New content:
       # oVirt backup: fence_kdump_nodes node1
       fence_kdump_nodes node1 node2 node3 DESTINATION_ADDRESS


 II. fence_kdump_args option

  1. Original content: without fence_kdump_args
     New content:
       fence_kdump_args -p DESTINATION_PORT -i MESSAGE_INTERVAL

  2. Original content
       fence_kdump_args -p DESTINATION_PORT -i MESSAGE_INTERVAL

     New content:
       fence_kdump_args -p DESTINATION_PORT -i MESSAGE_INTERVAL

  3. Original content:
       fence_kdump_args -p 7411

     New content:
       # oVirt backup: fence_kdump_args -p 7411
       fence_kdump_args -p DESTINATION_PORT -i MESSAGE_INTERVAL

  4. Original content:
       # oVirt backup: fence_kdump_args -p 7411
       fence_kdump_args -f auto

     New content:
       # oVirt backup: fence_kdump_args -p 7411
       fence_kdump_args -p DESTINATION_PORT -i MESSAGE_INTERVAL

  5. Original content:
       fence_kdump_args -p DESTINATION_PORT -i MESSAGE_INTERVAL -f auto

     New content:
       # oVirt backup: fence_kdump_args -p DESTINATION_PORT -i MESSAGE_INTERVAL 
-f auto
       fence_kdump_args -p DESTINATION_PORT -i MESSAGE_INTERVAL

http://gerrit.ovirt.org/#/c/28385/2/src/plugins/ovirt-host-deploy/kdump/packages.py
File src/plugins/ovirt-host-deploy/kdump/packages.py:

Line 56:     _FK_OPTS_REGEX = re.compile(
Line 57:         flags=re.VERBOSE,
Line 58:         pattern=r"""
Line 59:             ^
Line 60:             (?P<key>(\#\ oVirt\ backup\:\ )?fence_kdump_(nodes|args))
> I do not understand why you parse the comment...
I need to know, if we already created backup of our changes or not. And our 
backup are commented lines started with '# oVirt backup: ' string.
Line 61:             [ ]
Line 62:             (?P<value>.*)
Line 63:             $
Line 64:         """


Line 57:         flags=re.VERBOSE,
Line 58:         pattern=r"""
Line 59:             ^
Line 60:             (?P<key>(\#\ oVirt\ backup\:\ )?fence_kdump_(nodes|args))
Line 61:             [ ]
> \s
Well, kexec-tools internal parsing requires space char between option and value 
...
Line 62:             (?P<value>.*)
Line 63:             $
Line 64:         """
Line 65:     )


Line 306:         with open(odeploycons.FileLocations.KDUMP_CONFIG_FILE, 'r') 
as f:
Line 307:             content = f.read().splitlines()
Line 308:         new_content = self._update_kdump_conf(content)
Line 309:         if content != new_content:
Line 310:             self.environment[
> actually, there is no problem to perform transaction if content was not mod
OK, I copied and pasted from gluster plugin, so can fixed also there ...
Line 311:                 otopicons.CoreEnv.MAIN_TRANSACTION
Line 312:             ].append(
Line 313:                 filetransaction.FileTransaction(
Line 314:                     name=odeploycons.FileLocations.KDUMP_CONFIG_FILE,


-- 
To view, visit http://gerrit.ovirt.org/28385
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Idda48cb053c7e8747de5434c3681403f739c06b1
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-host-deploy
Gerrit-Branch: master
Gerrit-Owner: Martin Peřina <mper...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Barak Azulay <bazu...@redhat.com>
Gerrit-Reviewer: Martin Peřina <mper...@redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to