Change in vdsm[master]: bootstrap: use yum API
Alon Bar-Lev
alonbl at redhat.com
Wed Sep 19 12:54:33 UTC 2012
Alon Bar-Lev has posted comments on this change.
Change subject: bootstrap: use yum API
......................................................................
Patch Set 1: (7 inline comments)
Thanks!
I guess more to follow?
....................................................
File vds_bootstrap/Makefile.am
Line 43: interface2dir=$(vdsmbootstrapdir)/interface-2
Line 44: dist_interface2_SCRIPTS = \
Line 45: vds_bootstrap_complete.py \
Line 46: vds_bootstrap.py \
Line 47: MiniYum.py \
I thought to the name of the class... or class should be lower case also?
Line 48: setup
Line 49:
Line 50: nodist_interface2_SCRIPTS = \
Line 51: deployUtil.py
....................................................
File vds_bootstrap/MiniYum.py
Line 177: )
Line 178:
Line 179: @staticmethod
Line 180: def setup_log_hook(sink=None):
Line 181: """
OK, although I like this better... :)
Line 182: logging hack for yum.
Line 183:
Line 184: Yum packages uses logging package
Line 185: intensively, but we have no clue which
Line 434: return True
Line 435:
Line 436:
Line 437: def main():
Line 438: gluster = False
This is an example, test case, unit test.
Line 439:
Line 440: # BEGIN: PROCESS-INITIALIZATION
Line 441: miniyumsink = myminiyumsink()
Line 442: MiniYum.setup_log_hook(miniyumsink)
Line 443: extraLog = open("/tmp/MiniYum.log", "a")
Line 444: miniyum = MiniYum(sink=miniyumsink, extraLog=extraLog)
Line 445: try:
Line 446: miniyum.selinux_role()
Line 447: except Exception, e:
In production I did not use one. I used the logging with exception dump.
Line 448: print "FAILED: cannot initialize selinux: " + str(e)
Line 449: # END: PROCESS-INITIALIZATION
Line 450:
Line 451: with miniyum:
Line 447: except Exception, e:
Line 448: print "FAILED: cannot initialize selinux: " + str(e)
Line 449: # END: PROCESS-INITIALIZATION
Line 450:
Line 451: with miniyum:
No... each one acquire a new lock, and free this afterwards.
Line 452: miniyum.clean()
Line 453:
Line 454: with miniyum:
Line 455: try:
Line 451: with miniyum:
Line 452: miniyum.clean()
Line 453:
Line 454: with miniyum:
Line 455: try:
This is only an example... each part should go to different real program location.
Line 456: miniyum.remove(('cman',), ignoreErrors=True)
Line 457: miniyum.install(('qemu-kvm-tools',))
Line 458: miniyum.installUpdate(('vdsm', 'vdsm-cli'))
Line 459: if gluster:
....................................................
File vds_bootstrap/vds_bootstrap.py
Line 67: filename=LOGFILE,
Line 68: filemode='w')
Line 69:
Line 70:
Line 71: class myminiyumsink():
I don't understand... You mean the example of usage?
Do you want me to move the example out of the MiniYum.py?
I think it is comfortable to have it there... as it can be run and tested by its own...
Line 72:
Line 73: def __init__(self):
Line 74: """
Line 75: We dup the stdout as during yum operation
--
To view, visit http://gerrit.ovirt.org/8039
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I65796801bc2db7c5abf71c1e9e4ad8ca308138b9
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <alonbl at redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alonbl at redhat.com>
Gerrit-Reviewer: Barak Azulay <bazulay at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Doron Fediuck <dfediuck at redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Pradipta Banerjee <bpradip at in.ibm.com>
Gerrit-Reviewer: Rodrigo Trujillo <trujillo.unicamp at gmail.com>
More information about the vdsm-patches
mailing list