+++ /dev/null
-HOW TO CONTRIBUTE TO THE OVIRT MANAGED NODE
-===========================================
-
-Please read: http://ovirt.org/wiki/Contributing_to_the_Node_project
 
+++ /dev/null
-                   GNU GENERAL PUBLIC LICENSE
-                      Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                           Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                   GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-                           NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-                    END OF TERMS AND CONDITIONS
-
-           How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License along
-    with this program; if not, write to the Free Software Foundation, Inc.,
-    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
 
+++ /dev/null
-CHANGELOG
-=========
-
-Version 1.9.3:
- * Removed HAL dependencies from the firstboot scripts.
-
-Version 1.9.2:
- * Fixed the autoconf setup to cover more prerequisites.
-
-Version 1.9.1:
- * Update ovirt-process-config to fail configs that are missing the field name
-   or value.
- * Updated build system will use Fedora 13 as the rawhide repo.
- * Fixed ovirt-config-networking to not report success when network start fails.
- * Reboot hangs on /etc [FIXED].
- * Multipath translation performance improvements.
- * Cleanup ROOTDRIVE when partitioning.
- * Fix hang when cleaning dirty storage.
- * The order of the oVirt SysVInit scripts has been changed.
-   - ovirt-early -> ovirt-awake -> ovirt -> ovirt-post
- * Fixes to the SysVINit scripts to name lifecycle methods propery.
- * Added psmisc package.
- * Added default KEYTAB_FILE name to /etc/sysconfig/node-config.
- * Fixes to the persist and unpersist commands to handle already persisted
-   files and directories.
- * Duplicate NTP/DNS entries are rejected during network setup.
-
-Version 1.9.0:
- * Created a reference implementation for a 2.0 management server.
 
+++ /dev/null
-# Copyright (C) 2008 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-OVIRT_CACHE_DIR        ?= $(HOME)/ovirt-cache
-
-SUBDIRS =   \
-  augeas \
-  dracut \
-  images \
-  kinit \
-  recipe \
-  scripts
-
-EXTRA_DIST = \
-  ovirt-qla4xxx.conf \
-  vlan.modules \
-  libvirtd.service \
-  libvirtd.upstart \
-  ovirt-node.spec \
-  ovirt-node.spec.in \
-  logrotate/ovirt-logrotate \
-  logrotate/ovirt-logrotate.conf
-
-DISTCLEANFILES = $(PACKAGE)-$(VERSION).tar.gz
-
-# For Release: 0..., set _ovirt_dev=1 so that we get extra_release.GIT-
-# annotated rpm version strings.
-_ovirt_dev = \
- $(shell grep -q '^[[:space:]]*Release:[[:space:]]*0' \
-   $(srcdir)/*.spec.in && echo 1 || :)
-
-git_head       = $$(git log -1 --pretty=format:%h)
-GIT_RELEASE    = $$(date --utc +%Y%m%d%H%M%S)git$(git_head)
-RPMDIR         = $$(rpm --eval '%{_rpmdir}')
-RPM_FLAGS      = --define "ovirt_cache_dir $(OVIRT_CACHE_DIR)"
-RPM_FLAGS      += $(if $(_ovirt_dev),--define "extra_release .$(GIT_RELEASE)")
-
-rpms: dist
-       rpmbuild $(RPM_FLAGS) -ta $(distdir).tar.gz
-
-srpms: dist
-       rpmbuild $(RPM_FLAGS) -ts $(distdir).tar.gz
-
-publish: rpms
-       mkdir -p $(OVIRT_CACHE_DIR)
-       rsync -aq $(shell rpm --eval '%{_rpmdir}')/ $(OVIRT_CACHE_DIR)/ovirt/
-       rsync -aq $(shell rpm --eval '%{_srcrpmdir}')/ $(OVIRT_CACHE_DIR)/ovirt/src
-       createrepo $(OVIRT_CACHE_DIR)/ovirt
-
-.PHONY: rpms publish srpms
 
-Some notes on node image deployment
-
-Nodes are provided in ISO format.  These ISO images can be deployed by either:
-1. Writing the image to a CD
-2. Writing the image to USB flash using livecd-iso-to-disk utility
-3. Creating pxe bootable files using livecd-iso-to-pxeboot utility
-
-To burn a Node image to a usb stick accessible as /dev/sdb:
-livecd-iso-to-disk --format /usr/share/ovirt-node-image/ovirt-node-image.iso /dev/sdb
-
-To create vmlinuz and initrd images suitable for pxe booting:
-livecd-iso-to-pxeboot /usr/share/ovirt-node-image/ovirt-node-image.iso
-
-The output of livecd-iso-to-pxeboot is a directory called tftpboot that has the
-following files in it:
-./pxelinux.0
-./pxelinux.cfg/default
-./vmlinuz0
-./initrd0.img
-
-The vmlinuz0/initrd0.img files can be imported into a cobbler server or any
-other PXE/tftp server.  pxelinux.cfg/default provides a template for
-configuring the pxe server to export the Node image:
-
-DEFAULT pxeboot
-TIMEOUT 20
-PROMPT 0
-LABEL pxeboot
-      KERNEL vmlinuz0
-      APPEND rootflags=loop initrd=initrd0.img root=/ovirt-node-image.iso rootfstype=auto ro liveimg check rootfstype=iso9660 elevator=deadline
-ONERROR LOCALBOOT 0
-
-In addition, PXE booted Nodes rely on the PXE server passing the mac address
-of the pxe interface to the kernel.  This is provided by using the IPAPPEND 2
-parameter as follows:
-
-DEFAULT pxeboot
-TIMEOUT 20
-PROMPT 0
-LABEL pxeboot
-      KERNEL vmlinuz0
-      IPAPPEND 2
-      APPEND rootflags=loop initrd=initrd0.img root=/ovirt-node-image.iso rootfstype=auto ro liveimg check rootfstype=iso9660 elevator=deadline
-ONERROR LOCALBOOT 0
-
+This repo is no longer used.  The repo has moved to gerrit.ovirt.org.
+
+Thanks
+
+The oVirt Node Team
 
+++ /dev/null
-BACKLOG OF FEATURES
-===================
-
-You can find the development backlog here:
-
-https://fedorahosted.org/ovirt/wiki/Backlog
 
+++ /dev/null
-# Copyright (C) 2010 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-EXTRA_DIST = \
-  build.aug \
-  resolv.aug \
-  util.aug
 
+++ /dev/null
-(*
-Module: Build
-   Generic functions to build lenses
-
-Author: Raphael Pinson <
[email protected]>
-
-About: License
-  This file is licensed under the LGPLv2+, like the rest of Augeas.
-
-About: Reference
-  This file provides generic functions to build Augeas lenses
-*)
-
-
-module Build =
-
-let eol = Util.eol
-
-(************************************************************************
- * Group:               GENERIC CONSTRUCTIONS
- ************************************************************************)
-
-(************************************************************************
- * View: brackets
- *   Put a lens inside brackets
- *
- *   Parameters:
- *     l:lens   - the left bracket lens
- *     r: lens  - the right bracket lens
- *     lns:lens - the lens to put inside brackets
- ************************************************************************)
-let brackets (l:lens) (r:lens) (lns:lens) = l . lns . r
-
-
-(************************************************************************
- * Group:             LIST CONSTRUCTIONS
- ************************************************************************)
-
-(************************************************************************
- * View: list
- *   Build a list of identical lenses separated with a given separator
- *   (at least 2 elements)
- *
- *   Parameters:
- *     lns:lens - the lens to repeat in the list
- *     sep:lens - the separator lens, which can be taken from the <Sep> module
- ************************************************************************)
-let list (lns:lens) (sep:lens) = lns . ( sep . lns )+
-
-
-(************************************************************************
- * View: opt_list
- *   Same as <list>, but there might be only one element in the list
- *
- *   Parameters:
- *     lns:lens - the lens to repeat in the list
- *     sep:lens - the separator lens, which can be taken from the <Sep> module
- ************************************************************************)
-let opt_list (lns:lens) (sep:lens) = lns . ( sep . lns )*
-
-
-(************************************************************************
- * Group:                   LABEL OPERATIONS
- ************************************************************************)
-
-(************************************************************************
- * View: xchg
- *   Replace a pattern with a different label in the tree,
- *   thus emulating a key but allowing to replace the keyword
- *   with a different value than matched
- *
- *   Parameters:
- *     m:regexp - the pattern to match
- *     d:string - the default value when a node in created
- *     l:string - the label to apply for such nodes
- ************************************************************************)
-let xchg (m:regexp) (d:string) (l:string) = del m d . label l
-
-(************************************************************************
- * View: xchgs
- *   Same as <xchg>, but the pattern is the default string
- *
- *   Parameters:
- *     m:string - the string to replace, also used as default
- *     l:string - the label to apply for such nodes
- ************************************************************************)
-let xchgs (m:string) (l:string) = xchg m m l
-
-
-(************************************************************************
- * Group:                   SUBNODE CONSTRUCTIONS
- ************************************************************************)
-
-(************************************************************************
- * View: key_value_line
- *   A subnode with a keyword, a separator and a storing lens,
- *   and an end of line
- *
- *   Parameters:
- *     kw:regexp - the pattern to match as key
- *     sep:lens  - the separator lens, which can be taken from the <Sep> module
- *     sto:lens  - the storing lens
- ************************************************************************)
-let key_value_line (kw:regexp) (sep:lens) (sto:lens) =
-                                   [ key kw . sep . sto . eol ]
-
-(************************************************************************
- * View: key_value_line_comment
- *   Same as <key_value_line>, but allows to have a comment in the end of a line
- *   and an end of line
- *
- *   Parameters:
- *     kw:regexp    - the pattern to match as key
- *     sep:lens     - the separator lens, which can be taken from the <Sep> module
- *     sto:lens     - the storing lens
- *     comment:lens - the comment lens, which can be taken from <Util>
- ************************************************************************)
-let key_value_line_comment (kw:regexp) (sep:lens) (sto:lens) (comment:lens) =
-                                   [ key kw . sep . sto . (eol|comment) ]
-
-(************************************************************************
- * View: key_value
- *   Same as <key_value_line>, but does not end with an end of line
- *
- *   Parameters:
- *     kw:regexp - the pattern to match as key
- *     sep:lens  - the separator lens, which can be taken from the <Sep> module
- *     sto:lens  - the storing lens
- ************************************************************************)
-let key_value (kw: regexp) (sep:lens) (sto:lens) =
-                                   [ key kw . sep . sto ]
-
-(************************************************************************
- * View: flag
- *   A simple flag subnode, consisting of a single key
- *
- *   Parameters:
- *     kw:regexp - the pattern to match as key
- ************************************************************************)
-let flag (kw:regexp) = [ key kw ]
-
 
+++ /dev/null
-(*
-Module: Resolv
-  Parses /etc/resolv.conf
-
-Author: Raphael Pinson <
[email protected]>
-
-About: Reference
-  This lens tries to keep as close as possible to `man resolv.conf` where possible.
-
-About: Licence
-  This file is licensed under the LGPLv2+, like the rest of Augeas.
-
-About: Lens Usage
-
-About: Configuration files
-  This lens applies to /etc/resolv.conf. See <filter>.
-*)
-
-module Resolv =
-autoload xfm
-
-(************************************************************************
- * Group:                 USEFUL PRIMITIVES
- *************************************************************************)
-
-(* View: comment *)
-let comment = Util.comment_generic /[ \t]*[;#][ \t]*/ "# "
-
-(* View: empty *)
-let empty = Util.empty
-
-
-(************************************************************************
- * Group:                 MAIN OPTIONS
- *************************************************************************)
-
-(* View: netmask
-A network mask for IP addresses *)
-let netmask = [ label "netmask" . Util.del_str "/" . store Rx.ip ]
-
-(* View: ipaddr 
-An IP address or range with an optional mask *) 
-let ipaddr = [label "ipaddr" . store Rx.ip . netmask?]
-
-
-(* View: nameserver
-     A nameserver entry *)
-let nameserver = Build.key_value_line 
-                    "nameserver" Sep.space (store Rx.ip)
-
-(* View: domain *)
-let domain = Build.key_value_line
-                    "domain" Sep.space (store Rx.word)
-
-(* View: search *)
-let search = Build.key_value_line
-                    "search" Sep.space
-                    (Build.opt_list 
-                           [label "domain" . store Rx.word]
-                            Sep.space)
-
-(* View: sortlist *)
-let sortlist = Build.key_value_line
-                    "sortlist" Sep.space
-                    (Build.opt_list
-                           ipaddr
-                           Sep.space) 
-
-(************************************************************************
- * Group:                 SPECIAL OPTIONS
- *************************************************************************)
-
-(* View: ip6_dotint
-     ip6-dotint option, which supports negation *)
-let ip6_dotint = 
-  let negate = [ del "no-" "no-" . label "negate" ]
-    in [ negate? . key "ip6-dotint" ]
-
-(* View: options 
-     Options values *)
-let options =
-      let options_entry = Build.key_value ("ndots"|"timeout"|"attempts") 
-                                          (Util.del_str ":") (store Rx.integer)
-                        | Build.flag ("debug"|"rotate"|"no-check-names"
-                                     |"inet6"|"ip6-bytestring"|"edns0")
-                        | ip6_dotint
-
-            in Build.key_value_line
-                    "options" Sep.space
-                    (Build.opt_list
-                           options_entry
-                           Sep.space)
-
-(* View: entry *)
-let entry = nameserver
-          | domain
-          | search
-          | sortlist
-          | options
-
-(* View: lns *)
-let lns = ( empty | comment | entry )*
-
-(* Variable: filter *)
-let filter = (incl "/etc/resolv.conf")
-    . Util.stdexcl
-
-let xfm = transform lns filter
-
 
+++ /dev/null
-(*
-Module: Util
-  Generic module providing useful primitives
-
-Author: David Lutterkort
-
-About: License
-  This file is licensed under the LGPLv2+, like the rest of Augeas.
-*)
-
-
-module Util =
-
-
-(*
-Variable: del_str
-  Delete a string and default to it
-
-  Parameters:
-     s:string - the string to delete and default to
-*)
-  let del_str (s:string) = del s s
-
-(*
-Variable: del_ws
-  Delete mandatory whitespace
-*)
-  let del_ws = del /[ \t]+/
-
-(*
-Variable: del_ws_spc
-  Delete mandatory whitespace, default to single space
-*)
-  let del_ws_spc = del_ws " "
-
-(*
-Variable: del_ws_tab
-  Delete mandatory whitespace, default to single tab
-*)
-  let del_ws_tab = del_ws "\t"
-
-
-(*
-Variable: del_opt_ws
-  Delete optional whitespace
-*)
-  let del_opt_ws = del /[ \t]*/
-
-
-(*
-Variable: eol
-  Delete end of line, including optional trailing whitespace
-*)
-  let eol = del /[ \t]*\n/ "\n"
-
-(*
-Variable: indent
-  Delete indentation, including leading whitespace
-*)
-  let indent = del /[ \t]*/ ""
-
-(* Group: Comment
-     This is a general definition of comment
-     It allows indentation for comments, removes the leading and trailing spaces
-     of comments and stores them in nodes, except for empty comments which are
-     ignored together with empty lines
-
-View: comment_generic
-  Map comments and set default comment sign
-*)
-
-  let comment_generic (r:regexp) (d:string) =
-    [ label "#comment" . del r d
-        . store /([^ \t\n].*[^ \t\n]|[^ \t\n])/ . eol ]
-
-(* View: comment
-  Map comments into "#comment" nodes
-*)
-  let comment = comment_generic /[ \t]*#[ \t]*/ "# "
-
-(* View: comment_eol
-  Map eol comments into "#comment" nodes
-  Add a space before # for end of line comments
-*)
-  let comment_eol = comment_generic /[ \t]*#[ \t]*/ " # "
-
-(* View: comment_or_eol
-    A <comment_eol> or <eol> *)
- let comment_or_eol = comment_eol | (del /[ \t]*#?\n/ "\n")
-
-(* View: comment_multiline
-    A C-style multiline comment *)
-  let comment_multiline =
-     let mline_re = (/[^ \t\n].*[^ \t\n]|[^ \t\n]/ - /.*\*\/.*/) in
-     let mline = [ seq "mline"
-                 . store mline_re ] in
-     [ label "#mcomment" . del /[ \t]*\/\*[ \t\n]*/ "/*\n"
-       . counter "mline"
-       . (mline . (eol . mline)*)
-       . del /[ \t\n]*\*\/[ \t]*\n/ "\n*/\n" ]
-
-(* View: comment_c_style
-    A comment line, C-style *)
-  let comment_c_style =
-    comment_generic /[ \t]*\/\/[ \t]*/ "// "
-
-(* View: empty_generic
-  A generic definition of <empty>
-  Map empty lines, including empty comments *)
-  let empty_generic (r:regexp) =
-    [ del r "" . del_str "\n" ]
-
-(* View: empty
-  Map empty lines, including empty comments *)
-  let empty = empty_generic /[ \t]*#?[ \t]*/
-
-(* View: empty_c_style
-  Map empty lines, including C-style empty comment *)
-  let empty_c_style =
-    empty_generic /[ \t]*((\/\/)|(\/\*[ \t]*\*\/))?[ \t]*/
-
-
-(* View: Split *)
-(* Split (SEP . ELT)* into an array-like tree where each match for ELT *)
-(* appears in a separate subtree. The labels for the subtrees are      *)
-(* consecutive numbers, starting at 0                                  *)
-  let split (elt:lens) (sep:lens) =
-    let sym = gensym "split" in
-    counter sym . ( [ seq sym . sep . elt ] ) *
-
-(* Group: Exclusions
-
-Variable: stdexcl
-  Exclusion for files that are commonly not wanted/needed
-*)
-  let stdexcl = (excl "*~") .
-    (excl "*.rpmnew") .
-    (excl "*.rpmsave") .
-    (excl "*.dpkg-old") .
-    (excl "*.dpkg-new") .
-    (excl "*.dpkg-bak") .
-    (excl "*.dpkg-dist") .
-    (excl "*.augsave") .
-    (excl "*.augnew")
-
-(* Local Variables: *)
-(* mode: caml       *)
-(* End:             *)
 
+++ /dev/null
-#!/bin/sh
-#oVirt node autobuild script
-#
-# Copyright (C) 2008 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-echo "Running oVirt Node Autobuild"
-
-set -e
-set -v
-
-if grep -q "DISTCVS Specfile" ovirt-node.spec; then
-    cp ovirt-node.spec distcvs.ovirt-node.spec
-fi
-
-test -f Makefile && make -k distclean || :
-
-OVIRT_CACHE_DIR=${AUTOBUILD_SOURCE_ROOT}/../ovirt-cache
-OVIRT_LOCAL_REPO=file://${AUTOBUILD_PACKAGE_ROOT}/rpm/RPMS
-export OVIRT_LOCAL_REPO OVIRT_CACHE_DIR
-
-./autogen.sh --prefix=$AUTOBUILD_INSTALL_ROOT --with-image-minimizer
-make
-make install
-
-if [ -e distcvs.ovirt-node.spec ]; then
-    mv distcvs.ovirt-node.spec ovirt-node.spec
-fi
-
-rm -f *.tar.gz
-make dist
-
-if [ -f /usr/bin/rpmbuild ]; then
-  if [ -n "$AUTOBUILD_COUNTER" ]; then
-    EXTRA_RELEASE=".auto$AUTOBUILD_COUNTER"
-  else
-    NOW=`date +"%s"`
-    EXTRA_RELEASE=".$USER$NOW"
-  fi
-  rpmbuild --nodeps --define "extra_release $EXTRA_RELEASE" -ta --clean *.tar.gz
-fi
-
-# regenerate repo so iso uses new ovirt-node rpms
-createrepo -d ${AUTOBUILD_PACKAGE_ROOT}/rpm/RPMS
-
-cd recipe
-make ovirt-node-image.iso 
-
-if ! ls *.iso 2>/dev/null >/dev/null; then
-    echo "ISO not created"
-    exit 1
-fi
-
-#
-#copy iso back to main directory for autotest.sh
-ln -nf *iso .. ||:
-
-#Don't error out if this doesn't work.
-set +e
-TMPDIR=$(mktemp -d)
-sudo mount -o loop *iso $TMPDIR
-cp $TMPDIR/isolinux/manifest-srpm.txt ..
-cp $TMPDIR/isolinux/manifest-rpm.txt ..
-cp $TMPDIR/isolinux/manifest-file.txt.bz2 ..
-sudo umount $TMPDIR
-rmdir $TMPDIR
-
-cd ..
-echo "======================================================" > ovirt-node-image.mini-manifest
-echo "Package info in ovirt-node-image.iso" >> ovirt-node-image.mini-manifest
-echo "======================================================" >> ovirt-node-image.mini-manifest
-egrep '^kernel|kvm|^ovirt-node|libvirt' manifest-srpm.txt | \
-sed 's/\.src\.rpm//' >> ovirt-node-image.mini-manifest
-
-# Add additional information to mini-manifest
-# Check size of iso and report in mini-manifest
-echo "======================================================" >> ovirt-node-image.mini-manifest
-size=$(ls -l ovirt-node-image.iso | awk '{print $5}')
-human_size=$(ls -lh ovirt-node-image.iso | awk '{print $5}')
-echo "    Iso Size:  $size  ($human_size)" >> ovirt-node-image.mini-manifest
-
-html_location=/var/www/html/builder/$(basename $(dirname ${AUTOBUILD_SOURCE_ROOT}))
-old_size=""
-old_human_size=""
-if [ -e ${html_location}/artifacts/${AUTOBUILD_MODULE}/ovirt-node-image.iso ]; then
-    old_size=$(ls -l ${html_location}/artifacts/${AUTOBUILD_MODULE}/ovirt-node-image.iso | awk '{print $5}')
-    old_human_size=$(ls -lh ${html_location}/artifacts/${AUTOBUILD_MODULE}/ovirt-node-image.iso | awk '{print $5}')
-    let size_diff=(size-old_size)/1024
-    echo "Old Iso Size:  $old_size  ($old_human_size) delta[kB] $size_diff" >> ovirt-node-image.mini-manifest
-else
-    echo "No old iso found for compairson">> ovirt-node-image.mini-manifest
-fi
-# md5 and sha256sums
-echo "MD5SUM:  $(md5sum ovirt-node-image.iso |awk '{print $1}')" >> ovirt-node-image.mini-manifest
-echo "SHA256SUM:  $(sha256sum ovirt-node-image.iso |awk '{print $1}')" >> ovirt-node-image.mini-manifest
-
-echo "======================================================" >> ovirt-node-image.mini-manifest
-echo "livecd-tools version:  $(rpm -qa livecd-tools)" >> ovirt-node-image.mini-manifest
 
+++ /dev/null
-CVS_BRANCH=RHEL-6
-CVS_TAG_INFO=
 
+++ /dev/null
-#!/bin/sh
-# Run this to generate configure and Makefile
-
-srcdir=`dirname $0`
-test -z "$srcdir" && srcdir=.
-
-THEDIR=`pwd`
-(
-  cd $srcdir
-  die=0
-
-  (autoconf --version) < /dev/null > /dev/null 2>&1 || {
-         echo
-         echo "You must have autoconf installed."
-         echo "Download the appropriate package for your distribution,"
-         echo "or see http://www.gnu.org/software/autoconf"
-         die=1
-  }
-
-  # Require libtool only if one of of LT_INIT,
-  # AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac.
-  grep -E '^[[:blank:]]*(LT_INIT|A[CM]_PROG_LIBTOOL)' configure.ac >/dev/null \
-      && {
-    (libtool --version) < /dev/null > /dev/null 2>&1 || {
-         echo
-         echo "You must have libtool installed."
-         echo "Download the appropriate package for your distribution,"
-         echo "or see http://www.gnu.org/software/libtool"
-         die=1
-    }
-  }
-
-  (automake --version) < /dev/null > /dev/null 2>&1 || {
-         echo
-         die=1
-         echo "You must have automake installed."
-         echo "Download the appropriate package for your distribution,"
-         echo "or see http://www.gnu.org/software/automake"
-  }
-
-  test $die = 1 && exit 1
-
-  test -f ovirt-node.spec.in || {
-         echo "You must run this script in the top-level directory"
-         exit 1
-  }
-
-  if test -z "$*"; then
-         echo "I am going to run ./configure with no arguments - if you wish "
-         echo "to pass any to it, please specify them on the $0 command line."
-  fi
-
-  aclocal
-
-  # Run autoheader only if needed
-  grep '^[[:blank:]]*AC_CONFIG_HEADERS' configure.ac >/dev/null && autoheader
-
-  automake --add-missing
-  autoconf
-  ./configure "$@"
-)
-
-if test "x$OBJ_DIR" != x; then
-    mkdir -p "$OBJ_DIR"
-    cd "$OBJ_DIR"
-fi
 
+++ /dev/null
-#!/bin/bash
-#
-# oVirt node autotest script
-#
-# Copyright (C) 2009 Red Hat, Inc.
-# Written by Darryl L. Pierce <
[email protected]>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-# To include autotesting on the build system, you need to insert the
-# following snippet *BEFORE* the text that reads "Output Stages":
-# ---8<[begin]---
-#  # Integration test
-#  {
-#    name = integration
-#    label = Test group
-#    module = Test::AutoBuild::Stage::Test
-#    # Don't abort entire cycle if the module test fails
-#    critical = 0
-#  }
-# ---8<[end]---
-#
-# This will, for each module whose autobuild.sh is run, to have a matching
-# autotest.sh to run as well.
-#
-# To run these tests locally, you will need to open port 69 TCP and UDP and have
-# an ISO file.
-
-exit 0
-
-ME=$(basename "$0")
-WORKDIR=$(mktemp -d)
-warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
-die() {  warn "$*"; exit 1; }
-debug() { if $debugging; then log "[DEBUG] %s" "$*"; fi }
-
-trap '__st=$?; cleanup_after_testing; exit $__st' 1 2 3 13 15
-trap 'cleanup_after_testing' 0
-
-# set -e
-# set -u
-
-log () {
-    date=$(date)
-    printf "${date} $*\n"
-}
-
-usage () {
-    cat <<EOF
-Usage: $ME [-n test_name] [LOGFILE]
-  -i: set the ISO filename (defualt: ovirt-node-image.iso)
-  -n: the name of the specific autotest to run (default: run all autotests)
-  -d: enable more verbose output (default: disabled)
-  -t: change the timeout between markers (in ms, default: 120)
-  -v: enable tracing (default: disabled)
-  -w: launch virt-viewer for each VM (default: no window shown)
-  -h: display this help and exit
-EOF
-}
-
-# $1 - the test function to call
-execute_test () {
-    local testname=$1
-
-    if [ -z $testname ]; then die "Missing test name"; fi
-
-    log "Executing test: $testname"
-
-    eval $testname
-
-    rc=$?
-    log "Completed test: $testname [result=$rc]"
-
-    if [ $rc -ne 0 ]; then
-        log "Build fails smoke tests."
-    fi
-
-    return $rc
-}
-
-# setup a node for pxeboot
-# $1 - the working directory
-# $2 - kernel arguments; if present then they replace all default flags
-setup_pxeboot () {
-    local workdir=$1
-    local kernelargs=$2
-    local pxedefault=$workdir/tftpboot/pxelinux.cfg/default
-
-    debug "setup for pxeboot: isofile=${isofile} workdir=${workdir} kernelargs='${kernelargs}' pxedefault=${pxedefault}"
-    (cd $workdir && sudo livecd-iso-to-pxeboot $isofile) > /dev/null 2>&1
-    sudo chmod -R 777 $workdir
-
-    # set default kernel arguments if none were provided
-    # the defaults boot in standalone mode
-    if [ -z "$kernelargs" ]; then
-        kernelargs="standalone"
-    fi
-
-    local definition="DEFAULT pxeboot"
-    definition="${definition}\nTIMEOUT 20"
-    definition="${definition}\nPROMPT 0"
-    definition="${definition}\nLABEL pxeboot"
-    definition="${definition}\n     KERNEL vmlinuz0"
-    definition="${definition}\n     IPAPPEND 2"
-    definition="${definition}\n     APPEND rootflags=loop initrd=initrd0.img root=/${isoname} rootfstype=auto console=tty0 check console=ttyS0,115200n8 $kernelargs"
-
-    debug "pxeboot definition=\n${definition}"
-    sudo bash -c "printf \"${definition}\" > $pxedefault"
-}
-
-# Starts a simple instance of dnsmasq.
-# $1 - the iface on which dnsmasq works
-# $2 - the root for tftp files
-# $3 - the mac address for the node (ignored if blank)
-# $4 - the nodename
-start_dnsmasq () {
-    local iface=$1
-    local tftproot=$2
-    local macaddress=$3
-    local nodename=$4
-    local pidfile=$2/dnsmasq.pid
-
-    stop_dnsmasq
-    debug "Starting dnsmasq"
-    dns_startup="sudo /usr/sbin/dnsmasq --read-ethers
-                   --dhcp-range=${NETWORK}.100,${NETWORK}.254,255.255.255.0,24h
-                   --conf-file=
-                   --interface=${iface}
-                   --bind-interfaces
-                   --except-interface=lo
-                   --dhcp-boot=tftpboot/pxelinux.0
-                   --enable-tftp
-                   --tftp-root=${tftproot}
-                   --log-facility=$WORKDIR/dnsmasq-${nodename}.log
-                   --log-queries
-                   --log-dhcp
-                   --pid-file=${pidfile}"
-    if [ -n "$macaddress" ]; then
-        dns_startup="${dns_startup} --dhcp-host=${macaddress},${NODE_ADDRESS}"
-    fi
-    # start dnsmasq
-    eval $dns_startup
-    debug "pidfile=$pidfile"
-    DNSMASQ_PID=$(sudo cat $pidfile)
-    debug "DNSMASQ_PID=${DNSMASQ_PID}"
-}
-
-# Kills the running instance of dnsmasq.
-stop_dnsmasq () {
-    if [ -n "${DNSMASQ_PID-}" -a "${DNSMASQ_PID-}" != "0" ]; then
-        local check=$(ps -ef | awk "/${DNSMASQ_PID}/"' { if ($2 ~ '"${DNSMASQ_PID}"') print $2 }')
-
-        if [[ "${check}" == "${DNSMASQ_PID}" ]]; then
-            sudo kill -9 $DNSMASQ_PID
-            return
-        fi
-    fi
-    DNSMASQ_PID="0"
-}
-
-# Creates a virt network.
-# $1 - the node name
-# $2 - the network interface name
-# $3 - use DHCP (any value)
-# $4 - start dnsmsq (def. false)
-start_networking () {
-    local nodename=$1
-    local ifacename=$2
-    local use_dhcp=${3-false}
-    local start_dnsmasq=${4-false}
-    local workdir=$5
-    local definition=""
-    local network=$NETWORK
-    local xmlfile=$WORKDIR/$nodename-$ifacename.xml
-
-    debug "start_networking ()"
-    for var in nodename ifacename use_dhcp start_dnsmasq workdir network xmlfile; do
-        eval debug "::$var: \$$var"
-    done
-
-    definition="<network>\n<name>${ifacename}</name>\n<forward mode='nat' />\n<bridge name='${ifacename}' stp='on' forwardDelay='0' />"
-    definition="${definition}\n<ip address='${network}.1' netmask='255.255.255.0'>"
-    if $use_dhcp; then
-        definition="${definition}\n<dhcp>\n<range start='${network}.100' end='${network}.199' />\n</dhcp>"
-    fi
-    definition="${definition}\n</ip>\n</network>"
-
-    debug "Saving network definition file to: ${xmlfile}\n"
-    sudo printf "${definition}" > $xmlfile
-    sudo virsh net-define $xmlfile > /dev/null 2>&1
-    debug "Starting network."
-    sudo virsh net-start $ifacename > /dev/null 2>&1
-
-    if [ "${use_dhcp}" == "false" ]; then
-        if $start_dnsmasq; then
-            start_dnsmasq $ifacename $workdir "" $nodename
-        fi
-    fi
-}
-
-# Destroys the test network interface
-# $1 - the network name
-# $2 - stop dnsmasq (def. false)
-stop_networking () {
-    local networkname=${1-}
-    local stop_dnsmasq=${2-true}
-
-    # if no network was supplied, then check for the global network
-    if [ -z "$networkname" ]; then
-        networkname=${NETWORK_NAME-}
-    fi
-
-    # exit if preserve was enabled
-    if $preserve_vm; then return; fi
-
-    if [ -n "${networkname}" ]; then
-        debug "Destroying network interface: ${networkname}"
-        check=$(sudo virsh net-list --all)
-        if [[ "${check}" =~ "${networkname}" ]]; then
-            if [[ "{$check}" =~ active ]]; then
-                sudo virsh net-destroy $networkname > /dev/null 2>&1
-            fi
-            sudo virsh net-undefine $networkname > /dev/null 2>&1
-        fi
-    fi
-
-    if $stop_dnsmasq; then
-        stop_dnsmasq
-    fi
-}
-
-# creates a HD disk file
-# $1 - filename for disk file
-# $2 - size (##M or ##G)
-create_hard_disk () {
-    local filename=$1
-    local size=$2
-
-    debug "Creating hard disk: filename=${filename} size=${size}"
-    sudo qemu-img create -f raw $filename "${size}M" > /dev/null 2>&1
-    sudo chcon -t virt_image_t $filename > /dev/null 2>&1
-}
-
-# Creates the XML for a virtual machine.
-# $1 - the file to write the xml
-# $2 - the node name
-# $3 - memory size (in kb)
-# $4 - boot device
-# $5 - the local hard disk (if blank then no disk is used)
-# $6 - the cdrom disk (if blank then no cdrom is used)
-# $7 - the network bridge (if blank then 'default' is used)
-# $8 - optional arguments
-define_node () {
-    local filename=$1
-    local nodename=$2
-    local memory=$3
-    local boot_device=$4
-    local harddrive=$5
-    local cddrive=$6
-    local bridge=${7-default}
-    local options=${8-}
-    local result=""
-
-    # flexible options
-    # define defaults, then allow the caller to override them as needed
-    local arch=$(uname -i)
-    local serial="true"
-    local vncport="-1"
-    local bootdev='hd'
-
-    # first destroy the node
-    destroy_node $nodename
-
-    if [ -n "$options" ]; then eval "$options"; fi
-
-    debug "define_node ()"
-    for var in filename nodename memory harddrive cddrive bridge options arch serial vncport bootdev; do
-eval debug "::$var: \$$var"
-    done
-
-    result="<domain type='kvm'>\n<name>${nodename}</name>\n<memory>${memory}</memory>\n <vcpu>1</vcpu>"
-
-    # begin the os section
-    # inject the boot device
-    result="${result}\n<os>\n<type arch='${arch}' machine='pc'>hvm</type>"
-    result="${result}\n<boot dev='${boot_device}' />"
-    result="${result}\n</os>"
-
-    # virtual machine features
-    result="${result}\n<features>"
-    result="${result}\n<acpi />"
-    if [ -z "${noapic-}" ]; then result="${result}\n<apic />"; fi
-    result="${result}\n<pae /></features>"
-    result="${result}\n<clock offset='utc' />"
-    result="${result}\n<on_poweroff>destroy</on_poweroff>"
-    result="${result}\n<on_reboot>restart</on_reboot>"
-    result="${result}\n<on_crash>restart</on_crash>"
-
-    # add devices
-    result="${result}\n<devices>"
-    # inject the hard disk if defined
-    if [ -n "$harddrive" ]; then
-        debug "Adding a hard drive to the node"
-        result="${result}\n<disk type='file' device='disk'>"
-        result="${result}\n<source file='$harddrive' />"
-        result="${result}\n<target dev='vda' bus='virtio' />"
-        result="${result}\n</disk>"
-    fi
-    # inject the cdrom drive if defined
-    if [ -n "$cddrive" ]; then
-        debug "Adding a CDROM drive to the node"
-        result="${result}\n<disk type='file' device='cdrom'>"
-        result="${result}\n<source file='${cddrive}' />"
-        result="${result}\n<target dev='hdc' bus='ide' />"
-        result="${result}\n</disk>"
-    fi
-    # inject the bridge network
-    result="${result}\n<interface type='network'>"
-    result="${result}\n<source network='${bridge}' />"
-    result="${result}\n</interface>"
-    # inject the serial port
-    if [ -n "$serial" ]; then
-        result="${result}\n<serial type='pty' />"
-    fi
-    # inject the vnc port
-    if [ -n "$vncport" ]; then
-        result="${result}\n<console type='pty' />"
-        result="${result}\n<graphics type='vnc' port='${vncport}' autoport='yes' keyman='en-us' />"
-    fi
-    # finish the device section
-    result="${result}\n</devices>"
-
-    result="${result}\n</domain>"
-
-    debug "Node definition: ${filename}"
-    sudo printf "$result" > $filename
-
-    # now define the vm
-    sudo virsh define $filename > /dev/null 2>&1
-
-    if [ $? != 0 ]; then die "Unable to define virtual machine: $nodename"; fi
-}
-
-# $1 - the node name
-# $2 - the boot device (def. "hd")
-# $3 - the memory size in kb (def. 524288)
-# $4 - hard disk size (if blank then no hard disk)
-# $5 - the cd drive image file (if blank then no cd drive)
-# $6 - option arguments
-configure_node () {
-    local nodename=$1
-    local boot_device=$2
-    local memory=$3
-    local hdsize=$4
-    local hdfile=""
-    local cdfile=$5
-    local args=$6
-    local nodefile=$WORKDIR/$nodename.xml
-
-    if [ -z "${boot_device}" ]; then boot_device="hd"; fi
-    if [ -z "${memory}" ]; then memory="524288"; fi
-
-    debug "configure_node ()"
-    for var in nodename boot_device memory hdsize hdfile cdfile args nodefile; do
-        eval debug "::$var: \$$var"
-    done
-
-    # create the hard disk file
-    if [ -n "${hdsize}" ]; then
-        hdfile=$WORKDIR/$nodename-hd.img
-        create_hard_disk $hdfile $hdsize
-    fi
-
-    define_node $nodefile $nodename "${memory}" "${boot_device}" "${hdfile}" "${cdfile}" $IFACE_NAME "${args}"
-}
-
-# $1 - the node name
-# $2 - undefine the node (def. true)
-destroy_node () {
-    local nodename=$1
-    local undefine=${2-true}
-
-    # if preserving nodes then exit
-    if $preserve_vm; then return; fi
-
-    if [ -n "${nodename}" ]; then
-        check=$(sudo virsh list --all)
-        if [[ "${check}" =~ "${nodename}" ]]; then
-            if [[ "${check}" =~ running ]]; then
-                sudo virsh destroy $nodename > /dev/null 2>&1
-            fi
-            if $undefine; then
-                sudo virsh undefine $nodename > /dev/null 2>&1
-            fi
-        fi
-    fi
-}
-
-# for each test created, add it to the follow array:
-tests=''; testcount=0;
-
-# $1 - test name
-add_test () {
-    tests="${tests} $1"
-}
-
-# $1 - node name
-start_virt_viewer () {
-    local nodename=$1
-
-    sudo virt-viewer $nodename > /dev/null 2>&1&
-}
-
-# $1 - the node's name
-# $2 - kernel arguments
-# $3 - working directory
-boot_with_pxe () {
-    local nodename=$1
-    local kernel_args=$2
-    local workdir=$3
-
-    debug "boot_with_pxe ()"
-    debug "-      workdir: ${workdir}"
-    debug "-     nodename: ${nodename}"
-    debug "-  kernel_args: ${kernel_args}"
-
-    setup_pxeboot $workdir "${kernel_args}"
-
-    sudo virsh start $nodename > /dev/null 2>&1
-    if $show_viewer; then
-        start_virt_viewer $nodename
-    fi
-}
-
-# $1 - the node's name
-boot_from_hd () {
-    local nodename=$1
-
-    debug "boot_from_hd ()"
-    debug "::nodename: ${nodename}"
-
-    sudo virsh start $nodename > /dev/null 2>&1
-    if $show_viewer; then
-        start_virt_viewer $nodename
-    fi
-}
-
-# $1 - the node name
-# $2 - the old boot device
-# $3 - the new boot device
-substitute_boot_device () {
-    local nodename=$1
-    local old_device=$2
-    local new_device=$3
-    local new_node_file=$WORKDIR/$nodename-new.xml
-
-    if [ -n "${nodename}" ]; then
-        local xml=$(sudo virsh dumpxml $nodename | sed "s/boot dev='"${old_device}"'/boot dev='"${new_device}"'/")
-
-        sudo printf "${xml}" > $new_node_file
-
-        sudo virsh define $new_node_file
-    fi
-}
-
-add_test "test_stateless_pxe"
-test_stateless_pxe () {
-    local nodename="${vm_prefix}-stateless-pxe"
-    local workdir=$WORKDIR
-
-    start_networking $nodename $IFACE_NAME false true $workdir
-
-    configure_node "${nodename}" "network" "" "10000" "" "local noapic=true"
-    boot_with_pxe "${nodename}" "standalone firstboot=no" "${workdir}"
-
-    expect -c '
-set timeout '${timeout_period}'
-
-log_file -noappend stateless-pxe.log
-
-spawn sudo virsh console '"${nodename}"'
-
-expect {
-    -exact "Linux version"         { send_log "\n\nMarker 1\n\n"; exp_continue }
-    -exact "Starting ovirt-early:" { send_log "\n\nMarker 2\n\n"; exp_continue }
-    -exact "Starting ovirt:"       { send_log "\n\nMarker 3\n\n"; exp_continue }
-    -exact "Starting ovirt-post:"  { send_log "\n\nMarker 4\n\n"; exp_continue }
-    -re    "localhost.*login:"     { send_log "\n\nMarker 5\n\n"; exit }
-    timeout {
-send_log "\nTimeout waiting for marker..\n\n"
-exit 1
-    } eof {
-send_log "Unexpected end of file."
-exit 2
-    }
-}
-
-send_log "\n\nUnexpected end of interaction.\n\n"
-exit 3'
-    result=$?
-
-    destroy_node $nodename
-    stop_networking $IFACE_NAME true
-
-    return $result
-}
-
-add_test "test_stateless_pxe_with_nohd"
-test_stateless_pxe_with_nohd () {
-    local nodename="${vm_prefix}-stateless-pxe-nohd"
-    local workdir=$WORKDIR
-
-    start_networking $nodename $IFACE_NAME false true $workdir
-
-    configure_node "${nodename}" "network" "" "" "" "local noapic=true"
-    boot_with_pxe "${nodename}" "firstboot=no" "${workdir}"
-
-    expect -c '
-set timeout '${timeout_period}'
-
-log_file -noappend stateless-pxe.log
-
-spawn sudo virsh console '"${nodename}"'
-
-expect {
-    -exact "Linux version"         { send_log "\n\nMarker 1\n\n"; exp_continue }
-    -exact "Starting ovirt-early:" { send_log "\n\nMarker 2\n\n"; exp_continue }
-    -exact "Starting ovirt:"       { send_log "\n\nMarker 3\n\n"; exp_continue }
-    -exact "Starting ovirt-post:"  { send_log "\n\nMarker 4\n\n"; exp_continue }
-    -re    "localhost.*login:"     { send_log "\n\nMarker 5\n\n"; exit }
-    timeout {
-       send_log "\nTimeout waiting for marker..\n\n"
-       exit 1
-    } eof {
-       send_log "Unexpected end of file."
-       exit 2
-    }
-}
-
-send_log "\n\nUnexpected end of interaction.\n\n"
-exit 3'
-
-    result=$?
-
-    destroy_node $nodename
-    stop_networking $IFACE_NAME true
-
-    return $result
-}
-
-add_test "test_stateful_pxe"
-test_stateful_pxe () {
-    local nodename="${vm_prefix}-stateful-pxe"
-    local workdir=$WORKDIR
-    local ipaddress=${NODE_ADDRESS}
-
-    for var in nodename workdir ipaddress; do
-        eval debug "::\$$var: $var"
-    done
-
-    start_networking $nodename $IFACE_NAME false true $workdir
-
-    configure_node "${nodename}" "network" "" "10000" "" "local noapic=true"
-    boot_with_pxe "${nodename}" "standalone storage_init=/dev/vda local_boot ip=${ipaddress}" ${workdir}
-
-    # verify the booting and installation
-    expect -c '
-set timeout '${timeout_period}'
-log_file -noappend stateful-pxe.log
-
-spawn sudo virsh console '"${nodename}"'
-
-expect {
-    -exact "Linux version"                     { send_log "\n\nMarker 1\n\n"; exp_continue }
-    -exact "Starting ovirt-early:"             { send_log "\n\nMarker 2\n\n"; exp_continue }
-    -exact "Starting ovirt:"                   { send_log "\n\nMarker 3\n\n"; exp_continue }
-    -exact "Starting ovirt-post:"              { send_log "\n\nMarker 4\n\n"; exp_continue }
-    -exact "Starting ovirt-firstpost:"         { send_log "\n\nMarker 5\n\n"; exp_continue }
-    -exact "Starting partitioning of /dev/vda" { send_log "\n\nMarker 6\n\n"; exp_continue }
-    -exact "Restarting system"                 { send_log "\n\nMarker 7\n\n"; exit }
-    timeout {
-send_log "\nTimeout waiting for marker..\n\n"
-exit 1
-    } eof {
-send_log "Unexpected end of file."
-exit 2
-    }
-}
-
-send_log "\n\nUnexpected end of interaction.\n\n"
-exit 3'
-    result=$?
-
-    # only continue if we're in a good state
-    if [ $result -eq 0 ]; then
-        destroy_node "${nodename}" false
-        substitute_boot_device "${nodename}" "network" "hd"
-        boot_from_hd  "${nodename}"
-
-        expect -c '
-set timeout '${timeout_period}'
-log_file stateful-pxe.log
-
-send_log "Restarted node, booting from hard disk.\n"
-
-spawn sudo virsh console '"${nodename}"'
-
-expect {
-    -re "localhost.*login:" { send_log "\n\nLogin marker found\n\n"; exit }
-
-    timeout {
-send_log "\nMarker not found.\n\n"
-exit 1
-    } eof {
-send_log "Unexpected end of file."
-exit 2
-    }
-}
-
-send_log "\n\nUnexpected end of interaction.\n\n"
-
-exit 3
-'
-
-        expect -c '
-set timeout 3
-log_file stateful-pxe.log
-
-spawn ping -c 3 '"${ipaddress}"'
-
-expect {
-    -exact "64 bytes from '"${ipaddress}"'" { send_log "\n\nGot ping response!\n"; send_log "\n\nNetworking verified!\n"; exit }
-
-    timeout {
-send_log "\nMarker not found.\n\n"
-exit 1
-    } eof {
-send_log "Unexpected end of file."
-exit 2
-    }
-}
-
-send_log "\n\nUnexpected end of interaction.\n\n"
-
-exit 3'
-
-result=$?
-    fi
-
-    destroy_node $nodename
-    stop_networking $IFACE_NAME true
-
-    return $result
-
-}
-
-# configures the environment for testing
-setup_for_testing () {
-    debug "WORKDIR=${WORKDIR}"
-    debug "isofile=${isofile}"
-    debug "isoname=${isoname}"
-    IFACE_NAME=testbr$$
-    debug "IFACE_NAME=${IFACE_NAME}"
-    NETWORK=192.168.$(echo "scale=0; print $$ % 255" | bc -l)
-    debug "NETWORK=${NETWORK}"
-    NODE_ADDRESS=$NETWORK.100
-    debug "NODE_ADDRESS=${NODE_ADDRESS}"
-    DNSMASQ_PID=0
-    debug "preserve_vm=${preserve_vm}"
-}
-
-# cleans up any loose ends
-cleanup_after_testing () {
-    debug "Cleaning up"
-    stop_dnsmasq
-    stop_networking
-    # destroy any running vms
-    vm_list=$(sudo virsh list --all | awk '/'${vm_prefix}-'/ { print $2 }')
-    test -n "$vm_list" && for vm in $vm_list; do
-        destroy_node $vm
-    done
-    stop_networking "${IFACE_NAME}" true
-
-    # do not delete the work directory if preserve was specified
-    if $preserve_vm; then return; fi
-
-    rm -rf $WORKDIR
-}
-
-# check commandline options
-test=''
-debugging=false
-isofile="${PWD}/ovirt-node-image.iso"
-show_viewer=false
-vm_prefix="$$"
-preserve_vm=false
-timeout_period="120"
-
-while getopts di:n:pt:vwh c; do
-    case $c in
-        d) debugging=true;;
-        i) isofile=($OPTARG);;
-        n) tests=($OPTARG);;
-        p) preserve_vm=true;;
-        t) timeout_period=($OPTARG);;
-        v) set -v;;
-        w) show_viewer=true;;
-        h) usage; exit 0;;
-        '?') die "invalid option \`-$OPTARG'";;
-        :) die "missing argument to \`-$OPTARG' option";;
-        *) die "internal error";;
-    esac
-done
-
-isoname=$(basename $isofile)
-isofile="$(cd `dirname $isofile`; pwd)/${isoname}"
-
-if ! [ -s "${isofile}" ]; then
-    die "Missing or invalid file: ${isofile}"
-fi
-
-shift $(($OPTIND - 1))
-
-set +u
-if [ $# -gt 0 -a -n "$1" ]; then RESULTS=$1; else RESULTS=autotest.log; fi
-set -u
-
-result_file=$WORKDIR/results.log
-debug "result_file=${result_file}"
-
-log "Logging results to file: ${RESULTS}"
-{
-    setup_for_testing
-
-    log "Begin Testing: ${isoname}"
-    log "Tests: ${tests}"
-    log "Timeout: ${timeout_period} ms"
-
-    for test in ${tests}; do
-        execute_test $test
-        result=$?
-
-        cleanup_after_testing
-
-        if [ $result != 0 ]; then
-            echo "${result}" > $result_file
-            break
-        fi
-    done
-
-    log "End Testing: ${isoname}"
-
-} | sudo tee --append $RESULTS
-
-if [ -s "$result_file" ]; then
-    exit $(cat $result_file)
-fi
 
+++ /dev/null
-AC_INIT([ovirt-node], [2.2.0], [
[email protected]])
-AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability tar-pax])
-
-AC_SUBST([FEDORA],[[`rpm --eval '%{fedora}'|sed 's/[^0-9]//g'`]])
-AC_SUBST([RHEL], [[`rpm --eval '%{rhel}'|sed 's/[^0-9]//g'`]])
-AC_SUBST([DISTRO])
-
-if test "$FEDORA"; then
-    DISTRO=ovirt$FEDORA
-fi
-if test "$RHEL"; then
-    DISTRO=rhevh$RHEL
-fi
-
-AC_ARG_WITH([image-minimizer], [AC_HELP_STRING([--with-image-minimizer],
-            [enable aggresive reduction of the image size])],
-            [IMAGE_MINIMIZER="%include image-minimizer.ks"],
-            [IMAGE_MINIMIZER=""])
-AC_SUBST([IMAGE_MINIMIZER])
-
-AC_CONFIG_FILES([Makefile
-  augeas/Makefile
-  dracut/Makefile
-  images/Makefile
-  kinit/Makefile
-  scripts/Makefile
-  scripts/collectd.conf
-  recipe/Makefile
-  recipe/ovirt-node-image.ks
-  recipe/image-minimizer.ks
-  ovirt-node.spec
-  ])
-AC_OUTPUT
 
+++ /dev/null
-# Copyright (C) 2010 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-EXTRA_DIST = \
-  dracut-3d88d27810acc7782618d67a03ff5c0e41494ca4.patch \
-  dracut-93724aa28fc20c8b7f0167201d1759b7118ba890.patch \
-  ovirt-dracut.conf \
-  check \
-  install \
-  ovirt-cleanup.sh
 
+++ /dev/null
-#!/bin/sh
-exit 0
 
+++ /dev/null
-From 3d88d27810acc7782618d67a03ff5c0e41494ca4 Mon Sep 17 00:00:00 2001
-From: Will Woods <
[email protected]>
-Date: Tue, 8 Mar 2011 18:35:11 -0500
-Subject: [PATCH] Fix bash logic typo/buglet ([ condition ] & expression)
-
----
- modules.d/90dmsquash-live/dmsquash-live-root |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
---- modules.d/90dmsquash-live/dmsquash-live-root.orig  2011-07-22 02:16:51.013118899 +0200
-+++ modules.d/90dmsquash-live/dmsquash-live-root       2011-07-22 02:17:01.592391181 +0200
-@@ -24,7 +24,7 @@
- overlay=$(getarg overlay)
- 
- # FIXME: we need to be able to hide the plymouth splash for the check really
--[ -e $livedev ] & fs=$(blkid -s TYPE -o value $livedev)
-+[ -e $livedev ] && fs=$(blkid -s TYPE -o value $livedev)
- if [ "$fs" = "iso9660" -o "$fs" = "udf" ]; then
-     check="yes"
- fi
 
+++ /dev/null
-From 93724aa28fc20c8b7f0167201d1759b7118ba890 Mon Sep 17 00:00:00 2001
-From: Alan Pevec <
[email protected]>
-Date: Thu, 7 Apr 2011 01:53:51 +0200
-Subject: [PATCH] dmsquash-live: hide plymouth while checking ISO
-
-Fixes long-standing FIXME
-Latest isomd5sum added an option to abort media check with ESC key,
-but that key is taken by plymouth for switching to the detailed log
-messages, making it impossible to abort checkisomd5.
-Tested in text mode.
----
- modules.d/90dmsquash-live/dmsquash-live-root |    3 ++-
- 1 files changed, 2 insertions(+), 1 deletions(-)
-
---- modules.d/90dmsquash-live/dmsquash-live-root.orig  2011-07-22 02:02:58.000000000 +0200
-+++ modules.d/90dmsquash-live/dmsquash-live-root       2011-07-22 02:07:20.873266232 +0200
-@@ -23,18 +23,19 @@
- getarg readonly_overlay && readonly_overlay="--readonly" || readonly_overlay=""
- overlay=$(getarg overlay)
- 
--# FIXME: we need to be able to hide the plymouth splash for the check really
- [ -e $livedev ] && fs=$(blkid -s TYPE -o value $livedev)
- if [ "$fs" = "iso9660" -o "$fs" = "udf" ]; then
-     check="yes"
- fi
- getarg check || check=""
- if [ -n "$check" ]; then
-+    [ -x /bin/plymouth ] && /bin/plymouth --hide-splash
-     checkisomd5 --verbose $livedev || :
-     if [ $? -ne 0 ]; then
-       die "CD check failed!"
-       exit 1
-     fi
-+    [ -x /bin/plymouth ] && /bin/plymouth --show-splash
- fi
- 
- getarg ro && liverw=ro
 
+++ /dev/null
-#!/bin/bash
-
-inst yes
-inst head
-inst awk
-
-inst_hook pre-pivot 01 "$moddir/ovirt-cleanup.sh"
-inst_simple "$moddir/ovirt-boot-functions" /sbin/ovirt-boot-functions
 
+++ /dev/null
-#!/bin/sh
-
-. /sbin/ovirt-boot-functions
-if [ "$(basename $0)" = "01ovirt-cleanup.sh" ]; then
-    . /lib/dracut-lib.sh
-fi
-
-
-# Check firstboot arg
-# accept either ovirt-firstboot or firstboot
-# return if =0 or =no
-# rhbz#640782 - reinstall is alias for firstboot
-# uninstall should trigger cleanup as well
-if getarg firstboot >/dev/null; then
-    fb=$(getarg firstboot)
-elif getarg ovirt_firstboot >/dev/null; then
-    fb=$(getarg ovirt_firstboot)
-elif getarg reinstall >/dev/null; then
-    fb=$(getarg reinstall)
-elif getarg uninstall >/dev/null; then
-    fb=$(getarg uninstall)
-else
-    info "No firstboot, reinstall or uninstall parameter found"
-    return 0
-fi
-
-if [ "$fb" = "no" -o "$fb" = 0 ]; then
-    info "firtboot reinstall or uninstall parameter set to 0 or no, exitting"
-    return 0
-fi
-info "Found valid firstboot reinstall or uninstall parameter"
-
-# Check storage_init argument
-# Accept either storage_init or ovirt_init
-# Prefer storage_init
-# Blank entry will result in getting first disk
-
-storage_init="$(getargs storage_init)"
-if [ $? -eq 1 ]; then
-    storage_init="$(getargs ovirt_init)"
-    if [ $? -eq 1 ]; then
-        info "storage_init or ovirt_init arguments not found"
-    else
-        info "Found storage_init:  $storage_init"
-    fi
-fi
-
-# Check for HostVG
-lvm pvscan >/dev/null 2>&1
-
-if [ -z "$storage_init" ]; then
-    for hostvg in $(lvm pvs --noheadings -o vg_name,pv_name 2>/dev/null | awk '/^  HostVG/{print $2}'); do
-        if [ -z "$storage_init" ]; then
-            storage_init="$hostvg"
-        else
-            storage_init="$hostvg,$storage_init"
-        fi
-        info "Found HostVG on $hostvg"
-    done
-fi
-
-# storage_init is passed in a specific format
-# A comma separated list of HostVG devices
-# then optionally, a comma separated list of AppVG devices
-# The two lists are separated by a ';'
-# e.g, storage_init=/dev/sda,/dev/sdb;/dev/sdc,/dev/sdd
-# would partition sda and sdb as part of HostVG and
-# sdc and sdd as part of AppVG
-# Since we only care which disks are being used, change to a single list
-storage_init="$(echo "$storage_init" | sed 's/;/,/')"
-info "Replaced all ';' with ',' : $storage_init"
-storage_init="$(echo "$storage_init" | sed 's/\*/\\\*/')"
-info "Escaped all asterisks:  $storage_init"
-
-oldIFS=$IFS
-
-IFS=","
-for dev in $storage_init; do
-    dev="$(echo "$dev" | sed 's/\\\*/\*/g')"
-    device=$(IFS=$oldIFS parse_disk_id "$dev")
-    info "After parsing \"$dev\", we got \"$device\""
-    echo "Wiping LVM from device: ${device}"
-    IFS=$oldIFS
-    for i in $(lvm pvs --noheadings -o pv_name,vg_name --separator=, $device* 2>/dev/null); do
-        pv="${i%%,*}"
-        vg="${i##*,}"
-        if [ -n "$vg" ]; then
-            info "Found and removing vg: $vg"
-            yes | lvm vgremove -ff "$vg"
-        fi
-        info "Found and removing pv: $pv"
-        yes | lvm pvremove -ff "$pv"
-    done
-    IFS=,
-done
-
-IFS=$oldIFS
-
-return 0
 
+++ /dev/null
-add_dracutmodules+="ovirtnode multipath fips"
 
+++ /dev/null
-# Copyright (C) 2010 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-splashdir=$(datadir)/ovirt-node
-dist_splash_DATA = \
-  grub-splash.xpm.gz \
-  syslinux-vesa-splash.jpg
 
+++ /dev/null
-# Copyright (C) 2010 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-EXTRA_DIST = \
-  ovirt-kinit
 
+++ /dev/null
-#!/bin/sh
-
-/usr/kerberos/bin/kinit -k -t /etc/libvirt/krb5.tab qpidd/`hostname`
-
-EXITVALUE=$?
-if [ $EXITVALUE != 0 ]; then
-    /usr/bin/logger -t kinit "ALERT kinit failed abnormally with [$EXITVALUE]"
-fi
-exit $EXITVALUE
-
 
+++ /dev/null
-[Unit]
-Description=Virtualization daemon
-After=syslog.target
-After=udev.target
-After=avahi.target
-After=dbus.target
-Before=libvirt-guests.service
-Before=ovirt-post.service
-
-[Service]
-EnvironmentFile=-/etc/sysconfig/libvirtd
-ExecStart= /usr/sbin/libvirtd $LIBVIRTD_ARGS
-ExecReload=/bin/kill -HUP $MAINPID
-
-[Install]
-WantedBy=multi-user.target
 
+++ /dev/null
-# libvirtd upstart job
-#
-start on started messagebus
-stop on runlevel [!345]
-
-respawn
-
-script
-    LIBVIRTD_CONFIG=
-    LIBVIRTD_ARGS=
-    KRB5_KTNAME=/etc/libvirt/krb5.tab
-
-    if [ -f /etc/sysconfig/libvirtd ]; then
-        . /etc/sysconfig/libvirtd
-    fi
-
-    export QEMU_AUDIO_DRV
-    export SDL_AUDIODRIVER
-    export KRB5_KTNAME
-
-    LIBVIRTD_CONFIG_ARGS=
-    if [ -n "$LIBVIRTD_CONFIG" ]; then
-        LIBVIRTD_CONFIG_ARGS="--config $LIBVIRTD_CONFIG"
-    fi
-
-    # DAEMON_COREFILE_LIMIT from /etc/sysconfig/libvirtd is not handled
-    # automatically
-    if [ -n "$DAEMON_COREFILE_LIMIT" ]; then
-        ulimit -c "$DAEMON_COREFILE_LIMIT"
-    fi
-
-    # Clean up a pidfile that might be left around
-    rm -f /var/run/libvirtd.pid
-
-    mkdir -p /var/cache/libvirt
-    rm -rf /var/cache/libvirt/*
-
-    exec /usr/sbin/libvirtd $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS
-end script
-
-post-stop script
-    rm -f $PIDFILE
-    rm -rf /var/cache/libvirt/*
-end script
 
+++ /dev/null
-# Run each log rotation every 10 minutes
-*/10 * * * * root /usr/sbin/logrotate /etc/logrotate.d/ovirt-node
-*/10 * * * * root /usr/sbin/logrotate /etc/logrotate.d/syslog
 
+++ /dev/null
-/var/log/ovirt*.log{
-    rotate 3
-    compress
-    missingok
-    size 1M
-    create
-}
 
+++ /dev/null
-%global product_family oVirt Node
-%global product_release %{version} (0)
-%global mgmt_scripts_dir %{_sysconfdir}/node.d
-%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
-
-
-Summary:        The %{product_family} daemons/scripts
-Name:           ovirt-node
-Version:        @VERSION@
-Release:        0%{?dist}%{?extra_release}
-Source0:        %{name}-%{version}.tar.gz
-License:        GPLv2+
-Group:          Applications/System
-
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-buildroot
-URL:            http://www.ovirt.org/
-BuildRequires:  python-setuptools
-BuildRequires:  automake autoconf
-BuildRequires:  systemd-units
-
-Requires(post):  /sbin/chkconfig
-Requires(preun): /sbin/chkconfig
-%if 0%{?fedora}
-Requires:       systemd-units
-#Requires:       python-augeas
-Requires:       glusterfs-client >= 2.0.1
-Requires:       anyterm
-Requires:       python-IPy
-Requires:       grub2
-%endif
-Requires:       libvirt >= 0.9.2
-Requires:       augeas >= 0.3.5
-Requires:       udev >= 147-2.34
-Requires:       wget
-Requires:       cyrus-sasl-gssapi cyrus-sasl >= 2.1.22
-Requires:       iscsi-initiator-utils
-Requires:       ntp
-Requires:       nfs-utils
-Requires:       krb5-workstation
-Requires:       bash
-Requires:       chkconfig
-Requires:       bind-utils
-Requires:       qemu-img
-Requires:       nc
-Requires:       /usr/sbin/crond
-Requires:       newt-python
-Requires:       libuser-python >= 0.56.9
-Requires:       dbus-python
-Requires:       python-gudev
-Requires:       PyPAM
-Requires:       ethtool
-Requires:       cracklib-python
-Requires:       dracut
-%if 0%{?rhel}
-Requires:       grub
-# for applying patches in %post
-Requires:       patch
-%endif
-Requires:       system-release
-
-BuildArch:      noarch
-
-%define app_root %{_datadir}/%{name}
-
-%description
-Provides a series of daemons and support utilities for hypervisor distribution.
-
-%package tools
-Summary:        Tools for building and running %{product_family} image
-Group:          Applications/System
-Requires:       pykickstart  >= 1.54
-Requires:       livecd-tools >= 020-2
-
-%define tools_root %{_datadir}/ovirt-node-tools
-
-%description tools
-This package provides recipe (Kickstart files), client tools,
-documentation for building and running an %{product_family} image.
-This package is not to be installed on the %{product_family},
-however on a development machine to help to build the image.
-
-%prep
-%setup -q
-
-%build
-aclocal && autoheader && automake --add-missing && autoconf
-%configure --with-image-minimizer
-make
-
-%install
-%{__rm} -rf %{buildroot}
-make install DESTDIR=%{buildroot}
-
-# FIXME move all installs into makefile
-%{__install} -d -m0755 %{buildroot}%{_initrddir}
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/cron.hourly
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/sysconfig
-%{__install} -d -m0755 %{buildroot}%{mgmt_scripts_dir}
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/cron.d
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/logrotate.d
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/dracut.conf.d
-
-%{__install} -p -m0755 scripts/node-config %{buildroot}%{_sysconfdir}/sysconfig
-
-%{__install} -p -m0755 scripts/ovirt-awake %{buildroot}%{_initrddir}
-%{__install} -p -m0755 scripts/ovirt-early %{buildroot}%{_initrddir}
-%{__install} -p -m0755 scripts/ovirt %{buildroot}%{_initrddir}
-%{__install} -p -m0755 scripts/ovirt-post %{buildroot}%{_initrddir}
-%{__install} -p -m0755 scripts/ovirt-firstboot %{buildroot}%{_initrddir}
-
-%{__install} -p -m0644 logrotate/ovirt-logrotate %{buildroot}%{_sysconfdir}/cron.d
-%{__install} -p -m0644 logrotate/ovirt-logrotate.conf %{buildroot}%{_sysconfdir}/logrotate.d/ovirt-node
-%if 0%{?fedora}
-# install libvirtd systemd service
-%{__install} -d -m0755 %{buildroot}%{_unitdir}
-%{__install} -p -m0644 libvirtd.service %{buildroot}%{_unitdir}
-%endif
-%if 0%{?rhel}
-# install libvirtd upstart job
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/init
-%{__install} -p -m0644 libvirtd.upstart %{buildroot}%{_sysconfdir}/init/libvirtd.conf
-%endif
-# load vlan module
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/sysconfig/modules
-%{__install} -p -m0755 vlan.modules %{buildroot}%{_sysconfdir}/sysconfig/modules
-
-# qla4xxx iscsi hba workaround: rhbz#742433#c32
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/modprobe.d
-%{__install} -p -m0755 ovirt-qla4xxx.conf %{buildroot}%{_sysconfdir}/modprobe.d
-
-#dracut module for disk cleanup
-%{__install} -d -m0755 %{buildroot}%{_datadir}/dracut/modules.d/91ovirtnode
-%{__install} -p -m0755 dracut/check %{buildroot}%{_datadir}/dracut/modules.d/91ovirtnode
-%{__install} -p -m0755 dracut/install %{buildroot}%{_datadir}/dracut/modules.d/91ovirtnode
-%{__install} -p -m0755 scripts/ovirt-boot-functions %{buildroot}%{_datadir}/dracut/modules.d/91ovirtnode
-%{__install} -p -m0755 dracut/ovirt-cleanup.sh %{buildroot}%{_datadir}/dracut/modules.d/91ovirtnode
-%{__install} -p -m0644 dracut/ovirt-dracut.conf %{buildroot}%{_sysconfdir}/dracut.conf.d
-%if 0%{?rhel}
-# dracut patches for rhel6
-%{__install} -p -m0644 dracut/dracut-3d88d27810acc7782618d67a03ff5c0e41494ca4.patch %{buildroot}%{app_root}
-%{__install} -p -m0644 dracut/dracut-93724aa28fc20c8b7f0167201d1759b7118ba890.patch %{buildroot}%{app_root}
-%endif
-
-# resolv.conf augeas lens
-%{__install} -d -m0755 %{buildroot}/usr/share/augeas/lenses
-%{__install} -p -m0644 augeas/build.aug %{buildroot}/usr/share/augeas/lenses/build.aug
-%{__install} -p -m0644 augeas/resolv.aug %{buildroot}/usr/share/augeas/lenses/resolv.aug
-%{__install} -p -m0644 augeas/util.aug %{buildroot}/usr/share/augeas/lenses/util.aug
-
-mkdir -p %{buildroot}/%{_sysconfdir}/default
-echo "# File where default configuration is kept" > %{buildroot}/%{_sysconfdir}/default/ovirt
-
-# ovirt-config-boot post-install hooks
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/ovirt-config-boot.d
-# default hook for local_boot_trigger
-%{__install} -p -m0755 scripts/local_boot_trigger.sh %{buildroot}%{_sysconfdir}/ovirt-config-boot.d
-
-# newt UI
-%{__install} -d -m0755 %{buildroot}%{python_sitelib}/ovirt_config_setup
-%{__install} -p -m0644 scripts/__init__.py %{buildroot}%{python_sitelib}/ovirt_config_setup
-%if 0%{?fedora}
-%{__install} -p -m0644 scripts/collectd.py %{buildroot}%{python_sitelib}/ovirt_config_setup
-%endif
-%if 0%{?rhel}
-%{__install} -p -m0644 scripts/rhn.py %{buildroot}%{python_sitelib}/ovirt_config_setup
-%endif
-%{__install} -d -m0755 %{buildroot}%{python_sitelib}/ovirtnode
-%{__install} -p -m0644 scripts/__init__.py %{buildroot}%{python_sitelib}/ovirtnode
-%{__install} -p -m0644 scripts/storage.py %{buildroot}%{python_sitelib}/ovirtnode
-%{__install} -p -m0644 scripts/password.py %{buildroot}%{python_sitelib}/ovirtnode
-%{__install} -p -m0644 scripts/install.py %{buildroot}%{python_sitelib}/ovirtnode
-%{__install} -p -m0644 scripts/iscsi.py %{buildroot}%{python_sitelib}/ovirtnode
-%{__install} -p -m0644 scripts/kdump.py %{buildroot}%{python_sitelib}/ovirtnode
-%{__install} -p -m0644 scripts/log.py %{buildroot}%{python_sitelib}/ovirtnode
-%{__install} -p -m0644 scripts/ovirtfunctions.py %{buildroot}%{python_sitelib}/ovirtnode
-%{__install} -p -m0644 scripts/network.py %{buildroot}%{python_sitelib}/ovirtnode
-%{__install} -p -m0644 scripts/snmp.py %{buildroot}%{python_sitelib}/ovirtnode
-%{__install} -p -m0755 scripts/ovirt-config-installer.py %{buildroot}%{_libexecdir}/ovirt-config-installer
-%{__install} -p -m0755 scripts/ovirt-config-setup.py %{buildroot}%{_libexecdir}/ovirt-config-setup
-%{__install} -p -m0755 scripts/ovirt-admin-shell %{buildroot}%{_libexecdir}
-# python auto install
-%{__install} -p -m0755 scripts/ovirt-auto-install.py %{buildroot}%{_libexecdir}/ovirt-auto-install
-#%if 0%{?rhel}
-# python-augeas is not in RHEL-6
-# specific version of python-augeas is not available in Fedora yet
-%{__install} -p -m0644 scripts/augeas.py %{buildroot}%{python_sitelib}
-#%endif
-
-# ovirt-early vendor hook dir
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/ovirt-early.d
-
-# ovirt-early vendor commandline variables
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/ovirt-commandline.d
-
-
-%clean
-%{__rm} -rf %{buildroot}
-
-%post
-/sbin/chkconfig --add ovirt-awake
-/sbin/chkconfig --add ovirt-early
-/sbin/chkconfig --add ovirt-firstboot
-/sbin/chkconfig --add ovirt
-/sbin/chkconfig --add ovirt-post
-# workaround for imgcreate/live.py __copy_efi_files
-if [ ! -e /boot/grub/splash.xpm.gz ]; then
-  cp %{app_root}/grub-splash.xpm.gz /boot/grub/splash.xpm.gz
-fi
-%if 0%{?rhel}
-# apply dracut fixes not in rhel6
-# rhbz#683330
-# dracut.git commits rediffed for dracut-004-53.el6
-patch -d /usr/share/dracut/ -p0 < %{app_root}/dracut-3d88d27810acc7782618d67a03ff5c0e41494ca4.patch
-patch -d /usr/share/dracut/ -p0 < %{app_root}/dracut-93724aa28fc20c8b7f0167201d1759b7118ba890.patch
-%endif
-#use all hard-coded defaults for multipath
-# except for getuid_callout where we need replace-whitespace
-cat > /etc/multipath.conf << \EOF_multipath_conf
-defaults {
-    getuid_callout "/lib/udev/scsi_id --replace-whitespace --whitelisted --device=/dev/%n"
-}
-EOF_multipath_conf
-#release info for dracut to pick it up into initramfs
-# remove symlink to keep original redhat-release
-rm -f /etc/system-release
-echo "%{product_family} release %{product_release}" > /etc/system-release
-
-%preun
-if [ $1 = 0 ] ; then
-    /sbin/service ovirt-early stop >/dev/null 2>&1
-    /sbin/service ovirt-firstboor stop >/dev/null 2>&1
-    /sbin/service ovirt stop >/dev/null 2>&1
-    /sbin/service ovirt-post stop >/dev/null 2>&1
-    /sbin/chkconfig --del ovirt-awake
-    /sbin/chkconfig --del ovirt-early
-    /sbin/chkconfig --del ovirt-firstboot
-    /sbin/chkconfig --del ovirt
-    /sbin/chkconfig --del ovirt-post
-fi
-
-
-%files tools
-%defattr(0644,root,root,0755)
-%doc README COPYING
-%{tools_root}/*.ks
-%defattr(0755,root,root,0755)
-%{_sbindir}/node-creator
-
-
-%files
-%defattr(-,root,root)
-%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/default/ovirt
-
-%config(noreplace) %{_sysconfdir}/logrotate.d/ovirt-node
-%config(noreplace) %{_sysconfdir}/cron.d/ovirt-logrotate
-
-%{mgmt_scripts_dir}
-%{_sysconfdir}/ovirt-config-boot.d
-%config(noreplace) %{_sysconfdir}/sysconfig/node-config
-
-%if 0%{?fedora}
-%{_unitdir}/libvirtd.service
-%endif
-%if 0%{?rhel}
-%{_sysconfdir}/init/libvirtd.conf
-%endif
-
-%{_sysconfdir}/sysconfig/modules/vlan.modules
-%{_sysconfdir}/modprobe.d/ovirt-qla4xxx.conf
-
-%doc COPYING
-# should be ifarch i386
-%{app_root}/grub-splash.xpm.gz
-# end i386 bits
-%{app_root}/syslinux-vesa-splash.jpg
-%if 0%{?rhel}
-%{app_root}/dracut-3d88d27810acc7782618d67a03ff5c0e41494ca4.patch
-%{app_root}/dracut-93724aa28fc20c8b7f0167201d1759b7118ba890.patch
-%endif
-
-%{_datadir}/augeas/lenses/build.aug
-%{_datadir}/augeas/lenses/resolv.aug
-%{_datadir}/augeas/lenses/util.aug
-%{_datadir}/dracut/modules.d/91ovirtnode/check
-%{_datadir}/dracut/modules.d/91ovirtnode/install
-%{_datadir}/dracut/modules.d/91ovirtnode/ovirt-boot-functions
-%{_datadir}/dracut/modules.d/91ovirtnode/ovirt-cleanup.sh
-%{_sysconfdir}/dracut.conf.d/ovirt-dracut.conf
-%{_libexecdir}/ovirt-auto-install
-%{_libexecdir}/ovirt-config-boot
-%{_libexecdir}/ovirt-config-hostname
-%{_libexecdir}/ovirt-config-iscsi
-%{_libexecdir}/ovirt-config-kdump
-%{_libexecdir}/ovirt-config-logging
-%{_libexecdir}/ovirt-config-networking
-%{_libexecdir}/ovirt-config-password
-%{_libexecdir}/ovirt-config-rhn
-%{_libexecdir}/ovirt-config-snmp
-%{_libexecdir}/ovirt-config-storage
-%{_libexecdir}/ovirt-config-uninstall
-%{_libexecdir}/ovirt-config-view-logs
-%{_libexecdir}/ovirt-functions
-%{_libexecdir}/ovirt-boot-functions
-%{_libexecdir}/ovirt-process-config
-%{_libexecdir}/ovirt-rpmquery
-%{_libexecdir}/ovirt-config-installer
-%{_libexecdir}/ovirt-config-setup
-%{_libexecdir}/ovirt-admin-shell
-%{_sbindir}/persist
-%{_sbindir}/unpersist
-%{python_sitelib}/ovirt_config_setup
-%{python_sitelib}/ovirtnode
-#%if 0%{?rhel}
-%{python_sitelib}/augeas*
-#%endif
-
-%{_initrddir}/ovirt-awake
-%{_initrddir}/ovirt-early
-%{_initrddir}/ovirt-firstboot
-%{_initrddir}/ovirt
-%{_initrddir}/ovirt-post
-%{_sysconfdir}/ovirt-early.d
-%{_sysconfdir}/ovirt-commandline.d
-
-%changelog
-* Mon Jun 20 2011 Alan Pevec <
[email protected]> 2.0.0-1
-- split kickstarts per distro, currently ovirt15 and rhevh6
-- new installation and configuration text UI for standalone mode
-- drop gptsync, make it noarch
-
-* Tue Apr 04 2010 Darryl L. Pierce <
[email protected]> - 1.9.2-1
-- Updated autoconf environment.
-- Allow persistence of empty configuration files.
-
-* Wed Mar 24 2010 Darryl L. Pierce <
[email protected]> - 1.9.1-1
-- Update ovirt-process-config to fail configs that are missing the field name or value.
-- Updated build system will use Fedora 13 as the rawhide repo.
-- Fixed ovirt-config-networking to not report success when network start fails.
-- Reboot hangs on /etc [FIXED].
-- Multipath translation performance improvements.
-- Cleanup ROOTDRIVE when partitioning.
-- Fix hang when cleaning dirty storage.
-- The order of the oVirt SysVInit scripts has been changed.
--   ovirt-early -> ovirt-awake -> ovirt -> ovirt-post
-- Fixes to the SysVINit scripts to name lifecycle methods propery.
-- Added psmisc package.
-- Added default KEYTAB_FILE name to /etc/sysconfig/node-config.
-- Fixes to the persist and unpersist commands to handle already persisted files and directories.
-- Duplicate NTP/DNS entries are rejected during network setup.
-
-* Wed Oct 07 2009 David Huff <
[email protected]> - 1.0.3-4
-- Added ovirt-node-tools subpackage
-
-* Thu Jun 23 2009 David Huff <
[email protected]> - 1.0.3
-- Clean up spec for inclusion in Fedora
-- Removed subpackages, stateful, stateless, logos, and selinux
-
-* Thu Dec 11 2008 Perry Myers <
[email protected]> - 0.96
-- Subpackage stateful/stateless to separate out functionality for
-  embedded Node and Node running as part of already installed OS
-- ovirt-config-* setup scripts for standalone mode
-
-* Thu Sep 11 2008 Chris Lalancette <
[email protected]> - 0.92 0.7
-- Add the ovirt-install- and ovirt-uninstall-node scripts, and refactor
-  post to accomodate
-
-* Mon Sep  8 2008 Jim Meyering <
[email protected]> - 0.92 0.6
-- Update ovirt-identify-node's build rule.
-
-* Fri Aug 22 2008 Chris Lalancette <
[email protected]> - 0.92 0.5
-- Add the ovirt-listen-awake daemon to the RPM
-
-* Fri Aug 22 2008 Chris Lalancette <
[email protected]> - 0.92 0.4
-- Re-arrange the directory layout, in preparation for ovirt-listen-awake
-
-* Tue Jul 29 2008 Perry Myers <
[email protected]> - 0.92 0.2
-- Added /etc/ovirt-release and merged ovirt-setup into spec file
-
-* Wed Jul 02 2008 Darryl Pierce <
[email protected]> - 0.92 0.2
-- Added log rotation to limit file system writes.
-
-* Mon Jun 30 2008 Perry Myers <
[email protected]> - 0.92 0.1
-- Add in sections of kickstart post, general cleanup
 
+++ /dev/null
-options qla4xxx ql4xdisablesysfsboot=1
 
+++ /dev/null
-ovirt-node-image.ks
-repos.ks
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-PACKAGE           = ovirt-node-image
-RECIPE            = $(PACKAGE).ks
-PRODUCT           = oVirt Node Hypervisor
-PRODUCT_SHORT     ?= $(PRODUCT)
-PKG_FMT           = iso
-FEDORA            = @FEDORA@
-RHEL              = @RHEL@
-DISTRO            = @DISTRO@
-ARCH              = $(shell rpm --eval '%{_arch}')
-NODE_CREATOR      = $(shell test -e node-creator && echo "./node-creator" || echo "/usr/sbin/node-creator")
-
-FEDORA_MIRROR     = http://mirrors.fedoraproject.org/mirrorlist
-OVIRT_URL                = http://ovirt.org/releases/stable/fedora
-CUR_RAWHIDE       = 17
-CUR_DEVEL         = 17
-
-OVIRT_NODE_TOOLSdir = $(datadir)/ovirt-node-tools
-OVIRT_NODE_TOOLS_DATA =         \
-        repos.ks                \
-        *-install.ks     \
-        *-pkgs.ks        \
-        *-post.ks        \
-        *-minimizer.ks   \
-        common-nochroot.ks \
-        common-manifest.ks \
-        $(PACKAGE).ks
-
-EXTRA_DIST =                    \
-        *-install.ks     \
-        *-pkgs.ks        \
-        *-post.ks        \
-        *-minimizer.ks   \
-        common-nochroot.ks \
-        common-manifest.ks \
-        image-minimizer.ks.in   \
-        $(PACKAGE).ks.in        \
-        $(PACKAGE).ks
-
-dist_sbin_SCRIPTS = node-creator
-
-$(PACKAGE).ks: repos.ks version.ks
-
-repos.ks:
-       ( \
-         if [ -n "$(FEDORA)" ]; then \
-           if [ 0$(FEDORA) == 0$(CUR_RAWHIDE) ]; then \
-               FEDORA_REPO=rawhide ;\
-               FEDORA_REPO_LOC="$(if $(FEDORA_URL),--baseurl=$(FEDORA_URL)/development/rawhide/$(ARCH)/os,--mirrorlist=$(FEDORA_MIRROR)?repo=rawhide&arch=$(ARCH))" ;\
-                       OVIRT_REPO_LINE="repo --name=ovirt-repo --baseurl=$(OVIRT_URL)/$(FEDORA)\n" ;\
-           elif [ 0$(FEDORA) == 0$(CUR_DEVEL) ]; then \
-               FEDORA_REPO=f$(FEDORA) ;\
-               FEDORA_REPO_LOC="$(if $(FEDORA_URL),--baseurl=$(FEDORA_URL)/development/$(FEDORA)/$(ARCH)/os,--mirrorlist=$(FEDORA_MIRROR)?repo=fedora-$(FEDORA)&arch=$(ARCH))" ;\
-               UPDATE_REPO_LINE="repo --name=$${FEDORA_REPO}-updates-testing $(if $(FEDORA_URL),--baseurl=$(FEDORA_URL)/updates/testing/$(FEDORA)/${ARCH},--mirrorlist=$(FEDORA_MIRROR)?repo=updates-testing-f$(FEDORA)&arch=$(ARCH))\n" ;\
-                       OVIRT_REPO_LINE="repo --name=ovirt-repo --baseurl=$(OVIRT_URL)/$(FEDORA)\n" ;\
-           else \
-               FEDORA_REPO=f$(FEDORA) ;\
-               FEDORA_REPO_LOC="$(if $(FEDORA_URL),--baseurl=$(FEDORA_URL)/releases/$(FEDORA)/Everything/${ARCH}/os,--mirrorlist=$(FEDORA_MIRROR)?repo=fedora-$(FEDORA)&arch=$(ARCH))" ;\
-               UPDATE_REPO_LINE="repo --name=$${FEDORA_REPO}-updates $(if $(FEDORA_URL),--baseurl=$(FEDORA_URL)/updates/$(FEDORA)/${ARCH},--mirrorlist=$(FEDORA_MIRROR)?repo=updates-released-f$(FEDORA)&arch=$(ARCH))\n" ;\
-                       OVIRT_REPO_LINE="repo --name=ovirt-repo --baseurl=$(OVIRT_URL)/$(FEDORA)\n" ;\
-           fi ;\
-           echo "repo --name=$${FEDORA_REPO} $${FEDORA_REPO_LOC}" > repos.ks ;\
-           printf "$${UPDATE_REPO_LINE}" >> repos.ks ;\
-           printf "$${OVIRT_REPO_LINE}" >> repos.ks ;\
-         else \
-           echo "# OVIRT_REPO_URL=$(OVIRT_REPO_URL)" > $@ ;\
-           for repo in $(OVIRT_REPO_URL); do \
-              echo "repo --name=repo$${i} --baseurl=$${repo}" >> $@ ;\
-              i=$${i}_ ;\
-           done ;\
-         fi ;\
-       )
-
-RELEASE := $(shell rpm -q --qf "%{RELEASE}\n" --specfile ../ovirt-node.spec | head -n1)
-version.ks:
-       ( \
-           echo "PRODUCT='"$(PRODUCT)"'" ;\
-           echo "PRODUCT_SHORT='"$(PRODUCT_SHORT)"'" ;\
-           echo "PACKAGE=$(PACKAGE)" ;\
-           echo "VERSION=$(VERSION)" ;\
-           echo "RELEASE=$(RELEASE)" ;\
-       ) > $@
-
-$(PACKAGE).$(PKG_FMT) node: version.ks
-       $(NODE_CREATOR) $(RECIPE)
-
-.PHONY: repos.ks version.ks $(PACKAGE).ks
 
+++ /dev/null
-lang en_US.UTF-8
-keyboard us
-timezone --utc UTC
-auth --useshadow --enablemd5
-selinux --enforcing
-firewall --disabled
-# TODO: the sizing of the image needs to be more dynamic
-part / --size 1024 --fstype ext2
-
-# additional default boot parameters
-# Need to use deadline Scheduler for performance, rhbz#647301
-# VM timekeeping: Do not allow C2 state, rhbz#647300
-bootloader --timeout=30 --append="nomodeset check rootflags=ro crashkernel=512M-2G:64M,2G-:128M elevator=deadline processor.max_cstate=1 install quiet rd_NO_LVM"
-
-# not included by default in Fedora 10 livecd initramfs
-device virtio_blk
-device virtio_pci
-device scsi_wait_scan
-
-# multipath kmods
-device dm-multipath
-device dm-round-robin
-device dm-emc
-device dm-rdac
-device dm-hp-sw
-device scsi_dh_rdac
-
-# add missing scsi modules to initramfs
-device 3w-9xxx
-device 3w-sas
-device 3w-xxxx
-device a100u2w
-device aacraid
-device aic79xx
-device aic94xx
-device arcmsr
-device atp870u
-device be2iscsi
-device bfa
-device BusLogic
-device cciss
-device cxgb3i
-device dc395x
-device fnic
-device gdth
-device hpsa
-device hptiop
-device imm
-device initio
-device ips
-device libosd
-device libsas
-device libsrp
-device lpfc
-device megaraid
-device megaraid_mbox
-device megaraid_mm
-device megaraid_sas
-device mpt2sas
-device mvsas
-device osd
-device osst
-device pm8001
-device pmcraid
-device qla1280
-device qla2xxx
-device qla4xxx
-device qlogicfas408
-device stex
-device tmscsim
-
 
+++ /dev/null
-%post
-echo -n "Creating manifest"
-# Create post-image processing manifests
-rpm -qa --qf '%{name}-%{version}-%{release}.%{arch} (%{SIGPGP:pgpsig})\n' | \
-    sort > /manifest-rpm.txt
-rpm -qa --qf '%{sourcerpm}\n' | sort -u > /manifest-srpm.txt
-# collect all included licenses rhbz#601927
-rpm -qa --qf '%{license}\n' | sort -u > /manifest-license.txt
-# dependencies
-rpm -qa | xargs -n1 rpm -e --test 2> /manifest-deps.txt
-echo -n "."
-find / -xdev -print -exec rpm -qf {} \; > /manifest-owns.txt
-# this one is kept in root for ovirt-rpmquery
-rpm -qa --qf '%{NAME}\t%{VERSION}\t%{RELEASE}\t%{BUILDTIME}\n' | \
-    sort > /rpm-qa.txt
-echo -n "."
-
-du -akx --exclude=/var/cache/yum / > /manifest-file.txt
-du -x --exclude=/var/cache/yum / > /manifest-dir.txt
-echo -n "."
-bzip2 /manifest-deps.txt /manifest-owns.txt /manifest-file.txt /manifest-dir.txt
-echo -n "."
-
-%end
-
-%post --nochroot
-# Move manifests to ISO
-mv $INSTALL_ROOT/manifest-* $LIVE_ROOT/isolinux
-echo "done"
-
-# only works on x86, x86_64
-if [ "$(uname -i)" = "i386" -o "$(uname -i)" = "x86_64" ]; then
-    if [ ! -d $LIVE_ROOT/LiveOS ]; then mkdir -p $LIVE_ROOT/LiveOS ; fi
-    cp /usr/bin/livecd-iso-to-disk $LIVE_ROOT/LiveOS
-    cp /usr/bin/livecd-iso-to-pxeboot $LIVE_ROOT/LiveOS
-fi
-%end
 
+++ /dev/null
-droprpm system-config-*
-droprpm libsemanage-python
-
-droprpm mkinitrd
-droprpm isomd5sum
-droprpm dmraid
-droprpm checkpolicy
-droprpm make
-droprpm setools-libs-python
-droprpm setools-libs
-
-droprpm gamin
-droprpm pm-utils
-droprpm kbd
-droprpm usermode
-droprpm vbetool
-droprpm ConsoleKit
-droprpm hdparm
-droprpm efibootmgr
-droprpm linux-atm-libs
-droprpm mtools
-droprpm syslinux
-droprpm wireless-tools
-droprpm radeontool
-droprpm libicu
-droprpm gnupg2
-droprpm fedora-release-notes
-droprpm fedora-logos
-
-# rhbz#641494 - drop unnecessary rpms pulled in from libguestfs-winsupport
-droprpm fakechroot
-droprpm fakechroot-libs
-droprpm fakeroot
-droprpm fakeroot-libs
-droprpm febootstrap
-
-# cronie pulls in exim (sendmail) which pulls in all kinds of perl deps
-droprpm exim
-droprpm perl*
-# keep libperl for snmpd
-keeprpm perl-libs
-droprpm postfix
-droprpm mysql*
-
-droprpm sysklogd
-
-# unneeded rhn deps
-droprpm yum*
-
-# pam complains when this is missing
-keeprpm ConsoleKit-libs
-
-# kernel modules minimization
-
-# filesystems
-drop /lib/modules/*/kernel/fs
-keep /lib/modules/*/kernel/fs/ext*
-keep /lib/modules/*/kernel/fs/mbcache*
-keep /lib/modules/*/kernel/fs/squashfs
-keep /lib/modules/*/kernel/fs/jbd*
-keep /lib/modules/*/kernel/fs/btrfs
-keep /lib/modules/*/kernel/fs/fat
-keep /lib/modules/*/kernel/fs/nfs
-keep /lib/modules/*/kernel/fs/nfs_common
-keep /lib/modules/*/kernel/fs/fscache
-keep /lib/modules/*/kernel/fs/lockd
-keep /lib/modules/*/kernel/fs/nls/nls_utf8.ko
-keep /lib/modules/*/kernel/fs/configfs/configfs.ko
-# autofs4     configfs  exportfs *fat     *jbd    mbcache.ko  nls       xfs
-#*btrfs       cramfs   *ext2     *fscache *jbd2  *nfs         squashfs
-# cachefiles  dlm      *ext3      fuse     jffs2 *nfs_common  ubifs
-# cifs        ecryptfs *ext4      gfs2    *lockd  nfsd        udf
-
-# network
-drop /lib/modules/*/kernel/net
-keep /lib/modules/*/kernel/net/802*
-keep /lib/modules/*/kernel/net/bridge
-keep /lib/modules/*/kernel/net/core
-keep /lib/modules/*/kernel/net/ipv*
-keep /lib/modules/*/kernel/net/key
-keep /lib/modules/*/kernel/net/llc
-keep /lib/modules/*/kernel/net/netfilter
-keep /lib/modules/*/kernel/net/rds
-keep /lib/modules/*/kernel/net/sctp
-keep /lib/modules/*/kernel/net/sunrpc
-#*802    atm        can   ieee802154 *key      *netfilter  rfkill *sunrpc  xfrm
-#*8021q  bluetooth *core *ipv4       *llc       phonet     sched   wimax
-# 9p    *bridge     dccp *ipv6        mac80211 *rds       *sctp    wireless
-
-drop /lib/modules/*/kernel/sound
-
-# drivers
-drop /lib/modules/*/kernel/drivers
-keep /lib/modules/*/kernel/drivers/ata
-keep /lib/modules/*/kernel/drivers/block
-keep /lib/modules/*/kernel/drivers/cdrom
-keep /lib/modules/*/kernel/drivers/char
-keep /lib/modules/*/kernel/drivers/cpufreq
-keep /lib/modules/*/kernel/drivers/dca
-keep /lib/modules/*/kernel/drivers/dma
-keep /lib/modules/*/kernel/drivers/edac
-keep /lib/modules/*/kernel/drivers/firmware
-keep /lib/modules/*/kernel/drivers/idle
-keep /lib/modules/*/kernel/drivers/infiniband
-keep /lib/modules/*/kernel/drivers/md
-keep /lib/modules/*/kernel/drivers/message
-keep /lib/modules/*/kernel/drivers/net
-drop /lib/modules/*/kernel/drivers/net/pcmcia
-drop /lib/modules/*/kernel/drivers/net/wireless
-drop /lib/modules/*/kernel/drivers/net/ppp*
-keep /lib/modules/*/kernel/drivers/pci
-keep /lib/modules/*/kernel/drivers/scsi
-keep /lib/modules/*/kernel/drivers/staging/ramzswap
-keep /lib/modules/*/kernel/drivers/uio
-keep /lib/modules/*/kernel/drivers/usb
-drop /lib/modules/*/kernel/drivers/usb/atm
-drop /lib/modules/*/kernel/drivers/usb/class
-drop /lib/modules/*/kernel/drivers/usb/image
-drop /lib/modules/*/kernel/drivers/usb/misc
-drop /lib/modules/*/kernel/drivers/usb/serial
-keep /lib/modules/*/kernel/drivers/vhost
-keep /lib/modules/*/kernel/drivers/virtio
-
-# acpi       *cpufreq   hid         leds      mtd      ?regulator  uwb
-#*ata         crypto   ?hwmon      *md       *net*      rtc       *vhost
-# atm        *dca      ?i2c         media    ?parport  *scsi*      video
-# auxdisplay *dma      *idle        memstick *pci      ?serial    *virtio
-#*block      *edac      ieee802154 *message   pcmcia   ?ssb        watchdog
-# bluetooth   firewire *infiniband ?mfd       platform *staging    xen
-#*cdrom      *firmware  input       misc     ?power    ?uio
-#*char*      ?gpu       isdn        mmc      ?pps      *usb
-
-drop /usr/share/zoneinfo
-keep /usr/share/zoneinfo/UTC
-
-drop /etc/alsa
-drop /usr/share/alsa
-drop /usr/share/awk
-drop /usr/share/vim
-drop /usr/share/anaconda
-drop /usr/share/backgrounds
-drop /usr/share/wallpapers
-drop /usr/share/kde-settings
-drop /usr/share/gnome-background-properties
-drop /usr/share/dracut
-drop /usr/share/plymouth
-drop /usr/share/setuptool
-drop /usr/share/hwdata/MonitorsDB
-drop /usr/share/hwdata/oui.txt
-drop /usr/share/hwdata/videoaliases
-drop /usr/share/hwdata/videodrivers
-drop /usr/share/firstboot
-drop /usr/share/lua
-drop /usr/share/kde4
-drop /usr/share/pixmaps
-drop /usr/share/icons
-drop /usr/share/fedora-release
-drop /usr/share/tabset
-drop /usr/share/augeas/lenses/tests
-drop /usr/share/augeas/lenses/dist/*
-# generic includes
-keep /usr/share/augeas/lenses/dist/build.aug
-keep /usr/share/augeas/lenses/dist/hosts.aug
-keep /usr/share/augeas/lenses/dist/inifile.aug
-keep /usr/share/augeas/lenses/dist/modprobe.aug
-keep /usr/share/augeas/lenses/dist/rx.aug
-keep /usr/share/augeas/lenses/dist/sep.aug
-keep /usr/share/augeas/lenses/dist/shellvars.aug
-keep /usr/share/augeas/lenses/dist/spacevars.aug
-keep /usr/share/augeas/lenses/dist/sysctl.aug
-keep /usr/share/augeas/lenses/dist/util.aug
-# whitelist only relevant lenses
-keep /usr/share/augeas/lenses/dist/buildd.aug
-keep /usr/share/augeas/lenses/dist/cgconfig.aug
-keep /usr/share/augeas/lenses/dist/cgrules.aug
-keep /usr/share/augeas/lenses/dist/cron.aug
-keep /usr/share/augeas/lenses/dist/dhclient.aug
-keep /usr/share/augeas/lenses/dist/dnsmasq.aug
-keep /usr/share/augeas/lenses/dist/ethers.aug
-keep /usr/share/augeas/lenses/dist/exports.aug
-keep /usr/share/augeas/lenses/dist/fstab.aug
-keep /usr/share/augeas/lenses/dist/group.aug
-keep /usr/share/augeas/lenses/dist/grub.aug
-keep /usr/share/augeas/lenses/dist/inittab.aug
-keep /usr/share/augeas/lenses/dist/iptables.aug
-keep /usr/share/augeas/lenses/dist/json.aug
-keep /usr/share/augeas/lenses/dist/krb5.aug
-keep /usr/share/augeas/lenses/dist/limits.aug
-keep /usr/share/augeas/lenses/dist/logrotate.aug
-keep /usr/share/augeas/lenses/dist/lokkit.aug
-keep /usr/share/augeas/lenses/dist/modules_conf.aug
-keep /usr/share/augeas/lenses/dist/multipath.aug
-keep /usr/share/augeas/lenses/dist/ntp.aug
-keep /usr/share/augeas/lenses/dist/pam.aug
-keep /usr/share/augeas/lenses/dist/passwd.aug
-keep /usr/share/augeas/lenses/dist/resolv.aug
-keep /usr/share/augeas/lenses/dist/securetty.aug
-keep /usr/share/augeas/lenses/dist/services.aug
-keep /usr/share/augeas/lenses/dist/shellvars_list.aug
-keep /usr/share/augeas/lenses/dist/sshd.aug
-keep /usr/share/augeas/lenses/dist/sudoers.aug
-keep /usr/share/augeas/lenses/dist/utill.aug
-drop /usr/share/tc
-drop /usr/share/emacs
-drop /usr/share/info
-drop /usr/src
-drop /usr/etc
-drop /usr/games
-drop /usr/include
-keep /usr/include/python2.*
-drop /usr/local
-drop /usr/sbin/dell*
-keep /usr/sbin/build-locale-archive
-drop /usr/sbin/glibc_post_upgrade.*
-drop /usr/lib*/tc
-drop /usr/lib*/tls
-drop /usr/lib*/sse2
-drop /usr/lib*/pkgconfig
-drop /usr/lib*/nss
-drop /usr/lib*/games
-drop /usr/lib*/alsa-lib
-drop /usr/lib*/krb5
-drop /usr/lib*/hal
-drop /usr/lib*/gio
-# syslinux
-drop /usr/share/syslinux
-# glibc-common locales
-drop /usr/lib/locale
-keep /usr/lib/locale/locale-archive
-keep /usr/lib/locale/usr/share/locale/en_US
-# pango
-drop /usr/lib*/pango
-drop /usr/lib*/libpango*
-drop /usr/lib*/libthai*
-drop /usr/share/libthai
-drop /etc/pango
-drop /usr/bin/pango*
-# hal
-drop /usr/bin/hal-disable-polling
-drop /usr/bin/hal-is-caller-locked-out
-drop /usr/bin/hal-is-caller-privileged
-drop /usr/bin/hal-lock
-drop /usr/bin/hal-set-property
-drop /usr/bin/hal-setup-keymap
-# openssh
-drop /usr/bin/sftp
-drop /usr/bin/slogin
-drop /usr/bin/ssh-add
-drop /usr/bin/ssh-agent
-drop /usr/bin/ssh-keyscan
-# docs
-drop /usr/share/omf
-drop /usr/share/gnome
-drop /usr/share/doc
-keep /usr/share/doc/*-firmware-*
-drop /usr/share/locale/
-keep /usr/share/locale/en_US
-drop /usr/share/man
-drop /usr/share/X11
-drop /usr/share/i18n
-drop /boot/*
-keep /boot/efi
-drop /var/lib/builder
-drop /var/lib/yum
-drop /usr/sbin/rhn_register
-drop /usr/sbin/*-channel
-
-drop /usr/share/selinux
-
-drop /usr/lib*/libboost*
-keep /usr/lib*/libboost_program_options.so*
-keep /usr/lib*/libboost_filesystem.so*
-keep /usr/lib*/libboost_thread-mt.so*
-keep /usr/lib*/libboost_system.so*
-drop /usr/kerberos
-keep /usr/kerberos/bin/kinit
-keep /usr/kerberos/bin/klist
-drop /lib/firmware
-keep /lib/firmware/3com
-keep /lib/firmware/acenic
-keep /lib/firmware/adaptec
-keep /lib/firmware/advansys
-keep /lib/firmware/bnx2
-keep /lib/firmware/bnx2x
-keep /lib/firmware/bnx2x*
-keep /lib/firmware/cxgb3
-keep /lib/firmware/cxgb4
-keep /lib/firmware/e100
-keep /lib/firmware/myricom
-keep /lib/firmware/ql*
-keep /lib/firmware/sun
-keep /lib/firmware/tehuti
-keep /lib/firmware/tigon
-keep /lib/firmware/cbfw_fc.bin
-keep /lib/firmware/ctfw_cna.bin
-keep /lib/firmware/ctfw_fc.bin
-keep /lib/firmware/aic94xx-seq.fw
-
-drop /lib/kbd/consolefonts
-drop /etc/pki/tls
-keep /etc/pki/tls/openssl.cnf
-drop /etc/pki/java
-drop /etc/pki/nssdb
-drop /etc/pki/rpm-gpg
-
-# minimize net-snmp
-drop /etc/rc.d/init.d/snmptrapd
-drop /etc/snmp/snmptrapd.conf
-drop /etc/sysconfig/snmptrapd
-drop /usr/sbin/snmptrapd
-drop /usr/bin/net-snmp-create-v3-user
-drop /usr/bin/snmpconf
-drop /usr/share/snmp/snmpconf-data
-
-#desktop files
-drop /etc/xdg/autostart/restorecond.desktop
-
-#ebtables depends on perl
-drop /sbin/ebtables-save
-drop /sbin/ebtables-restore
-
-# remove bogus kdump script (rpmdiff complains)
-drop /etc/kdump-adv-conf
 
+++ /dev/null
-
-%include version.ks
-
-if [ -f "ovirt-authorized_keys" ]; then
-  echo "Adding authorized_keys to Image"
-  mkdir -p $INSTALL_ROOT/root/.ssh
-  cp -v ovirt-authorized_keys $INSTALL_ROOT/root/.ssh/authorized_keys
-  chown -R root:root $INSTALL_ROOT/root/.ssh
-  chmod 755 $INSTALL_ROOT/root/.ssh
-  chmod 644 $INSTALL_ROOT/root/.ssh/authorized_keys
-fi
-
-echo "Fixing boot menu"
-# remove quiet from Node bootparams, added by livecd-creator
-sed -i -e 's/ quiet//' $LIVE_ROOT/isolinux/isolinux.cfg
-
-# Remove Verify and Boot option
-sed -i -e '/label check0/{N;N;N;d;}' $LIVE_ROOT/isolinux/isolinux.cfg
-
-# Rename Boot option to Install or Upgrade
-sed -i 's/^  menu label Boot$/  menu label Install or Upgrade/' $LIVE_ROOT/isolinux/isolinux.cfg
-
-# add serial console boot entry
-menu=$(mktemp)
-awk '
-/^label linux0/ { linux0=1 }
-linux0==1 && $1=="append" {
-  append0=$0
-}
-linux0==1 && $1=="label" && $2!="linux0" {
-  linux0=2
-  print "label serial-console"
-  print "  menu label Install or Upgrade with serial console"
-  print "  kernel vmlinuz0"
-  print append0" console=ttyS0,115200n8 "
-  print "label reinstall"
-  print "  menu label Reinstall"
-  print "  kernel vmlinuz0"
-  print append0" reinstall "
-  print "label reinstall-serial"
-  print "  menu label Reinstall with serial console"
-  print "  kernel vmlinuz0"
-  print append0" reinstall console=ttyS0,115200n8 "
-  print "label uninstall"
-  print "  menu label Uninstall"
-  print "  kernel vmlinuz0"
-  print append0" uninstall "
-}
-{ print }
-' $LIVE_ROOT/isolinux/isolinux.cfg > $menu
-# change the title
-sed -i -e '/^menu title/d' $menu
-echo "say This is the $PRODUCT $VERSION ($RELEASE)" > $LIVE_ROOT/isolinux/isolinux.cfg
-echo "menu title ${PRODUCT_SHORT} $VERSION ($RELEASE)" >> $LIVE_ROOT/isolinux/isolinux.cfg
-cat $menu >> $LIVE_ROOT/isolinux/isolinux.cfg
-rm $menu
-cp $INSTALL_ROOT/usr/share/ovirt-node/syslinux-vesa-splash.jpg $LIVE_ROOT/isolinux/splash.jpg
-
-# store image version info in the ISO and rootfs
-cat > $LIVE_ROOT/isolinux/version <<EOF
-PRODUCT='$PRODUCT'
-PRODUCT_SHORT='${PRODUCT_SHORT}'
-PRODUCT_CODE=$PRODUCT_CODE
-RECIPE_SHA256=$RECIPE_SHA256
-RECIPE_RPM=$RECIPE_RPM
-PACKAGE=$PACKAGE
-VERSION=$VERSION
-RELEASE=$RELEASE
-EOF
-cp $LIVE_ROOT/isolinux/version $INSTALL_ROOT/etc/default/
-
-# overwrite user visible banners with the image versioning info
-cat > $INSTALL_ROOT/etc/$PACKAGE-release <<EOF
-$PRODUCT release $VERSION ($RELEASE)
-EOF
-ln -snf $PACKAGE-release $INSTALL_ROOT/etc/redhat-release
-ln -snf $PACKAGE-release $INSTALL_ROOT/etc/system-release
-cp $INSTALL_ROOT/etc/$PACKAGE-release $INSTALL_ROOT/etc/issue
-echo "Kernel \r on an \m (\l)" >> $INSTALL_ROOT/etc/issue
-cp $INSTALL_ROOT/etc/issue $INSTALL_ROOT/etc/issue.net
 
+++ /dev/null
-audit
-bc
-cracklib-python
-ethtool
-kernel
-hwdata
-passwd
-policycoreutils
-rootfiles
-dhclient
-openssh-clients
-openssh-server
-kvm
-libmlx4
-ovirt-node
-selinux-policy-targeted
-vim-minimal
-sudo
-python
-python-gudev
-python-libs
-python-setuptools
-PyPAM
-db4
-vconfig
-python-virtinst
-# debugging
-hdparm
-sos
-gdb
-ltrace
-strace
-sysstat
-tcpdump
-pciutils
-usbutils
-lsscsi
-psmisc
-numactl
-file
-lsof
-newt-python
-systemtap-runtime
-qemu-kvm-tools
-setools-console
-# remove
--audit-libs-python
--ustr
--authconfig
--wireless-tools
--setserial
--prelink
--newt
--libselinux-python
--kbd
--usermode
--dmraid
--gzip
--less
--which
--parted
--tar
--libuser
--mtools
--cpio
-/usr/sbin/lokkit
-isomd5sum
-irqbalance
-acpid
-device-mapper-multipath
-kpartx
-dracut-network
-dracut-fips
-patch
-e2fsprogs
-sysfsutils
-less
-# Autotest support rhbz#631795
-dosfstools
-# host statistics rhbz#588852
-vhostmd
-# kdump
-kexec-tools
-# SNMP support rhbz#614870
-net-snmp
-# qlogic firmware
-ql2100-firmware
-ql2200-firmware
-ql23xx-firmware
-ql2400-firmware
-ql2500-firmware
-# more firmwares
-aic94xx-firmware
-bfa-firmware
-
-# dracut dmsquash-live module requires eject
-eject
-
-# for building custom selinux module
-make
-checkpolicy
-#
-policycoreutils-python
-# crypto swap support
-cryptsetup-luks
-# rhbz#641494 RFE - add libguestfs
-libguestfs
-python-libguestfs
-libguestfs-tools-c
-python-hivex
-febootstrap-supermin-helper
-# sosreport soft-dep
-rpm-python
-#VDSM
-vdsm-cli
-vdsm-reg
 
+++ /dev/null
-# -*-Shell-script-*-
-echo "Starting Kickstart Post"
-PATH=/sbin:/usr/sbin:/bin:/usr/bin
-export PATH
-
-# cleanup rpmdb to allow non-matching host and chroot RPM versions
-rm -f /var/lib/rpm/__db*
-
-echo "Creating shadow files"
-# because we aren't installing authconfig, we aren't setting up shadow
-# and gshadow properly.  Do it by hand here
-pwconv
-grpconv
-
-echo "Lock root account"
-passwd -l root
-
-# set SELinux booleans
-# rhbz#502779 restrict certain memory protection operations
-#     keep allow_execmem on for grub
-# rhbz#642209 allow virt images on NFS
-semanage  boolean -m -S targeted -F /dev/stdin  << \EOF_semanage
-allow_execstack=0
-virt_use_nfs=1
-EOF_semanage
-
-# make sure we don't autostart virbr0 on libvirtd startup
-rm -f /etc/libvirt/qemu/networks/autostart/default.xml
-
-# rhevh uses libvirtd upstart job, sysv initscript must not interfere
-rm -f /etc/rc.d/init.d/libvirtd
-
-# remove the /etc/krb5.conf file; it will be fetched on bootup
-rm -f /etc/krb5.conf
-
-# Remove the default logrotate daily cron job
-# since we run it every 10 minutes instead.
-rm -f /etc/cron.daily/logrotate
-
-# root's bash profile
-cat >> /root/.bashrc << \EOF_bashrc
-# aliases used for the temporary
-function mod_vi() {
-  /bin/vi $@
-  restorecon -v $@
-}
-alias vi="mod_vi"
-alias ping='ping -c 3'
-export MALLOC_CHECK_=1
-export LVM_SUPPRESS_FD_WARNINGS=0
-EOF_bashrc
-
-# directories required in the image with the correct perms
-# config persistance currently handles only regular files
-mkdir -p /root/.ssh
-chmod 700 /root/.ssh
-mkdir -p /boot
-mkdir -p /boot-kdump
-mkdir -p /config
-mkdir -p /data
-mkdir -p /data2
-mkdir -p /live
-mkdir -p /liveos
-mkdir -p /root/.uml
-mkdir -p /var/cache/multipathd
-touch /var/lib/random-seed
-echo "/dev/HostVG/Config /config ext4 defaults,noauto,noatime 0 0" >> /etc/fstab
-
-# prepare for STATE_MOUNT in rc.sysinit
-augtool << \EOF_readonly-root
-set /files/etc/sysconfig/readonly-root/STATE_LABEL CONFIG
-set /files/etc/sysconfig/readonly-root/STATE_MOUNT /config
-set /files/etc/sysconfig/readonly-root/READONLY yes
-save
-EOF_readonly-root
-
-# comment out /etc/* entries in rwtab to prevent overlapping mounts
-sed -i '/^files        \/etc*/ s/^/#/' /etc/rwtab
-cat > /etc/rwtab.d/ovirt << \EOF_rwtab_ovirt
-files  /etc
-dirs   /var/lib/multipath
-dirs   /var/lib/net-snmp
-dirs    /var/lib/dnsmasq
-files  /root/.ssh
-dirs   /root/.uml
-dirs   /root/.virt-manager
-dirs   /home/admin/.virt-manager
-files  /var/cache/libvirt
-files  /var/empty/sshd/etc/localtime
-files  /var/lib/libvirt
-files   /var/lib/multipath
-files   /var/cache/multipathd
-empty  /mnt
-empty  /live
-files  /boot
-empty  /boot-kdump
-empty  /cgroup
-EOF_rwtab_ovirt
-
-# fix iSCSI/LVM startup issue
-sed -i 's/node\.session\.initial_login_retry_max.*/node.session.initial_login_retry_max = 60/' /etc/iscsi/iscsid.conf
-
-#lvm.conf should use /dev/mapper and /dev/sdX devices
-# and not /dev/dm-X devices
-sed -i 's/preferred_names = \[ "^\/dev\/mpath\/", "^\/dev\/mapper\/mpath", "^\/dev\/\[hs\]d" \]/preferred_names = \[ "^\/dev\/mapper", "^\/dev\/\[hsv\]d" \]/g' /etc/lvm/lvm.conf
-
-# unset AUDITD_LANG to prevent boot errors
-sed -i '/^AUDITD_LANG*/ s/^/#/' /etc/sysconfig/auditd
-
-# kdump configuration
-augtool << \EOF_kdump
-set /files/etc/sysconfig/kdump/KDUMP_BOOTDIR /boot-kdump
-set /files/etc/sysconfig/kdump/MKDUMPRD_ARGS --allow-missing
-save
-EOF_kdump
-
-echo 'OPTIONS="-v -Lf /dev/null"' >> /etc/sysconfig/snmpd
-cat > /etc/snmp/snmpd.conf << \EOF_snmpd
-master agentx
-dontLogTCPWrappersConnects yes
-rwuser root auth .1
-EOF_snmpd
-
-# add admin user for configuration ui
-useradd admin
-usermod -G wheel admin
-usermod -s /usr/libexec/ovirt-admin-shell admin
-echo "%wheel   ALL=(ALL)       NOPASSWD: ALL" >> /etc/sudoers
-
-# load modules required by crypto swap
-cat > /etc/sysconfig/modules/swap-crypt.modules << \EOF_swap-crypt
-#!/bin/sh
-
-modprobe aes >/dev/null 2>&1
-modprobe dm_mod >/dev/null 2>&1
-modprobe dm_crypt >/dev/null 2>&1
-modprobe cryptoloop >/dev/null 2>&1
-modprobe cbc >/dev/null 2>&1
-modprobe sha256 >/dev/null 2>&1
-
-EOF_swap-crypt
-chmod +x /etc/sysconfig/modules/swap-crypt.modules
-
-#strip out all unncesssary locales
-localedef --list-archive | grep -v -i -E 'en_US.utf8' |xargs localedef --delete-from-archive
-mv /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl
-/usr/sbin/build-locale-archive
-
-# use static RPC ports, to avoid collisions
-augtool << \EOF_nfs
-set /files/etc/sysconfig/nfs/RQUOTAD_PORT 875
-set /files/etc/sysconfig/nfs/LOCKD_TCPPORT 32803
-set /files/etc/sysconfig/nfs/LOCKD_UDPPORT 32769
-set /files/etc/sysconfig/nfs/MOUNTD_PORT 892
-set /files/etc/sysconfig/nfs/STATD_PORT 662
-set /files/etc/sysconfig/nfs/STATD_OUTGOING_PORT 2020
-save
-EOF_nfs
-
-# sosreport fixups for node image:
-# use .pyc for plugins enumeration, .py is blacklisted
-# include *-release
-patch --fuzz 3 -d /usr/lib/python2.*/site-packages/sos -p0 << \EOF_sos_patch
---- sosreport.py.orig  2011-04-07 11:51:40.000000000 +0000
-+++ sosreport.py       2011-07-06 13:26:44.000000000 +0000
-@@ -428,8 +428,8 @@
- 
-     # validate and load plugins
-     for plug in plugins:
--        plugbase =  plug[:-3]
--        if not plug[-3:] == '.py' or plugbase == "__init__":
-+        plugbase =  plug[:-4]
-+        if not plug[-4:] == '.pyc' or plugbase == "__init__":
-             continue
-         try:
-             if GlobalVars.policy.validatePlugin(pluginpath + plug):
---- plugins/general.py.orig     2011-02-09 15:25:48.000000000 +0000
-+++ plugins/general.py  2011-07-06 23:13:32.000000000 +0000
-@@ -25,8 +25,7 @@
-                   ("all_logs", "collect all log files defined in syslog.conf", "", False)]
- 
-     def setup(self):
--        self.addCopySpec("/etc/redhat-release")
--        self.addCopySpec("/etc/fedora-release")
-+        self.addCopySpec("/etc/*-release")
-         self.addCopySpec("/etc/inittab")
-         self.addCopySpec("/etc/sos.conf")
-         self.addCopySpec("/etc/sysconfig")
-EOF_sos_patch
-python -m compileall /usr/lib/python2.*/site-packages/sos
-
-# XXX someting is wrong with readonly-root and dracut
-# see modules.d/95rootfs-block/mount-root.sh
-sed -i "s/defaults,noatime/defaults,ro,noatime/g" /etc/fstab
-
-echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config
-
-#mount kernel debugfs
-echo "debugfs /sys/kernel/debug debugfs 0 0" >> /etc/fstab
-
-# create .virt-manager directories for readonly root
-mkdir -p /root/.virt-manager /home/admin/.virt-manager
-
-#symlink virt-manager-tui pointer file to .pyc version
-sed -i "s/tui.py/tui.pyc/g" /usr/bin/virt-manager-tui
-
-#set NETWORKING off by default
-augtool << \EOF_NETWORKING
-set /files/etc/sysconfig/network/NETWORKING no
-save
-EOF_NETWORKING
-
-# disable SSH password auth by default
-# set ssh timeouts for increased security
-augtool << \EOF_sshd_config
-set /files/etc/ssh/sshd_config/PasswordAuthentication no
-set /files/etc/ssh/sshd_config/ClientAliveInterval 300
-set /files/etc/ssh/sshd_config/ClientAliveCountMax 3
-save
-EOF_sshd_config
-
 
+++ /dev/null
-# oVirt Node image recipe
-# This an example TEMPLATE for customizations.
-
-%include common-install.ks
-# add custom installation directives here
-
-%include repos.ks
-# add custom repos here
-
-%packages --excludedocs --nobase
-%include common-pkgs.ks
-# add custom package list here
-
-%end
-
-%post
-%include common-post.ks
-# add custom post-scripts here
-
-%end
-
-%include common-blacklist.ks
-
-%post --nochroot
-%include common-post-nochroot.ks
-# add custom post-scripts running outside image chroot here
-
-%end
-
-%include common-manifest-post.ks
-
 
+++ /dev/null
-# remove
--fedora-release
--fedora-release-notes
--fedora-logos
-generic-logos
-# Fedora only packages
-collectd-virt
-libvirt-qmf
-# install selected Matahari agents and the broker
-matahari-broker
-matahari-host
-#
-anyterm
-glusterfs-client
-# F15 dracut missing dep, bz# ???
-less
 
+++ /dev/null
-%post --nochroot --interpreter image-minimizer
-%include common-minimizer.ks
-%end
-
-%post
-echo "Removing python source files"
-find /usr -name '*.py' -exec rm -f {} \;
-find /usr -name '*.pyo' -exec rm -f {} \;
-
-%end
 
+++ /dev/null
-#!/bin/bash
-
-# Copyright (C) 2010, Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-# NAME
-#       node-creator - prepare the kickstart recipe and build the LiveCD image
-# SYNOPSIS
-#       node-creator [<RECIPE> [<BREW_TARGET>]]
-# ENVIRONMENT
-#       RECIPE - path to the kickstart recipe, can have relative %include
-#       BREW_TARGET - Brew build target e.g. rhev-h-5E-build
-#       REPO - if not set, use the latest Brew repo for BREW_TARGET
-#       OVIRT_CACHE_DIR - work folder for livecd-creator
-
-# Requires: sudo livecd-creator, sudo setenforce, ksflatten
-
-ME=$(basename "$0")
-warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
-die() { warn "$*"; exit 1; }
-
-RECIPE=${RECIPE:-$1}
-if [ -z "$RECIPE" -o "$RECIPE" != "${RECIPE#-}" ]; then
-    die "Usage: $ME [<recipe.ks> [<Brew-target>]]"
-fi
-LABEL=$(basename "$RECIPE")
-LABEL=${LABEL%%.ks}
-
-BREW_TARGET=${BREW_TARGET:-$2}
-if [ -z "$REPO" -a -n "$BREW_TARGET" ]; then
-    REPO=http://download.devel.redhat.com/brewroot/repos/$BREW_TARGET/latest/x86_64
-fi
-
-OVIRT_CACHE_DIR="${OVIRT_CACHE_DIR:-$HOME/ovirt-cache}"
-ARCH=$(rpm --eval '%{_arch}')
-NODE_TMP="$OVIRT_CACHE_DIR/node-creator-$ARCH-tmp"
-mkdir -p "$NODE_TMP"
-NODE_KS="$NODE_TMP/$LABEL.ks"
-
-if pgrep -xl nscd; then
-    die "Please stop nscd first"
-fi
-
-rm -f "$NODE_KS" "$NODE_KS.tmp"
-# combine recipe includes
-ksflatten --config "$RECIPE" --output "$NODE_KS.tmp"
-# XXX broken ksflatten leaves %include
-sed -i 's/^%include /#&/' "$NODE_KS.tmp"
-# add build repositories
-if [ -n "$REPO" ]; then
-    echo "repo --name=build --baseurl=$REPO" >> "$NODE_KS"
-fi
-if [ -n "$OVIRT_LOCAL_REPO" ]; then
-    echo "repo --name=local --baseurl=$OVIRT_LOCAL_REPO" >> "$NODE_KS"
-fi
-cat "$NODE_KS.tmp" >> "$NODE_KS"
-rm -f "$NODE_KS.tmp"
-
-mkdir -p "$OVIRT_CACHE_DIR/yum-$ARCH"
-SELINUX_ENFORCING=$(/usr/sbin/getenforce)
-case "$SELINUX_ENFORCING" in
-    Enforcing) sudo /usr/sbin/setenforce Permissive ;;
-    Permissive) ;;
-    *) if grep -q '^selinux --disabled' "$NODE_KS";
-           then
-               warn "WARNING: SELinux disabled in kickstart"
-           else
-               die "ERROR: SELinux enabled in kickstart, \
-               but disabled on the build machine"
-       fi ;;
-esac
-sudo livecd-creator -c "$NODE_KS" -f "$LABEL" \
-    --tmpdir="$NODE_TMP" \
-    --cache="$OVIRT_CACHE_DIR/yum-$ARCH"
-if [ "$SELINUX_ENFORCING" = Enforcing ]; then
-    sudo /usr/sbin/setenforce Enforcing
-fi
 
+++ /dev/null
-# @DISTRO@ Node image recipe
-
-%include common-install.ks
-
-%include repos.ks
-
-%packages --excludedocs --nobase
-%include common-pkgs.ks
-
-%end
-
-%post
-%include common-post.ks
-%end
-
-%post --nochroot
-%include common-nochroot.ks
-
-%end
-
-@IMAGE_MINIMIZER@
-
-%include common-manifest.ks
-
 
+++ /dev/null
-services --enabled=auditd,ntpd,ntpdate,iptables,network,rsyslog,multipathd,snmpd,ovirt-early,ovirt,ovirt-post,anyterm,collectd,libvirt-qmf,matahari-host,libvirtd,cgconfig
 
+++ /dev/null
-# Fedora specific image minimization
-keep /usr/share/virt-manager
 
+++ /dev/null
-%include fedora-pkgs.ks
-matahari-network
-virt-manager-tui
 
+++ /dev/null
-# ovirt-install-node-stateless
-# ovirt_setup_libvirtd()
-    # just to get a boot warning to shut up
-    touch /etc/resolv.conf
-
-    # make libvirtd listen on the external interfaces
-    sed -i -e 's/^#\(LIBVIRTD_ARGS="--listen"\).*/\1/' \
-       /etc/sysconfig/libvirtd
-
-    # set up qemu daemon to allow outside VNC connections
-    sed -i -e 's/^[[:space:]]*#[[:space:]]*\(vnc_listen = "0.0.0.0"\).*/\1/' \
-       /etc/libvirt/qemu.conf
-    # set up libvirtd to listen on TCP (for kerberos)
-    sed -i -e "s/^[[:space:]]*#[[:space:]]*\(listen_tcp\)\>.*/\1 = 1/" \
-       -e "s/^[[:space:]]*#[[:space:]]*\(listen_tls\)\>.*/\1 = 0/" \
-       /etc/libvirt/libvirtd.conf
-
-#ovirt_setup_anyterm()
-   # configure anyterm
-   cat >> /etc/sysconfig/anyterm << \EOF_anyterm
-ANYTERM_CMD="sudo /usr/bin/virsh console %p"
-ANYTERM_LOCAL_ONLY=false
-EOF_anyterm
-
-   # permit it to run the virsh console
-   echo "anyterm ALL=NOPASSWD: /usr/bin/virsh console *" >> /etc/sudoers
-
-# systemd configuration
-# set default runlevel to multi-user(3)
-
-rm -rf /etc/systemd/system/default.target
-ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
-
-# setup ovirt-firstboot multi-user dependency
-cat >> /lib/systemd/system/ovirt-firstboot.service << \EOF_firstboot
-[Unit]
-Description=firstboot configuration program (text mode)
-After=plymouth-quit.service
-
-[Service]
-Environment=RUNLEVEL=3
-ExecStartPre=-/bin/plymouth quit
-ExecStart=/etc/init.d/ovirt-firstboot start
-TimeoutSec=0
-RemainAfterExit=yes
-Type=oneshot
-SysVStartPriority=99
-StandardInput=tty-force
-
-[Install]
-WantedBy=multi-user.target
-EOF_firstboot
-
-systemctl enable ovirt-firstboot.service >/dev/null 2>&1
-chkconfig --del ovirt-firstboot
-
-echo "Configuring IPTables"
-# here, we need to punch the appropriate holes in the firewall
-cat > /etc/sysconfig/iptables << \EOF
-# oVirt automatically generated firewall configuration
-*filter
-:INPUT ACCEPT [0:0]
-:FORWARD ACCEPT [0:0]
-:OUTPUT ACCEPT [0:0]
--A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
--A INPUT -p icmp -j ACCEPT
--A INPUT -i lo -j ACCEPT
-# SSH
--A INPUT -p tcp --dport 22 -j ACCEPT
-# guest consoles
--A INPUT -p tcp -m multiport --dports 5634:6166 -j ACCEPT
-# migration
--A INPUT -p tcp -m multiport --dports 49152:49216 -j ACCEPT
-# snmp
--A INPUT -p udp --dport 161 -j ACCEPT
-#
--A INPUT -j REJECT --reject-with icmp-host-prohibited
--A FORWARD -m physdev ! --physdev-is-bridged -j REJECT --reject-with icmp-host-prohibited
-COMMIT
-EOF
-# configure IPv6 firewall, default is all ACCEPT
-cat > /etc/sysconfig/ip6tables << \EOF
-# oVirt automatically generated firewall configuration
-*filter
-:INPUT ACCEPT [0:0]
-:FORWARD ACCEPT [0:0]
-:OUTPUT ACCEPT [0:0]
--A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
--A INPUT -p ipv6-icmp -j ACCEPT
--A INPUT -i lo -j ACCEPT
-# SSH
--A INPUT -p tcp --dport 22 -j ACCEPT
-# guest consoles
--A INPUT -p tcp -m multiport --dports 5634:6166 -j ACCEPT
-# migration
--A INPUT -p tcp -m multiport --dports 49152:49216 -j ACCEPT
-# snmp
--A INPUT -p udp --dport 161 -j ACCEPT
-# unblock ipv6 dhcp response
--A INPUT -p udp --dport 546 -j ACCEPT
--A INPUT -j REJECT --reject-with icmp6-adm-prohibited
--A FORWARD -m physdev ! --physdev-is-bridged -j REJECT --reject-with icmp6-adm-prohibited
-COMMIT
-EOF
-
-python -m compileall /usr/share/virt-manager
-
-echo "Configuring SELinux"
-# custom module for node specific rules
-mkdir /tmp/SELinux
-cd /tmp/SELinux
-cat > ovirt.te << \EOF_OVIRT_TE
-module ovirt 1.0;
-require {
-    type initrc_t;
-    type initrc_tmp_t;
-    type mount_t;
-    type setfiles_t;
-    type shadow_t;
-    type unconfined_t;
-    class file { append mounton open getattr read execute ioctl lock entrypoint };
-    class fd { use };
-    class process { sigchld signull transition noatsecure siginh rlimitinh getattr };
-    class fifo_file { getattr open read write append lock ioctl };
-    class filesystem getattr;
-    class dir { getattr search open read lock ioctl };
-    class socket { read write };
-    class tcp_socket { read write };
-    class udp_socket { read write };
-    class rawip_socket { read write };
-    class netlink_socket { read write };
-    class packet_socket { read write };
-    class unix_stream_socket { read write create ioctl getattr lock setattr append bind connect getopt setopt shutdown connectto };
-    class unix_dgram_socket { read write };
-    class appletalk_socket { read write };
-    class netlink_route_socket { read write };
-    class netlink_firewall_socket { read write };
-    class netlink_tcpdiag_socket { read write };
-    class netlink_nflog_socket { read write };
-    class netlink_xfrm_socket { read write };
-    class netlink_selinux_socket { read write };
-    class netlink_audit_socket { read write };
-    class netlink_ip6fw_socket { read write };
-    class netlink_dnrt_socket { read write };
-    class netlink_kobject_uevent_socket { read write };
-    class tun_socket { read write };
-    class chr_file { getattr read write append ioctl lock open };
-    class lnk_file { getattr read };
-    class sock_file { getattr write open append };
-}
-allow mount_t shadow_t:file mounton;
-allow setfiles_t initrc_tmp_t:file append;
-type ovirt_exec_t;
-init_daemon_domain(unconfined_t,ovirt_exec_t)
-EOF_OVIRT_TE
-cat > ovirt.fc << \EOF_OVIRT_FC
-/etc/rc\.d/init\.d/ovirt-firstboot             -- gen_context(system_u:object_r:ovirt_exec_t)
-/etc/rc\.d/init\.d/ovirt-post             -- gen_context(system_u:object_r:ovirt_exec_t)
-EOF_OVIRT_FC
-make NAME=targeted -f /usr/share/selinux/devel/Makefile
-semodule -v -i ovirt.pp
-cd /
-rm -rf /tmp/SELinux
-
-# Workaround for rhbz#755464
-/sbin/service zfs-fuse stop 2>/dev/null
 
+++ /dev/null
-ovirt16-install.ks
\ No newline at end of file
 
+++ /dev/null
-ovirt16-minimizer.ks
\ No newline at end of file
 
+++ /dev/null
-ovirt16-pkgs.ks
\ No newline at end of file
 
+++ /dev/null
-ovirt16-post.ks
\ No newline at end of file
 
+++ /dev/null
-services --enabled=auditd,ntpd,ntpdate,iptables,network,rsyslog,multipathd,snmpd,ovirt-early,ovirt-post,cgconfig --disabled=rhn-virtualization-host,netfs,ovirt-awake,libvirt-guests,libvirtd
-
-
 
+++ /dev/null
-# RHEL specific image minimization
-droprpm cvs
-droprpm gettext
-droprpm hesiod
-droprpm procmail
-droprpm sendmail
-droprpm yum
-drop /etc/rc.d/init.d/libvirt-guests
 
+++ /dev/null
-# remove
--redhat-release-notes
-# workaround: vdsm-reg dep
-traceroute
-# supported hooks
-vdsm-hook-vhostmd
-# RHN agent
-rhn-virtualization-host
-rhn-setup
-virt-who
-subscription-manager
-# rhbz#641494 RFE - add libguestfs
-libguestfs-winsupport
 
+++ /dev/null
-# add RHEV-H rwtab locations
-mkdir -p /rhev
-mkdir -p /var/cache/rhn
-cat > /etc/rwtab.d/rhev << EOF_RWTAB_RHEVH
-empty  /rhev
-files  /var/cache/rhn
-files  /var/lib/vdsm
-dirs    /var/db
-dirs    /var/lib/rhsm
-EOF_RWTAB_RHEVH
-
-# convenience symlinks
-ln -s /usr/libexec/ovirt-config-rhn /sbin/rhn_register
-ln -s /usr/libexec/ovirt-config-setup /usr/sbin/setup
-
-# in RHEV-H *.py are blacklisted
-cat > /etc/cron.d/rhn-virtualization.cron << \EOF_cron-rhn
-0-59/2 * * * * root python /usr/share/rhn/virtualization/poller.pyc
-EOF_cron-rhn
-
-# minimal lsb_release for vdsm-reg (bz#549147)
-cat > /usr/bin/lsb_release <<\EOF_LSB
-#!/bin/sh
-if [ "$1" = "-r" ]; then
-    printf "Release:\t$(cat /etc/rhev-hypervisor-release | awk '{print $7}')\n"
-else
-    echo RedHatEnterpriseVirtualizationHypervisor
-fi
-EOF_LSB
-chmod +x /usr/bin/lsb_release
-
-# CPE name rhbz#593463
-cat > /etc/system-release-cpe <<\EOF_CPE
-cpe:/o:redhat:enterprise_linux:6:update2:hypervisor
-EOF_CPE
-
-patch -d /usr/share/rhn/up2date_client -p0 << \EOF_up2date_patch2
---- up2dateErrors.py.orig       2011-07-02 11:06:46.000000000 +0000
-+++ up2dateErrors.py    2011-07-02 11:09:19.000000000 +0000
-@@ -13,7 +13,20 @@
- _ = t.ugettext
- import OpenSSL
- import config
--from yum.Errors import RepoError
-+
-+class RepoError(Exception):
-+    """
-+    Base Yum Error. All other Errors thrown by yum should inherit from
-+    this.
-+    """
-+    def __init__(self, value=None):
-+        Exception.__init__(self)
-+        self.value = value
-+    def __str__(self):
-+        return "%s" %(self.value,)
-+
-+    def __unicode__(self):
-+        return '%s' % to_unicode(self.value)
- 
- class Error:
-     """base class for errors"""
-EOF_up2date_patch2
-python -m compileall /usr/share/rhn/up2date_client
-
-patch -d /usr/share/rhn/virtualization -p0 << \EOF_rhn_virt
---- poller.py.orig 2011-04-19 15:53:43.000000000 +0000
-+++ poller.py 2011-09-08 20:45:49.000000000 +0000
-@@ -73,10 +73,9 @@
-         return {}
-
-     try:
--        conn = libvirt.open(None)
-+        conn = libvirt.openReadOnly(None)
-     except libvirt.libvirtError, lve:
-         # virConnectOpen() failed
--        sys.stderr.write("Warning: Could not retrieve virtualization information!\n\tlibvirtd service needs to be running.\n")
-         conn = None
-
-     if not conn:
-@@ -286,10 +285,10 @@
-         vdsm_enabled = True
-
-     # Crawl each of the domains on this host and obtain the new state.
--    if vdsm_enabled:
--        domain_list = poll_through_vdsm()
--    elif libvirt:
-+    if libvirt:
-         domain_list = poll_hypervisor()
-+    elif vdsm_enabled:
-+        domain_list = poll_through_vdsm()
-     else:
-         # If no libvirt nor vdsm is present, this program is pretty much
-         # useless.  Just exit.
-EOF_rhn_virt
-python -m compileall /usr/share/rhn/virtualization
-
-echo "Configuring SELinux"
-# custom module for node specific rules
-mkdir /tmp/SELinux
-cd /tmp/SELinux
-cat > ovirt.te << \EOF_OVIRT_TE
-module ovirt 1.0;
-require {
-    type initrc_t;
-    type initrc_tmp_t;
-    type mount_t;
-    type setfiles_t;
-    type shadow_t;
-    type unconfined_t;
-    class file { append mounton open getattr read execute ioctl lock entrypoint };
-    class fd { use };
-    class process { sigchld signull transition noatsecure siginh rlimitinh getattr };
-    class fifo_file { getattr open read write append lock ioctl };
-    class filesystem getattr;
-    class dir { getattr search open read lock ioctl };
-    class socket { read write };
-    class tcp_socket { read write };
-    class udp_socket { read write };
-    class rawip_socket { read write };
-    class netlink_socket { read write };
-    class packet_socket { read write };
-    class unix_stream_socket { read write create ioctl getattr lock setattr append bind connect getopt setopt shutdown connectto };
-    class unix_dgram_socket { read write };
-    class appletalk_socket { read write };
-    class netlink_route_socket { read write };
-    class netlink_firewall_socket { read write };
-    class netlink_tcpdiag_socket { read write };
-    class netlink_nflog_socket { read write };
-    class netlink_xfrm_socket { read write };
-    class netlink_selinux_socket { read write };
-    class netlink_audit_socket { read write };
-    class netlink_ip6fw_socket { read write };
-    class netlink_dnrt_socket { read write };
-    class netlink_kobject_uevent_socket { read write };
-    class tun_socket { read write };
-    class chr_file { getattr read write append ioctl lock open };
-    class lnk_file { getattr read };
-    class sock_file { getattr write open append };
-}
-allow mount_t shadow_t:file mounton;
-allow setfiles_t initrc_tmp_t:file append;
-type ovirt_exec_t;
-init_daemon_domain(unconfined_t,ovirt_exec_t)
-EOF_OVIRT_TE
-cat > ovirt.fc << \EOF_OVIRT_FC
-/etc/rc\.d/init\.d/ovirt-firstboot             -- gen_context(system_u:object_r:ovirt_exec_t)
-/etc/rc\.d/init\.d/ovirt-post             -- gen_context(system_u:object_r:ovirt_exec_t)
-EOF_OVIRT_FC
-make NAME=targeted -f /usr/share/selinux/devel/Makefile
-semodule -v -i ovirt.pp
-cd /
-rm -rf /tmp/SELinux
-
-echo "Configuring IPTables"
-# here, we need to punch the appropriate holes in the firewall
-cat > /etc/sysconfig/iptables << \EOF
-# oVirt automatically generated firewall configuration
-*filter
-:INPUT ACCEPT [0:0]
-:FORWARD ACCEPT [0:0]
-:OUTPUT ACCEPT [0:0]
--A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
--A INPUT -p icmp -j ACCEPT
--A INPUT -i lo -j ACCEPT
-# vdsm
--A INPUT -p tcp --dport 54321 -j ACCEPT
-# libvirt tls
--A INPUT -p tcp --dport 16514 -j ACCEPT
-# SSH
--A INPUT -p tcp --dport 22 -j ACCEPT
-# guest consoles
--A INPUT -p tcp -m multiport --dports 5634:6166 -j ACCEPT
-# migration
--A INPUT -p tcp -m multiport --dports 49152:49216 -j ACCEPT
-# snmp
--A INPUT -p udp --dport 161 -j ACCEPT
-#
--A INPUT -j REJECT --reject-with icmp-host-prohibited
--A FORWARD -m physdev ! --physdev-is-bridged -j REJECT --reject-with icmp-host-prohibited
-COMMIT
-EOF
-# configure IPv6 firewall, default is all ACCEPT
-cat > /etc/sysconfig/ip6tables << \EOF
-# oVirt automatically generated firewall configuration
-*filter
-:INPUT ACCEPT [0:0]
-:FORWARD ACCEPT [0:0]
-:OUTPUT ACCEPT [0:0]
--A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
--A INPUT -p ipv6-icmp -j ACCEPT
--A INPUT -i lo -j ACCEPT
-# libvirt tls
--A INPUT -p tcp --dport 16514 -j ACCEPT
-# SSH
--A INPUT -p tcp --dport 22 -j ACCEPT
-# guest consoles
--A INPUT -p tcp -m multiport --dports 5634:6166 -j ACCEPT
-# migration
--A INPUT -p tcp -m multiport --dports 49152:49216 -j ACCEPT
-# snmp
--A INPUT -p udp --dport 161 -j ACCEPT
-# unblock ipv6 dhcp response
--A INPUT -p udp --dport 546 -j ACCEPT
--A INPUT -j REJECT --reject-with icmp6-adm-prohibited
--A FORWARD -m physdev ! --physdev-is-bridged -j REJECT --reject-with icmp6-adm-prohibited
-COMMIT
-EOF
-
-# remove errors from /sbin/dhclient-script
-DHSCRIPT=/sbin/dhclient-script
-sed -i 's/mv /cp -p /g'  $DHSCRIPT
-sed -i '/rm -f.*${interface}/d' $DHSCRIPT
-sed -i '/rm -f \/etc\/localtime/d' $DHSCRIPT
-sed -i '/rm -f \/etc\/ntp.conf/d' $DHSCRIPT
-sed -i '/rm -f \/etc\/yp.conf/d' $DHSCRIPT
-
-# prevent node from hanging on reboot due to /etc mounts
-patch -d /etc/init.d/ -p0 << \EOF_halt
---- halt.orig  2009-12-05 00:44:29.000000000 +0000
-+++ halt       2010-03-24 18:12:36.000000000 +0000
-@@ -138,7 +138,7 @@
-     $"Unmounting pipe file systems (retry): " \
-     -f
- 
--LANG=C __umount_loop '$2 ~ /^\/$|^\/proc|^\/dev/{next}
-+LANG=C __umount_loop '$2 ~ /^\/$|^\/proc|^\/etc|^\/dev/{next}
-       $3 == "tmpfs" || $3 == "proc" {print $2 ; next}
-       /(loopfs|autofs|nfs|cifs|smbfs|ncpfs|sysfs|^none|^\/dev\/ram|^\/dev\/root$)/ {next}
-       {print $2}' /proc/mounts \
-EOF_halt
-
-# rhbz#675868
-# Modify rc.sysinit
-patch -d /etc/rc.d -p0 << \EOF_rc_sysinit
---- rc.sysinit.orig    2011-04-06 09:11:18.126385229 -0400
-+++ rc.sysinit 2011-04-06 09:11:04.195923990 -0400
-@@ -43,7 +43,7 @@
- fi
- 
- if [ -n "$SELINUX_STATE" -a -x /sbin/restorecon ] && __fgrep " /dev " /proc/mounts >/dev/null 2>&1 ; then
--      /sbin/restorecon  -R /dev 2>/dev/null
-+      /sbin/restorecon -e /dev/.initramfs -R /dev 2>/dev/null
- fi
- 
- disable_selinux() {
-@@ -495,9 +495,9 @@
- # mounted). Contrary to standard usage,
- # filesystems are NOT unmounted in single user mode.
- if [ "$READONLY" != "yes" ] ; then
--      action $"Mounting local filesystems: " mount -a -t nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev
-+      action $"Mounting local filesystems: " mount -a -t nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2,noproc,nosysfs,nodevpts -O no_netdev
- else
--      action $"Mounting local filesystems: " mount -a -n -t nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev
-+      action $"Mounting local filesystems: " mount -a -n -t nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2,noproc,nosysfs,nodevpts -O no_netdev
- fi
-
- # Update quotas if necessary
-EOF_rc_sysinit
-
-# rhbz#675868
-# Modify start_udev
-patch -d /sbin -p0 << \EOF_start_udev
---- start_udev.orig    2011-03-30 12:32:03.000000000 +0000
-+++ start_udev 2011-09-02 17:16:57.954610422 +0000
-@@ -121,7 +121,7 @@
-       #/bin/chown root:root /dev/fuse
- 
-       if [ -x /sbin/restorecon ]; then
--              /sbin/restorecon -R /dev
-+              /sbin/restorecon -e /dev/.initramfs -R /dev
-       fi
- 
-       if [ -x "$MAKEDEV" ]; then
-EOF_start_udev
-
-# semanage is not present in the image and virt_use_nfs is on (see rhbz#642209)
-# remove it from vdsmd startup script to avoid error
-sed -i 's#/usr/sbin/semanage#/bin/true#' /etc/rc.d/init.d/vdsmd
-
-# libvirtd upstart job is already configured on rhevh
-sed -i 's/ && start_libvirtd$//' /etc/rc.d/init.d/vdsmd
-
-# chkconfig results (symlinks) cannnot be peristed
-sed -i 's#/sbin/chkconfig \$srv off##' /etc/rc.d/init.d/vdsmd
-
-# reserve vdsm port 54321
-augtool << \EOF_sysctl
-set /files/etc/sysctl.conf/net.ipv4.ip_local_reserved_ports 54321
-save
-EOF_sysctl
-
-# rhbz#734478 add virt-who (*.py are removed in rhevh image)
-cat > /usr/bin/virt-who <<EOF_virt_who
-#!/bin/sh
-exec /usr/bin/python /usr/share/virt-who/virt-who.pyc "$@"
-EOF_virt_who
-
-# set maxlogins to 3
-echo "*        -       maxlogins      3" >> /etc/security/limits.conf
-
-# rhbz#738170
-patch -d /sbin -p0 << \EOF_mkdumprd
---- /sbin/mkdumprd.orig        2011-10-06 06:37:49.000000000 +0000
-+++ /sbin/mkdumprd     2011-11-01 04:21:19.000000000 +0000
-@@ -583,7 +583,7 @@
-         eth*.*)
-             modalias=8021q
-             ;;
--        br*)
-+        rhevm|br*)
-             modalias=bridge
-             ;;
-         *)
-@@ -756,7 +756,7 @@
-             echo >> $MNTIMAGE/etc/ifcfg-$dev
-             echo "BUS_ID=\"Bonding\"" >> $MNTIMAGE/etc/ifcfg-$dev
-             ;;
--      br*)
-+      rhevm|br*)
-             for j in `ls /sys/class/net/$dev/brif`
-             do
-                 handlenetdev $j
-
-EOF_mkdumprd
 
+++ /dev/null
-# Copyright (C) 2010 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-EXTRA_DIST = \
-  node-config \
-  ovirt-awake \
-  ovirt-early \
-  ovirt \
-  ovirt-post \
-  ovirt-firstboot \
-  local_boot_trigger.sh \
-  augeas.py \
-  __init__.py \
-  ovirtfunctions.py \
-  install.py \
-  storage.py \
-  iscsi.py \
-  network.py \
-  password.py \
-  collectd.py \
-  log.py \
-  kdump.py \
-  rhn.py \
-  snmp.py \
-  ovirt-config-installer.py \
-  ovirt-config-setup.py \
-  ovirt-auto-install.py \
-  ovirt-admin-shell
-
-dist_sbin_SCRIPTS = \
-  persist \
-  unpersist
-
-dist_libexec_SCRIPTS = \
-  ovirt-config-boot \
-  ovirt-config-hostname \
-  ovirt-config-iscsi \
-  ovirt-config-kdump \
-  ovirt-config-logging \
-  ovirt-config-networking \
-  ovirt-config-rhn \
-  ovirt-config-snmp \
-  ovirt-config-password \
-  ovirt-config-storage \
-  ovirt-config-uninstall \
-  ovirt-config-view-logs \
-  ovirt-functions \
-  ovirt-boot-functions \
-  ovirt-process-config \
-  ovirt-rpmquery
 
+++ /dev/null
-"""Pure python bindings for the augeas library
-
-Augeas is a library for programmatically editing configuration files.
-Augeas parses configuration files into a tree structure, which it exposes
-through its public API. Changes made through the API are written back to
-the initially read files.
-
-The transformation works very hard to preserve comments and formatting
-details. It is controlled by ``lens'' definitions that describe the file
-format and the transformation into a tree.
-
-"""
-
-#
-# Copyright (C) 2008 Nathaniel McCallum
-# Copyright (C) 2008 Jeff Schroeder <
[email protected]>
-# Copyright (C) 2009 Red Hat, Inc.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
-#
-# Author: Nathaniel McCallum <
[email protected]>
-
-__author__ = "Nathaniel McCallum <
[email protected]>"
-__credits__ = """Jeff Schroeder <
[email protected]>
-Harald Hoyer <
[email protected]> - initial python bindings, packaging
-Nils Philippsen <
[email protected]>
-"""
-
-import ctypes
-import ctypes.util
-from sys import version_info as _pyver
-
-def _dlopen(*args):
-    """Search for one of the libraries given as arguments and load it.
-    Returns the library.
-    """
-    libs = [l for l in [ ctypes.util.find_library(a) for a in args ] if l]
-    lib  = reduce(lambda x, y: x or ctypes.cdll.LoadLibrary(y), libs, None)
-    if not lib:
-        raise ImportError("Unable to import lib%s!" % args[0])
-    return lib
-
-class Augeas(object):
-    "Class wrapper for the augeas library"
-
-    # Load libpython (for 'PyFile_AsFile()' and 'PyMem_Free()')
-    # pylint: disable-msg=W0142
-    _libpython = _dlopen(*["python" + _v % _pyver[:2]
-                           for _v in ("%d.%d", "%d%d")])
-    _libpython.PyFile_AsFile.restype = ctypes.c_void_p
-
-    # Load libaugeas
-    _libaugeas = _dlopen("augeas")
-    _libaugeas.aug_init.restype = ctypes.c_void_p
-
-    # Augeas Flags
-    NONE = 0
-    SAVE_BACKUP = 1 << 0
-    SAVE_NEWFILE = 1 << 1
-    TYPE_CHECK = 1 << 2
-    NO_STDINC = 1 << 3
-    SAVE_NOOP = 1 << 4
-    NO_LOAD = 1 << 5
-    NO_MODL_AUTOLOAD = 1 << 6
-
-    def __init__(self, root=None, loadpath=None, flags=NONE):
-        """Initialize the library.
-
-        Use 'root' as the filesystem root. If 'root' is None, use the value of
-        the environment variable AUGEAS_ROOT. If that doesn't exist either,
-        use "/".
-
-        'loadpath' is a colon-spearated list of directories that modules
-        should be searched in. This is in addition to the standard load path
-        and the directories in AUGEAS_LENS_LIB.
-
-        'flags' is a bitmask made up of values from AUG_FLAGS."""
-
-        # Sanity checks
-        if not isinstance(root, basestring) and root != None:
-            raise TypeError("root MUST be a string or None!")
-        if not isinstance(loadpath, basestring) and loadpath != None:
-            raise TypeError("loadpath MUST be a string or None!")
-        if not isinstance(flags, int):
-            raise TypeError("flag MUST be a flag!")
-
-        # Create the Augeas object
-        self.__handle = Augeas._libaugeas.aug_init(root, loadpath, flags)
-        if not self.__handle:
-            raise RuntimeError("Unable to create Augeas object!")
-
-    def __del__(self):
-        self.close()
-
-    def get(self, path):
-        """Lookup the value associated with 'path'.
-        Returns the value at the path specified.
-        It is an error if more than one node matches 'path'."""
-
-        # Sanity checks
-        if not isinstance(path, basestring):
-            raise TypeError("path MUST be a string!")
-        if not self.__handle:
-            raise RuntimeError("The Augeas object has already been closed!")
-
-        # Create the char * value
-        value = ctypes.c_char_p()
-
-        # Call the function and pass value by reference (char **)
-        ret = Augeas._libaugeas.aug_get(self.__handle, path,
-                                        ctypes.byref(value))
-        if ret > 1:
-            raise ValueError("path specified had too many matches!")
-
-        return value.value
-
-    def set(self, path, value):
-        """Set the value associated with 'path' to 'value'.
-        Intermediate entries are created if they don't exist.
-        It is an error if more than one node matches 'path'."""
-
-        # Sanity checks
-        if not isinstance(path, basestring):
-            raise TypeError("path MUST be a string!")
-        if not isinstance(value, basestring):
-            raise TypeError("value MUST be a string!")
-        if not self.__handle:
-            raise RuntimeError("The Augeas object has already been closed!")
-
-        # Call the function
-        ret = Augeas._libaugeas.aug_set(self.__handle, path, value)
-        if ret != 0:
-            raise ValueError("Unable to set value to path!")
-
-    def setm(self, base, sub, value):
-        """Set the value of multiple nodes in one operation.
-        Find or create a node matching 'sub' by interpreting 'sub'
-        as a path expression relative to each node matching 'base'.
-        'sub' may be None, in which case all the nodes matching
-        'base' will be modified."""
-
-        # Sanity checks
-        if type(base) != str:
-            raise TypeError, "base MUST be a string!"
-        if type(sub) != str and sub != None:
-            raise TypeError, "sub MUST be a string or None!"
-        if type(value) != str:
-            raise TypeError, "value MUST be a string!"
-        if not self.__handle:
-            raise RuntimeError, "The Augeas object has already been closed!"
-
-        # Call the function
-        ret = Augeas._libaugeas.aug_setm(self.__handle, base, sub, value)
-        if ret < 0:
-            raise ValueError, "Unable to set value to path!"
-        return ret
-
-    def defvar(self, name, expr):
-        """Define a variable 'name' whose value is the result of
-        evaluating 'expr'. If a variable 'name' already exists, its
-        name will be replaced with the result of evaluating 'expr'.
- 
-        If 'expr' is None, the variable 'name' will be removed if it
-        is defined.
- 
-        Path variables can be used in path expressions later on by
-        prefixing them with '$'."""
-
-        # Sanity checks
-        if type(name) != str:
-            raise TypeError, "name MUST be a string!"
-        if type(expr) != str and expr != None:
-            raise TypeError, "expr MUST be a string or None!"
-        if not self.__handle:
-            raise RuntimeError, "The Augeas object has already been closed!"
-
-        # Call the function
-        ret = Augeas._libaugeas.aug_defvar(self.__handle, name, expr)
-        if ret < 0:
-            raise ValueError, "Unable to register variable!"
-        return ret
-
-    def defnode(self, name, expr, value):
-        """Define a variable 'name' whose value is the result of
-        evaluating 'expr', which must not be None and evaluate to a
-        nodeset. If a variable 'name' already exists, its name will
-        be replaced with the result of evaluating 'expr'.
- 
-        If 'expr' evaluates to an empty nodeset, a node is created,
-        equivalent to calling set(expr, value) and 'name' will be the
-        nodeset containing that single node."""
-
-        # Sanity checks
-        if type(name) != str:
-            raise TypeError, "name MUST be a string!"
-        if type(expr) != str:
-            raise TypeError, "expr MUST be a string!"
-        if type(value) != str:
-            raise TypeError, "value MUST be a string!"
-        if not self.__handle:
-            raise RuntimeError, "The Augeas object has already been closed!"
-
-        # Call the function
-        ret = Augeas._libaugeas.aug_defnode(self.__handle, name, expr, value, None)
-        if ret < 0:
-            raise ValueError, "Unable to register node!"
-        return ret
-
-    def move(self, src, dst):
-        """Move the node 'src' to 'dst'. 'src' must match exactly one node
-           in the tree. 'dst' must either match exactly one node in the
-           tree, or may not exist yet. If 'dst' exists already, it and all
-           its descendants are deleted before moving 'src' there. If 'dst'
-           does not exist yet, it and all its missing ancestors are created."""
-
-        # Sanity checks
-        if not isinstance(src, basestring):
-            raise TypeError("src MUST be a string!")
-        if not isinstance(dst, basestring):
-            raise TypeError("dst MUST be a string!")
-        if not self.__handle:
-            raise RuntimeError("The Augeas object has already been closed!")
-
-        # Call the function
-        ret = Augeas._libaugeas.aug_mv(self.__handle, src, dst)
-        if ret != 0:
-            raise ValueError("Unable to move src to dst!")
-
-    def insert(self, path, label, before=True):
-        """Create a new sibling 'label' for 'path' by inserting into the tree
-        just before 'path' (if 'before' is True) or just after 'path'
-        (if 'before' is False).
-
-        'path' must match exactly one existing node in the tree, and 'label'
-        must be a label, i.e. not contain a '/', '*' or end with a bracketed
-        index '[N]'."""
-
-        # Sanity checks
-        if not isinstance(path, basestring):
-            raise TypeError("path MUST be a string!")
-        if not isinstance(label, basestring):
-            raise TypeError("label MUST be a string!")
-        if not self.__handle:
-            raise RuntimeError("The Augeas object has already been closed!")
-
-        # Call the function
-        ret = Augeas._libaugeas.aug_insert(self.__handle, path,
-                                           label, before and 1 or 0)
-        if ret != 0:
-            raise ValueError("Unable to insert label!")
-
-    def remove(self, path):
-        """Remove 'path' and all its children. Returns the number of entries
-        removed. All nodes that match 'path', and their descendants, are
-        removed."""
-
-        # Sanity checks
-        if not isinstance(path, basestring):
-            raise TypeError("path MUST be a string!")
-        if not self.__handle:
-            raise RuntimeError("The Augeas object has already been closed!")
-
-        # Call the function
-        return Augeas._libaugeas.aug_rm(self.__handle, path)
-
-    def match(self, path):
-        """Return the matches of the path expression 'path'. The returned paths
-        are sufficiently qualified to make sure that they match exactly one
-        node in the current tree.
-
-        Path expressions use a very simple subset of XPath: the path 'path'
-        consists of a number of segments, separated by '/'; each segment can
-        either be a '*', matching any tree node, or a string, optionally
-        followed by an index in brackets, matching tree nodes labelled with
-        exactly that string. If no index is specified, the expression matches
-        all nodes with that label; the index can be a positive number N, which
-        matches exactly the Nth node with that label (counting from 1), or the
-        special expression 'last()' which matches the last node with the given
-        label. All matches are done in fixed positions in the tree, and nothing
-        matches more than one path segment."""
-
-        # Sanity checks
-        if not isinstance(path, basestring):
-            raise TypeError("path MUST be a string!")
-        if not self.__handle:
-            raise RuntimeError("The Augeas object has already been closed!")
-
-        # Create a void ** (this is so python won't mangle the char **,
-        # when we free it)
-        array = ctypes.POINTER(ctypes.c_void_p)()
-
-        # Call the function and pass the void ** by reference (void ***)
-        ret = Augeas._libaugeas.aug_match(self.__handle, path,
-                                          ctypes.byref(array))
-        if ret < 0:
-            raise RuntimeError("Error during match procedure!")
-
-        # Loop through the string array
-        matches = []
-        for i in range(ret):
-            if array[i]:
-                # Create a python string and append it to our matches list
-                matches.append(str(ctypes.cast(array[i],
-                                               ctypes.c_char_p).value))
-
-                # Free the string at this point in the array
-                Augeas._libpython.PyMem_Free(array[i])
-
-        # Free the array itself
-        Augeas._libpython.PyMem_Free(array)
-
-        return matches
-
-    def save(self):
-        """Write all pending changes to disk. Only files that had any changes
-        made to them are written.
-
-        If SAVE_NEWFILE is set in the creation 'flags', create changed files as
-        new files with the extension ".augnew", and leave the original file
-        unmodified.
-
-        Otherwise, if SAVE_BACKUP is set in the creation 'flags', move the
-        original file to a new file with extension ".augsave".
-
-        If neither of these flags is set, overwrite the original file."""
-
-        # Sanity checks
-        if not self.__handle:
-            raise RuntimeError("The Augeas object has already been closed!")
-
-        # Call the function
-        ret = Augeas._libaugeas.aug_save(self.__handle)
-        if ret != 0:
-            raise IOError("Unable to save to file!")
-
-    def load(self):
-        """Load files into the tree. Which files to load and what lenses to use
-        on them is specified under /augeas/load in the tree; each entry
-        /augeas/load/NAME specifies a 'transform', by having itself exactly one
-        child 'lens' and any number of children labelled 'incl' and 'excl'. The
-        value of NAME has no meaning.
-
-        The 'lens' grandchild of /augeas/load specifies which lens to use, and
-        can either be the fully qualified name of a lens 'Module.lens' or
-        '@Module'. The latter form means that the lens from the transform
-        marked for autoloading in MODULE should be used.
-
-        The 'incl' and 'excl' grandchildren of /augeas/load indicate which
-        files to transform. Their value are used as glob patterns. Any file
-        that matches at least one 'incl' pattern and no 'excl' pattern is
-        transformed. The order of 'incl' and 'excl' entries is irrelevant.
-
-        When AUG_INIT is first called, it populates /augeas/load with the
-        transforms marked for autoloading in all the modules it finds.
-
-        Before loading any files, AUG_LOAD will remove everything underneath
-        /augeas/files and /files, regardless of whether any entries have been
-        modified or not."""
-
-        # Sanity checks
-        if not self.__handle:
-            raise RuntimeError("The Augeas object has already been closed!")
-
-        ret = Augeas._libaugeas.aug_load(self.__handle)
-        if ret != 0:
-            raise RuntimeError("aug_load() failed!")
-
-    def clear_transforms(self):
-        """Clear all transforms beneath /augeas/load. If load() is called right
-        after this, there will be no files beneath /files."""
-        self.remove("/augeas/load/*")
-
-    def add_transform(self, lens, incl, name=None, excl=()):
-        """Add a transform beneath /augeas/load.
-
-        lens: the (file)name of the lens to use
-        incl: one or more glob patterns for the files to transform
-        name: a unique name; use the module name of the lens if omitted
-        excl: zero or more glob patterns of files to exclude from transforming
-        """
-
-        if not name:
-            name = lens.split(".")[0].replace("@", "", 1)
-        if isinstance (incl, basestring):
-            incl = [incl]
-        if isinstance (excl, basestring):
-            excl = [excl]
-
-        xfm = "/augeas/load/%s/" % name
-        self.set (xfm + "lens", lens)
-        for i in range(len(incl)):
-            self.set(xfm + "incl[%d]" % (i+1), incl[i])
-        for i in range(len(excl)):
-            self.set(xfm + "excl[%d]" % (i+1), excl[i])
-
-    def close(self):
-        """Close this Augeas instance and free any storage associated with it.
-        After this call, this Augeas instance is invalid and can not be used
-        for any more operations."""
-
-        # If we are already closed, return
-        if not self.__handle:
-            return
-
-        # Call the function
-        Augeas._libaugeas.aug_close(self.__handle)
-
-        # Mark the object as closed
-        self.__handle = None
-
-# for backwards compatibility
-# pylint: disable-msg=C0103
-class augeas(Augeas):
-    "Compat class, obsolete. Use class Augeas directly."
-
-    def __init__(self, *p, **k):
-        import warnings
-        warnings.warn("use Augeas instead of augeas", DeprecationWarning,
-                stacklevel=2)
-        super(augeas, self).__init__(*p, **k)
 
+++ /dev/null
-LoadPlugin logfile
-LoadPlugin network
-LoadPlugin libvirt
-LoadPlugin memory
-LoadPlugin cpu
-LoadPlugin load
-LoadPlugin interface
-LoadPlugin disk
-
-<Plugin libvirt>
-        Connection "qemu:///system"
-        RefreshInterval "10"
-        HostnameFormat "uuid"
-</Plugin>
-
-<Plugin network>
-        Server "@COLLECTD_SERVER@" @COLLECTD_PORT@
-</Plugin>
-
-<Plugin interface>
-        Interface "eth0"
-        IgnoreSelected false
-</Plugin>
 
+++ /dev/null
-#!/usr/bin/python
-#
-# Configures the collectd daemon.
-
-import os
-import sys
-from ovirtnode.ovirtfunctions import *
-from subprocess import Popen, PIPE, STDOUT
-from snack import *
-import _snack
-
-collectd_conf="/etc/collectd.conf"
-
-def write_collectd_config(server, port):
-    if os.path.exists(collectd_conf + ".in"):
-        sed_cmd = "sed -e \"s/@COLLECTD_SERVER@/%s/\" \
-            -e \"s/@COLLECTD_PORT@/%s/\" %s.in \
-            > %s" % (server, port, collectd_conf, collectd_conf)
-        sed = subprocess.Popen(sed_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-    os.system("chkconfig collectd on &> /dev/null")
-    os.system("service collectd restart &> /dev/null")
-    return True
-
-def get_collectd_config():
-    collectd_config = open(collectd_conf)
-    try:
-        for line in collectd_config:
-            if "Server" in line:
-              start, config = line.split("Server ", 2)
-              server, port = config.split()
-              server = server.strip('"')
-              return (server,port)
-    except:
-        return
-    finally:
-        collectd_config.close()
-
-# AUTO for auto-install
-def collectd_auto():
-    host = ""
-    port = ""
-    if not OVIRT_VARS.has_key("OVIRT_COLLECTD_SERVER") or not OVIRT_VARS.has_key("OVIRT_COLLECTD_PORT"):
-        logger.info("Attempting to locate remote collectd server...")
-        try:
-            host, port = find_srv("collectd", "udp")
-        except:
-            pass
-        if not host is "" and not port is "":
-            logger.info("collectd server found! Using collectd server " + host + ":" + port)
-            write_collectd_config(host, port)
-            return True
-        else:
-            logger.error("collectd server not found!")
-            return False
-    else:
-        logger.info("Using default collectd server: " + OVIRT_VARS["OVIRT_COLLECTD_SERVER"]+ " : " + OVIRT_VARS["OVIRT_COLLECTD_PORT"])
-        write_collectd_config(OVIRT_VARS["OVIRT_COLLECTD_SERVER"], OVIRT_VARS["OVIRT_COLLECTD_PORT"])
-        return True
-
-#
-# configuration UI plugin interface
-#
-class Plugin(PluginBase):
-    """Plugin for Monitoring(collectd) configuration option.
-    """
-
-    def __init__(self, ncs):
-        PluginBase.__init__(self, "Monitoring(collectd)", ncs)
-
-    def form(self):
-        elements = Grid(2, 10)
-        elements.setField(Label("Monitoring(collectd) Configuration"), 0, 0, anchorLeft = 1)
-        elements.setField(Label(""), 0, 1, anchorLeft = 1)
-        elements.setField(Label("Collectd"), 0, 2, anchorLeft = 1)
-        elements.setField(Textbox(45,3,"Collectd gathers statistics about the system that\ncan be used to find performance bottlenecks\nand predict future system load."), 0, 3, anchorLeft = 1)
-        collectd_grid = Grid(2,2)
-        collectd_grid.setField(Label("Server Address:"), 0, 0, anchorLeft = 1)
-        self.collectd_server = Entry(20, "")
-        self.collectd_server.setCallback(self.valid_collectd_server_callback)
-        collectd_grid.setField(self.collectd_server, 1, 0, anchorLeft = 1, padding=(2, 0, 0, 1))
-        self.collectd_port = Entry(5, "")
-        self.collectd_port.setCallback(self.valid_collectd_port_callback)
-        collectd_grid.setField(Label("Server Port:"), 0, 1, anchorLeft = 1)
-        collectd_grid.setField(self.collectd_port, 1, 1, anchorLeft = 1, padding=(2, 0, 0, 1))
-        elements.setField(collectd_grid, 0, 4, anchorLeft = 1, padding = (0,1,0,0))
-        collectd_config = get_collectd_config()
-        if not collectd_config is None:
-            collectd_server, collectd_port = get_collectd_config()
-            self.collectd_server.set(collectd_server)
-            self.collectd_port.set(collectd_port)
-        else:
-            self.collectd_port.set("7634")
-        return [Label(""), elements]
-
-    def action(self):
-        self.ncs.screen.setColor("BUTTON", "black", "red")
-        self.ncs.screen.setColor("ACTBUTTON", "blue", "white")
-        if len(self.collectd_server.value()) > 0  and len(self.collectd_port.value()) > 0 :
-            if write_collectd_config(self.collectd_server.value(), self.collectd_port.value()):
-                ButtonChoiceWindow(self.ncs.screen, "Collectd Configuration", "Collectd Configuration Successfully Changed", buttons = ['Ok'])
-                self.ncs.reset_screen_colors()
-                return True
-            else:
-                ButtonChoiceWindow(self.ncs.screen, "Collectd Configuration", "Collectd Configuration Failed", buttons = ['Ok'])
-                self.ncs.reset_screen_colors()
-                return False
-
-    def valid_collectd_server_callback(self):
-        if not is_valid_host_or_ip(self.collectd_server.value()):
-            self.ncs.screen.setColor("BUTTON", "black", "red")
-            self.ncs.screen.setColor("ACTBUTTON", "blue", "white")
-            ButtonChoiceWindow(self.ncs.screen, "Configuration Check", "Invalid Hostname or Address", buttons = ['Ok'])
-            self.ncs.reset_screen_colors()
-
-    def valid_collectd_port_callback(self):
-        if not is_valid_port(self.collectd_port.value()):
-            self.ncs.screen.setColor("BUTTON", "black", "red")
-            self.ncs.screen.setColor("ACTBUTTON", "blue", "white")
-            ButtonChoiceWindow(self.ncs.screen, "Configuration Check", "Invalid Port Number", buttons = ['Ok'])
-            self.ncs.reset_screen_colors()
-
-def get_plugin(ncs):
-    return Plugin(ncs)
 
+++ /dev/null
-#!/usr/bin/python
-# install.py - Copyright (C) 2010 Red Hat, Inc.
-# Written by Joey Boggs <
[email protected]>
-#
-# This program is free softwaee; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-from ovirtnode.ovirtfunctions import *
-from ovirtnode.iscsi import *
-import shutil
-import traceback
-import os
-import stat
-import subprocess
-import re
-OVIRT_VARS = parse_defaults()
-
-class Install:
-
-
-    def __init__(self):
-        self.disk = None
-        self.partN = -1
-
-    def kernel_image_copy(self):
-        if not system("cp -p /live/" + self.syslinux + "/vmlinuz0 " + self.initrd_dest):
-            logger.error("kernel image copy failed.")
-            return False
-        if not system("cp -p /live/" + self.syslinux + "/initrd0.img " + self.initrd_dest):
-            logger.error("initrd image copy failed.")
-            return False
-        if not system("cp -p /live/" + self.syslinux + "/version /liveos"):
-            logger.error("version details copy failed.")
-            return False
-        if not OVIRT_VARS.has_key("OVIRT_ISCSI_ENABLED"):
-            if not system("cp -p /live/LiveOS/squashfs.img /liveos/LiveOS"):
-                logger.error("squashfs image copy failed.")
-                return False
-        return True
-
-    def generate_paths(self):
-        mount_live()
-        # install oVirt Node image for local boot
-        if os.path.exists("/live/syslinux"):
-            self.syslinux = "syslinux"
-        elif os.path.exists("/live/isolinux"):
-            self.syslinux = "isolinux"
-        else:
-            logger.info("Failed to determine grub pathnames")
-            return False
-
-        if OVIRT_VARS.has_key("OVIRT_ISCSI_ENABLED") and OVIRT_VARS["OVIRT_ISCSI_ENABLED"] == "y":
-            self.initrd_dest = "/boot"
-            self.grub_dir = "/boot/grub"
-            self.grub_prefix = "/grub"
-        else:
-            self.initrd_dest = "/liveos"
-            self.grub_dir = "/liveos/grub"
-            self.grub_prefix = "/grub"
-
-        if os.path.exists("/sbin/grub2-install"):
-            self.grub_prefix = self.grub_prefix + "2"
-            self.grub_dir = self.grub_dir + "2"
-            self.grub_config_file = "%s/grub.cfg" % self.grub_dir
-        else:
-            self.grub_config_file = "%s/grub.conf" % self.grub_dir
-
-    def grub_install(self):
-        device_map = "(hd0) %s" % self.disk
-        logger.debug(device_map)
-        device_map_conf = open(self.grub_dir + "/device.map", "w")
-        device_map_conf.write(device_map)
-        device_map_conf.close()
-
-        GRUB_CONFIG_TEMPLATE = """
-default saved
-timeout 5
-hiddenmenu
-title %(product)s %(version)s-%(release)s
-    root (hd0,%(partN)d)
-    kernel /vmlinuz0 %(root_param)s %(bootparams)s
-    initrd /initrd0.img
-    """
-        GRUB_BACKUP_TEMPLATE = """
-title BACKUP %(oldtitle)s
-    root (hd0,%(partB)d)
-    kernel /vmlinuz0 root=live:LABEL=RootBackup %(bootparams)s
-    initrd /initrd0.img
-    """
-        GRUB_SETUP_TEMPLATE = """
-    grub --device-map=%(grub_dir)s/device.map <<EOF
-root (hd0,%(partN)d)
-setup --prefix=%(grub_prefix)s (hd0)
-EOF
-"""
-
-        grub_conf = open(self.grub_config_file, "w")
-        grub_conf.write(GRUB_CONFIG_TEMPLATE % self.grub_dict)
-        if self.oldtitle is not None:
-            partB=1
-            if partN == 1:
-                partB=2
-            self.grub_dict['oldtitle']=self.oldtitle
-            self.grub_dict['partB']=partB
-            grub_conf.write(GRUB_BACKUP_TEMPLATE % self.grub_dict)
-        grub_conf.close()
-        for f in ["stage1", "stage2", "e2fs_stage1_5"]:
-            system("cp /usr/share/grub/x86_64-redhat/%s %s" % (f, self.grub_dir))
-        grub_setup_out = GRUB_SETUP_TEMPLATE % self.grub_dict
-        logger.debug(grub_setup_out)
-        grub_setup = subprocess.Popen(grub_setup_out, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-        grub_results = grub_setup.stdout.read()
-        logger.debug(grub_results)
-        if grub_setup.wait() != 0 or "Error" in grub_results:
-            logger.error("GRUB setup failed")
-            return False
-        return True
-
-    def grub2_install(self):
-        GRUB2_CONFIG_TEMPLATE = """
-#default saved
-set timeout=5
-#hiddenmenu
-menuentry "%(product)s %(version)s-%(release)s" {
-set root=(hd0,%(partN)d)
-linux /vmlinuz0 %(root_param)s %(bootparams)s
-initrd /initrd0.img
-}"""
-
-        GRUB2_BACKUP_TEMPLATE = """
-menuentry "BACKUP %(oldtitle)s" {
-set root (hd0,%(partB)d)
-linux /vmlinuz0 root=live:LABEL=RootBackup %(bootparams)s
-initrd /initrd0.img
-    """
-
-        grub_setup_cmd = "/sbin/grub2-install " + self.disk + " --boot-directory=" + self.initrd_dest + " --force"
-        logger.debug(grub_setup_cmd)
-        grub_setup = subprocess.Popen(grub_setup_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-        grub_results = grub_setup.stdout.read()
-        logger.debug(grub_results)
-        if grub_setup.wait() != 0 or "Error" in grub_results:
-            logger.error("GRUB setup failed")
-            return False
-        else:
-            logger.debug("Generating Grub2 Templates")
-            grub_conf = open(self.grub_config_file, "w")
-            grub_conf.write(GRUB2_CONFIG_TEMPLATE % self.grub_dict)
-            if self.oldtitle is not None:
-                partB=0
-                if partN == 0:
-                    partB=1
-                self.grub_dict['oldtitle']=self.oldtitle
-                self.grub_dict['partB']=partB
-                grub_conf.write(GRUB2_BACKUP_TEMPLATE % self.grub_dict)
-            grub_conf.close()
-            logger.info("Grub2 Install Completed")
-            return True
-
-    def ovirt_boot_setup(self):
-        self.generate_paths()
-
-        logger.info("Installing the image.")
-
-        if OVIRT_VARS.has_key("OVIRT_ROOT_INSTALL"):
-            if OVIRT_VARS["OVIRT_ROOT_INSTALL"] == "n":
-                logger.info("Root Installation Not Required, Finished.")
-                return True
-
-        self.oldtitle=None
-        if os.path.ismount("/liveos"):
-            if os.path.exists("/liveos/vmlinuz0") and os.path.exists("/liveos/initrd0.img"):
-                f=open(self.grub_config_file)
-                oldgrub=f.read()
-                f.close()
-                m=re.search("^title (.*)$", oldgrub, re.MULTILINE)
-                if m is not None:
-                    self.oldtitle=m.group(1)
-
-            system("umount /liveos")
-
-        if findfs("Boot"):
-            candidate = "Boot"
-            mount_boot()
-            if not os.path.ismount("/boot"):
-                logger.error("Boot partition not available, Install Failed")
-                return False
-            # Grab OVIRT_ISCSI VARIABLES from boot partition for upgrading
-            # file created only if OVIRT_ISCSI_ENABLED=y
-            if os.path.exists("/boot/ovirt"):
-                try:
-                    f = open("/boot/ovirt", 'r')
-                    for line in f:
-                        try:
-                            line = line.strip()
-                            key, value = line.split("\"", 1)
-                            key = key.strip("=")
-                            key = key.strip()
-                            value = value.strip("\"")
-                            OVIRT_VARS[key] = value
-                        except:
-                            pass
-                    f.close()
-                    iscsiadm_cmd = "iscsiadm -p %s:%s -m discovery -t sendtargets" % (OVIRT_VARS["OVIRT_ISCSI_TARGET_IP"], OVIRT_VARS["OVIRT_ISCSI_TARGET_PORT"])
-                    system(iscsiadm_cmd)
-                    logger.info("Restarting iscsi service")
-                    system("service iscsi restart")
-                except:
-                    pass
-        elif findfs("RootBackup"):
-            candidate = "RootBackup"
-        elif findfs("RootUpdate"):
-            candidate = "RootUpdate"
-        elif findfs("RootNew"):
-            candidate = "RootNew"
-        else:
-            logger.error("Unable to find Root partition")
-            label_debug = ''
-            for label in os.listdir("/dev/disk/by-label"):
-                label_debug += "%s\n" % label
-            label_debug += subprocess.Popen("blkid", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.read()
-            logger.debug(label_debug)
-            return False
-        logger.debug("candidate: " + candidate)
-
-        try:
-            candidate_dev = self.disk = findfs(candidate)
-            logger.info(candidate_dev)
-            logger.info(self.disk)
-            # grub2 starts at part 1
-            self.partN = int(self.disk[-1:])
-            if not os.path.exists("/sbin/grub2-install"):
-                self.partN = self.partN - 1
-            logger.debug("partN: %d" % self.partN)
-        except:
-            logger.debug(traceback.format_exc())
-            return False
-
-        if self.disk is None or self.partN < 0:
-            logger.error("Failed to determine Root partition number")
-            return False
-        if not OVIRT_VARS.has_key("OVIRT_ISCSI_ENABLED"):
-            # prepare Root partition update
-            if candidate != "RootNew":
-                e2label_cmd = "e2label \"%s\" RootNew" % candidate_dev
-                logger.debug(e2label_cmd)
-                if not system(e2label_cmd):
-                    logger.error("Failed to label new Root partition")
-                    return False
-            mount_cmd = "mount \"%s\" /liveos" % candidate_dev
-            system(mount_cmd)
-            system("rm -rf /liveos/LiveOS")
-            system("mkdir -p /liveos/LiveOS")
-            mount_live()
-
-        if os.path.isdir(self.grub_dir):
-            shutil.rmtree(self.grub_dir)
-        if not os.path.exists(self.grub_dir):
-            os.makedirs(self.grub_dir)
-            os.makedirs(self.grub_dir + "/efi")
-            system("mount LABEL=EFI "+self.grub_dir+"/efi")
-            system("cp -ra /boot/efi/* " + self.grub_dir + "/efi")
-            system("umount /liveos/grub/efi")
-
-        self.kernel_image_copy()
-
-        # reorder tty0 to allow both serial and phys console after installation
-        if OVIRT_VARS.has_key("OVIRT_ISCSI_ENABLED") and OVIRT_VARS["OVIRT_ISCSI_ENABLED"] == "y":
-            self.root_param="root=LABEL=ovirt-node-root"
-            self.bootparams="ro rootfstype=ext2 rootflags=ro console=tty0 \
-                        netroot=iscsi:$OVIRT_ISCSI_TARGET_IP::$OVIRT_ISCSI_TARGET_PORT::$OVIRT_ISCSI_NODE_NAME ip=eth0:dhcp"
-        else:
-            self.root_param="root=live:LABEL=Root"
-            self.bootparams="ro rootfstype=auto rootflags=ro "
-        self.bootparams += OVIRT_VARS["OVIRT_BOOTPARAMS"].replace("console=tty0","")
-
-        if " " in self.disk or os.path.exists("/dev/cciss"):
-            # workaround for grub setup failing with spaces in dev.name:
-            # use first active sd* device
-            self.disk = re.sub("p[1,2,3]$", "", self.disk)
-            grub_disk_cmd= "multipath -l \"" + os.path.basename(self.disk) + "\" | awk '/ active / {print $3}' | head -n1"
-            logger.debug(grub_disk_cmd)
-            grub_disk = subprocess.Popen(grub_disk_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-            self.disk = grub_disk.stdout.read().strip()
-            if "cciss" in self.disk:
-                self.disk = self.disk.replace("!","/")
-            # flush to sync DM and blockdev, workaround from rhbz#623846#c14
-            sysfs=open("/proc/sys/vm/drop_caches","w")
-            sysfs.write("3")
-            sysfs.close()
-            partprobe_cmd="partprobe \"/dev/%s\"" % self.disk
-            logger.debug(partprobe_cmd)
-            system(partprobe_cmd)
-
-        if not self.disk.startswith("/dev/"):
-            self.disk = "/dev/" + disk
-        try:
-            if stat.S_ISBLK(os.stat(self.disk).st_mode):
-                try:
-                    if stat.S_ISBLK(os.stat(self.disk[:-1]).st_mode):
-                        # e.g. /dev/sda2
-                        self.disk = self.disk[:-1]
-                except OSError:
-                    pass
-                try:
-                    if stat.S_ISBLK(os.stat(self.disk[:-2]).st_mode):
-                        # e.g. /dev/mapper/WWIDp2
-                        self.disk = self.disk[:-2]
-                except OSError:
-                    pass
-        except OSError:
-            logger.error("Unable to determine disk for grub installation " + traceback.format_exc())
-            return False
-
-        self.grub_dict = {
-        "product" : PRODUCT_SHORT,
-        "version" : PRODUCT_VERSION,
-        "release" : PRODUCT_RELEASE,
-        "partN" : self.partN,
-        "root_param" : self.root_param,
-        "bootparams" : self.bootparams,
-        "disk" : self.disk,
-        "grub_dir" : self.grub_dir,
-        "grub_prefix" : self.grub_prefix
-    }
-
-        if os.path.exists("/sbin/grub2-install"):
-            if not self.grub2_install():
-                logger.error("Grub2 Installation Failed ")
-                return False
-            else:
-                logger.info("Grub 2 Installation Completed")
-        else:
-            if not self.grub_install():
-                logger.error("Grub Installation Failed ")
-                return False
-            else:
-                logger.info("Grub 2 Installation Completed")
-
-        if OVIRT_VARS.has_key("OVIRT_ISCSI_ENABLED") \
-           and OVIRT_VARS["OVIRT_ISCSI_ENABLED"] == "y":
-            # copy default for when Root/HostVG is inaccessible(iscsi upgrade)
-            shutil.copy(OVIRT_DEFAULTS, "/boot")
-        else:
-            system("sync")
-            system("sleep 2")
-            system("umount /liveos")
-            # mark new Root ready to go, reboot() in ovirt-function switches it to active
-            e2label_cmd = "e2label \"%s\" RootUpdate" % candidate_dev
-            if not system(e2label_cmd):
-                logger.error("Unable to relabel " + candidate_dev + " to RootUpdate ")
-                return False
-        disable_firstboot()
-        if finish_install():
-            iscsi_auto()
-            logger.info("Installation of %s Completed" % PRODUCT_SHORT)
-            return True
-        else:
-            return False
 
+++ /dev/null
-#!/usr/bin/env python
-#
-# iscsi.py - Copyright (C) 2011 Red Hat, Inc.
-# Written by Joey Boggs <
[email protected]>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-import os
-from ovirtnode.ovirtfunctions import *
-import logging
-
-INITIATOR_FILE="/etc/iscsi/initiatorname.iscsi"
-
-def set_iscsi_initiator(initiator_name):
-    iscsi_config = open(INITIATOR_FILE, "w")
-    iscsi_config.write("InitiatorName=" + initiator_name + "\n")
-    iscsi_config.close()
-    if ovirt_store_config(INITIATOR_FILE):
-        logger.info("Initiator name set as: " + initiator_name)
-    else:
-        logger.warning("Setting initiator name failed")
-    os.system("service iscsi restart &> /dev/null")
-
-def get_current_iscsi_initiator_name():
-    iscsi_config = open(INITIATOR_FILE)
-    initiator_name = ""
-    for line in iscsi_config:
-        if "InitiatorName" in line:
-            initiator_name = line.replace("InitiatorName=","")
-            return initiator_name.strip()
-
-def iscsi_auto():
-    if not OVIRT_VARS.has_key("OVIRT_ISCSI_NAME"):
-        logger.info("Generating iSCSI IQN")
-        iscsi_iqn_cmd = subprocess.Popen("/sbin/iscsi-iname", stdout=PIPE)
-        iscsi_iqn, err = iscsi_iqn_cmd.communicate()
-        set_iscsi_initiator(iscsi_iqn.strip())
-    else:
-        set_iscsi_initiator(OVIRT_VARS["OVIRT_ISCSI_NAME"])
 
+++ /dev/null
-#!/usr/bin/env python
-#
-# kdump.py - Copyright (C) 2010 Red Hat, Inc.
-# Written by Joey Boggs <
[email protected]>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-from ovirtnode.ovirtfunctions import *
-
-def write_kdump_config(config):
-    kdump_config_file = open("/etc/kdump.conf", "w")
-    kdump_config_file.write("default reboot\n")
-    kdump_config_file.write("net " + config + "\n")
-    kdump_config_file.close()
-    ovirt_store_config("/etc/kdump.conf")
-    return True
-
-def restore_kdump_config():
-    kdump_config_file = open("/etc/kdump.conf", "w")
-    kdump_config_file.write("default reboot\n")
-    kdump_config_file.write("ext4 /dev/HostVG/Data\n")
-    kdump_config_file.write("path /core\n")
-    kdump_config_file.close()
-    return True
-
-def process_kdump_config():
-    if self.kdump_nfs.value() == 1:
-        write_kdump_config(self.kdump_nfs_config)
-    if self.kdump_ssh.value() == 1:
-        write_kdump_config(self.kdump_ssh_config)
-    if self.kdump_restore_config.value() == 1:
-        restore_kdump_config()
-    ovirt_store_config("/etc/kdump.conf")
-    os.system("service kdump restart &> /dev/null")
-    return True
-
-
-def kdump_auto():
-    try:
-        if OVIRT_VARS.has_key("OVIRT_KDUMP_NFS"):
-            write_kdump_config(OVIRT_VARS["OVIRT_KDUMP_NFS"])
-            ovirt_store_config("/etc/kdump.conf")
-            logger.info("Syslog Configuration Completed")
-            return True
-    except:
-        logger.error("KDump Configuration Failed")
 
+++ /dev/null
-#!/bin/bash
-# local_boot_trigger.sh - access given URL to signal that node installation
-# is done
-#
-# Scripts in /etc/ovirt-config-boot.d/ are executed just before the node is
-# rebooted. This one calls an URL given as a boot parameter e.g.
-# local_boot_trigger=http://cobbler.server.example.com/cblr/svc/op/nopxe/system/@HOSTNAME@
-# where @HOSTNAME@ is replaced by $(hostname)
-# In this example, Cobbler is triggered to change pxelinux config for that
-# system to perform a local boot when /etc/cobbler/settings/pxe_just_once
-# is set to 1.
-
-trigger_url=
-for i in $(cat /proc/cmdline); do
-    case $i in
-        local_boot_trigger=*)
-            trigger_url=${i#local_boot_trigger=}
-            ;;
-    esac
-done
-
-if [ -n "$trigger_url" ]; then
-    trigger_url=$(echo $trigger_url | sed -e "s/@HOSTNAME@/$(hostname)/")
-    wget "$trigger_url" -O /dev/null
-fi
-
 
+++ /dev/null
-#!/usr/bin/python
-#
-# Configures the rsyslog daemon.
-
-import os
-import sys
-from ovirtnode.ovirtfunctions import *
-
-RSYSLOG_FILE="/etc/rsyslog.conf"
-
-RSYSLOG_CONFIG_TEMPLATE = """
-#ovirt rsyslog config file
-
-#### MODULES ####
-$ModLoad imuxsock.so    # provides support for local system logging (e.g. via logger command)
-$ModLoad imklog.so      # provides kernel logging support (previously done by rklogd)
-
-#### GLOBAL DIRECTIVES ####
-# Use default timestamp format
-$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
-
-#### RULES ####
-# Log anything (except mail) of level info or higher.
-# Don't log private authentication messages!
-*.info;mail.none;authpriv.none;cron.none                /var/log/messages
-
-# The authpriv file has restricted access.
-authpriv.*                                              /var/log/secure
-
-# Log all the mail messages in one place.
-mail.*                                                  -/var/log/maillog
-
-# Log cron stuff
-cron.*                                                  /var/log/cron
-
-# Everybody gets emergency messages
-*.emerg                                                 *
-
-# Save news errors of level crit and higher in a special file.
-uucp,news.crit                                          /var/log/spooler
-
-# Save boot messages also to boot.log
-local7.*                                                /var/log/boot.log
-
-$WorkDirectory /var/spool/rsyslog
-$ActionQueueFileName ovirtNode
-$ActionQueueMaxDiskSpace 10m
-$ActionQueueSaveOnShutdown on
-$ActionQueueType LinkedList
-$ActionResumeRetryCount -1
-%(disable)s*.* %(delim)s%(server)s:%(port)s
-"""
-
-
-def ovirt_rsyslog(server, port, protocol):
-    if server == "":
-        disable = "#"
-    else:
-        disable = ""
-    if protocol == "tcp":
-        DELIM="@@"
-    else:
-        DELIM="@"
-
-    if is_valid_ipv6(server):
-        server = "[" + server + "]"
-
-    rsyslog_dict = {
-        "disable" : disable,
-        "delim" : DELIM,
-        "server" : server,
-        "port" : port
-    }
-    rsyslog_config_out = RSYSLOG_CONFIG_TEMPLATE % rsyslog_dict
-    rsyslog_config = open(RSYSLOG_FILE, "w")
-    rsyslog_config.write(rsyslog_config_out)
-    rsyslog_config.close()
-    os.system("/sbin/service rsyslog restart &> /dev/null")
-    logger.info("Syslog Configuration Updated")
-    return True
-
-def ovirt_netconsole(server, port):
-    augtool("set","/files/etc/sysconfig/netconsole/SYSLOGADDR", server)
-    augtool("set","/files/etc/sysconfig/netconsole/SYSLOGPORT", port)
-    os.system("/sbin/service netconsole restart &> /dev/null")
-    if ovirt_store_config("/etc/sysconfig/netconsole"):
-        logger.info("Netconsole Configuration Updated")
-    return True
-
-
-def set_logrotate_size(size):
-     try:
-         augtool("set", "/files/etc/logrotate.d/ovirt-node/rule/size", size)
-         ovirt_store_config("/etc/logrotate.d/ovirt-node")
-         return True
-     except:
-        return False
-
-def get_rsyslog_config():
-    rsyslog_config = open(RSYSLOG_FILE)
-    for line in rsyslog_config:
-        if "@" in line:
-            #strip excess details
-            line = line.replace("*.* ", "")
-            line = line.replace("@","")
-            try:
-                server, port = line.split(":")
-                if not server.startswith("#"):
-                    return (server,port.strip())
-            except:
-                # try ipv6 parsing
-                try:
-                    ip, port = line.split("]")
-                    server = ip.replace("[","")
-                    port = port.replace(":","")
-                    if not server.startswith("#"):
-                        return (server,port.strip())
-                except:
-                    logger.error("rsyslog config parsing failed " + line)
-                    return
-
-def syslog_auto():
-    host = ""
-    port = ""
-    if not OVIRT_VARS.has_key("OVIRT_SYSLOG_SERVER") or not OVIRT_VARS.has_key("OVIRT_SYSLOG_PORT"):
-        logger.info("Attempting to locate remote syslog server...")
-        try:
-            host, port = find_srv("syslog", "udp")
-        except:
-            pass
-        if not host is "" and not port is "":
-            logger.info("Found! Using syslog server " + host + ":" + port)
-            ovirt_rsyslog(host, port, "udp")
-            return True
-        else:
-            logger.warn("Syslog server not found!")
-            return False
-    else:
-        logger.info("Using default syslog server " + OVIRT_VARS["OVIRT_SYSLOG_SERVER"] + ":" + OVIRT_VARS["OVIRT_SYSLOG_PORT"] + ".")
-        ovirt_rsyslog(OVIRT_VARS["OVIRT_SYSLOG_SERVER"], OVIRT_VARS["OVIRT_SYSLOG_PORT"], "udp")
-        return True
-
-def netconsole_auto():
-    host = ""
-    port = ""
-    if not OVIRT_VARS.has_key("OVIRT_NETCONSOLE_SERVER") or not OVIRT_VARS.has_key("OVIRT_NETCONSOLE_PORT"):
-        logger.info("Attempting to locate remote netconsole server...")
-        try:
-            host, port = find_srv("netconsole", "udp")
-        except:
-            pass
-        if not host is "" and not port is "":
-            logger.info("Found! Using netconsole server " + host + ":" + port)
-            ovirt_netconsole(host, port)
-            return True
-        else:
-            logger.warn("Netconsole server not found!")
-            return False
-    else:
-        logger.info("Using default netconsole server " + OVIRT_VARS["OVIRT_NETCONSOLE_SERVER"] + ":" + OVIRT_VARS["OVIRT_NETCONSOLE_PORT"] + ".")
-        ovirt_netconsole(OVIRT_VARS["OVIRT_NETCONSOLE_SERVER"], OVIRT_VARS["OVIRT_NETCONSOLE_PORT"])
-        return True
-
-def logging_auto():
-    try:
-        syslog_auto()
-        logger.info("Syslog Configuration Completed")
-    except:
-        logger.warn("Syslog Configuration Failed")
-    try:
-        netconsole_auto()
-        logger.info("Syslog Configuration Completed")
-    except:
-        logger.warn("Netconsole Configuration Failed")
 
+++ /dev/null
-#!/usr/bin/python
-# network.py - Copyright (C) 2010 Red Hat, Inc.
-# Written by Joey Boggs <
[email protected]>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-from ovirtnode.ovirtfunctions import *
-from glob import glob
-import tempfile
-import sys
-import logging
-
-class Network:
-
-    def __init__(self):
-        OVIRT_VARS = parse_defaults()
-        self.WORKDIR=tempfile.mkdtemp()
-        self.IFSCRIPTS_PATH ="/etc/sysconfig/network-scripts/ifcfg-"
-        self.IFCONFIG_FILE_ROOT="/files%s" % self.IFSCRIPTS_PATH
-        self.NTP_CONFIG_FILE="/etc/ntp.conf"
-        self.NTPSERVERS=""
-        self.CONFIGURED_NIC = ""
-        self.CONFIGURED_NICS = []
-        self.IF_CONFIG = ""
-        self.BR_CONFIG = ""
-        self.VL_CONFIG = ""
-        self.VLAN_ID=""
-        self.VL_ROOT=""
-        self.VL_FILENAME =""
-        self.nic=""
-        self.bridge=""
-        self.vlan_id=""
-
-    def configure_interface(self):
-        logger.info("Configuring Interface")
-        self.disabled_nic = 0
-        if OVIRT_VARS.has_key("OVIRT_IP_ADDRESS"):
-            IPADDR = OVIRT_VARS["OVIRT_IP_ADDRESS"]
-            NETMASK = OVIRT_VARS["OVIRT_IP_NETMASK"]
-            GATEWAY = OVIRT_VARS["OVIRT_IP_GATEWAY"]
-
-        if self.CONFIGURED_NIC is None:
-            logger.warn("Aborting Network Configuration")
-            return False
-
-        if OVIRT_VARS.has_key("OVIRT_BOOTIF"):
-            if OVIRT_VARS["OVIRT_BOOTIF"].endswith("-DISABLED"):
-                self.disabled_nic = 1
-            self.CONFIGURED_NIC = OVIRT_VARS["OVIRT_BOOTIF"].strip("-DISABLED")
-
-        n_address = open("/sys/class/net/" + self.CONFIGURED_NIC + "/address")
-        nic_hwaddr = n_address.readline().strip("\n")
-        n_address.close()
-        BRIDGE = "br" + self.CONFIGURED_NIC
-        self.CONFIGURED_NICS.append(self.CONFIGURED_NIC)
-        self.CONFIGURED_NICS.append(BRIDGE)
-        IF_FILENAME = self.WORKDIR + "/augtool-" + self.CONFIGURED_NIC
-        BR_FILENAME = self.WORKDIR + "/augtool-" + BRIDGE
-        logger.info("Configure %s for use by %s" % (BRIDGE, self.CONFIGURED_NIC))
-        IF_ROOT = "%s%s" % (self.IFCONFIG_FILE_ROOT, self.CONFIGURED_NIC)
-        self.IF_CONFIG += "rm %s\nset %s/DEVICE %s\n" % (IF_ROOT, IF_ROOT, self.CONFIGURED_NIC)
-        self.IF_CONFIG += "set %s/HWADDR %s\n" % (IF_ROOT, nic_hwaddr)
-        BR_ROOT = "%s%s" % (self.IFCONFIG_FILE_ROOT, BRIDGE)
-        self.BR_CONFIG += "rm %s\nset %s/DEVICE %s\n" % (BR_ROOT, BR_ROOT, BRIDGE)
-        self.BR_CONFIG += "set %s/TYPE Bridge\n" % BR_ROOT
-        self.BR_CONFIG += "set %s/PEERNTP yes\n" % BR_ROOT
-        self.BR_CONFIG += "set %s/DELAY 0\n" % BR_ROOT
-        if OVIRT_VARS.has_key("OVIRT_IPV6"):
-            if OVIRT_VARS["OVIRT_IPV6"]  == "auto":
-                self.BR_CONFIG += "set %s/IPV6INIT yes\n" % BR_ROOT
-                self.BR_CONFIG += "set %s/IPV6FORWARDING no\n" % BR_ROOT
-                self.BR_CONFIG += "set %s/IPV6_AUTOCONF yes\n" % BR_ROOT
-            elif OVIRT_VARS["OVIRT_IPV6"] == "dhcp":
-                self.BR_CONFIG += "set %s/IPV6INIT yes\n" % BR_ROOT
-                self.BR_CONFIG += "set %s/IPV6_AUTOCONF no\n" % BR_ROOT
-                self.BR_CONFIG += "set %s/IPV6FORWARDING no\n" % BR_ROOT
-                self.BR_CONFIG += "set %s/DHCPV6C yes\n" % BR_ROOT
-            elif OVIRT_VARS["OVIRT_IPV6"] == "static":
-                self.BR_CONFIG += "set %s/IPV6INIT yes\n" % BR_ROOT
-                self.BR_CONFIG += "set %s/IPV6ADDR %s/%s\n" % (BR_ROOT, OVIRT_VARS["OVIRT_IPV6_ADDRESS"], OVIRT_VARS["OVIRT_IPV6_NETMASK"])
-                self.BR_CONFIG += "set %s/IPV6_AUTOCONF no\n" % BR_ROOT
-                self.BR_CONFIG += "set %s/IPV6FORWARDING no\n" % BR_ROOT
-                self.BR_CONFIG += "set %s/IPV6_DEFAULTGW %s\n" % (BR_ROOT, OVIRT_VARS["OVIRT_IPV6_GATEWAY"])
-        else:
-            self.BR_CONFIG += "set %s/IPV6INIT no\n" % BR_ROOT
-            self.BR_CONFIG += "set %s/IPV6_AUTOCONF no\n" % BR_ROOT
-            self.BR_CONFIG += "set %s/IPV6FORWARDING no\n" % BR_ROOT
-
-
-        if OVIRT_VARS.has_key("OVIRT_VLAN"):
-            VLAN_ID=OVIRT_VARS["OVIRT_VLAN"]
-            self.CONFIGURED_NICS.append("%s.%s" % (self.CONFIGURED_NIC, VLAN_ID))
-            VL_ROOT = "%s.%s" % (IF_ROOT, VLAN_ID)
-            self.VL_CONFIG += "rm %s\n" % VL_ROOT
-            self.VL_CONFIG += "set %s/DEVICE %s.%s\n" % (VL_ROOT, self.CONFIGURED_NIC, VLAN_ID)
-            self.VL_CONFIG += "set %s/HWADDR %s\n" % (VL_ROOT, nic_hwaddr)
-            self.VL_CONFIG += "set %s/BRIDGE %s\n" % (VL_ROOT, BRIDGE)
-            self.VL_CONFIG += "set %s/VLAN yes\n" % VL_ROOT
-            self.VL_FILENAME = "%s.%s" % (IF_FILENAME, OVIRT_VARS["OVIRT_VLAN"])
-            self.VL_CONFIG +="set %s/ONBOOT yes" % VL_ROOT
-
-
-        if not OVIRT_VARS.has_key("OVIRT_IP_ADDRESS"):
-            if OVIRT_VARS.has_key("OVIRT_BOOTIF") and self.disabled_nic == 0:
-                if not self.VL_CONFIG:
-                   self.IF_CONFIG += "set %s/BRIDGE %s\n" % (IF_ROOT, BRIDGE)
-                self.BR_CONFIG += "set %s/BOOTPROTO dhcp\n" % BR_ROOT
-            elif self.disabled_nic == 1:
-                self.BR_CONFIG += "set %s/BOOTPROTO none\n" % BR_ROOT
-
-        elif OVIRT_VARS.has_key("OVIRT_IP_ADDRESS"):
-            if OVIRT_VARS.has_key("OVIRT_IP_ADDRESS") and OVIRT_VARS["OVIRT_IP_ADDRESS"] != "off":
-                self.BR_CONFIG += "set %s/BOOTPROTO static\n" % (BR_ROOT)
-               if self.VL_CONFIG == "":
-                    self.IF_CONFIG += "set %s/BRIDGE %s\n" % (IF_ROOT, BRIDGE)
-                self.BR_CONFIG += "set %s/IPADDR %s\n" % (BR_ROOT, OVIRT_VARS["OVIRT_IP_ADDRESS"])
-                if OVIRT_VARS.has_key("OVIRT_IP_NETMASK"):
-                    self.BR_CONFIG += "set %s/NETMASK %s\n" % (BR_ROOT, OVIRT_VARS["OVIRT_IP_NETMASK"])
-                if OVIRT_VARS.has_key("OVIRT_IP_GATEWAY"):
-                    self.BR_CONFIG += "set %s/GATEWAY %s\n" % (BR_ROOT, OVIRT_VARS["OVIRT_IP_GATEWAY"])
-
-        self.IF_CONFIG += "set %s/ONBOOT yes" % IF_ROOT
-        self.BR_CONFIG += "set %s/ONBOOT yes" % BR_ROOT
-        self.IF_CONFIG = self.IF_CONFIG.split("\n")
-        self.BR_CONFIG = self.BR_CONFIG.split("\n")
-        try:
-            self.VL_CONFIG = self_VL_CONFIG.split("\n")
-        except:
-            pass
-        return True
-
-    def configure_dns(self):
-        if OVIRT_VARS.has_key("OVIRT_DNS"):
-            DNS=OVIRT_VARS["OVIRT_DNS"]
-            try:
-                if not DNS is None:
-                    DNS = DNS.split(",")
-                    i = 1
-                    for server in DNS:
-                        setting = "/files/etc/resolv.conf/nameserver[%s]" % i
-                        augtool("set", setting, server)
-                        i = i + i
-                    ovirt_store_config("/etc/resolv.conf")
-            except:
-                logger.warn("Failed to set DNS servers")
-            finally:
-                if len(DNS) < 2:
-                    augtool("rm", "/files/etc/resolv.conf/nameserver[2]", "")
-
-    def configure_ntp(self):
-        if OVIRT_VARS.has_key("OVIRT_NTP"):
-            NTPSERVERS=OVIRT_VARS["OVIRT_NTP"]
-        else:
-            NTPSERVERS=""
-
-    def save_ntp_configuration(self):
-        ntproot = "/files/etc/ntp.conf"
-        ntpconf = "rm %s\n" % ntproot
-        ntpconf += "set %s/driftfile /var/lib/ntp/drift\n" % ntproot
-        ntpconf += "set %s/includefile /etc/ntp/crypto/pw\n" % ntproot
-        ntpconf += "set %s/keys /etc/ntp/keys" % ntproot
-        ntpconf = ntpconf.split("\n")
-        for line in ntpconf:
-            try:
-                oper, key, value = line.split()
-                augtool(oper, key, value)
-            except:
-                oper, key = line.split()
-                augtool(oper, key, "")
-
-        if OVIRT_VARS.has_key("OVIRT_NTP"):
-            offset=1
-            SERVERS = OVIRT_VARS["OVIRT_NTP"].split(",")
-            for server in SERVERS:
-                if offset == 1:
-                    augtool("set", "/files/etc/ntp.conf/server[1]", server)
-                elif offset == 2:
-                    augtool("set", "/files/etc/ntp.conf/server[2]", server)
-                offset = offset + 1
-            os.system("service ntpd stop &> /dev/null")
-            os.system("service ntpdate start &> /dev/null")
-            os.system("service ntpd start &> /dev/null")
-
-    def save_network_configuration(self):
-        aug.load()
-        net_configured=0
-        augtool_workdir_list = "ls %s/augtool-* >/dev/null"
-        logger.info("Configuring network")
-        system("ifdown br" + self.CONFIGURED_NIC)
-        for vlan in os.listdir("/proc/net/vlan/"):
-            # XXX wrong match e.g. eth10.1 with eth1
-            if self.CONFIGURED_NIC in vlan:
-                os.system("vconfig rem " + vlan + "&> /dev/null")
-                ovirt_safe_delete_config(self.IFSCRIPTS_PATH + vlan)
-                os.system("rm -rf " + self.IFSCRIPTS_PATH + vlan)
-
-        for script in glob("%s%s*" % (self.IFSCRIPTS_PATH, self.CONFIGURED_NIC)):
-            # XXX wrong match e.g. eth10 with eth1* (need * to cover VLANs)
-            logger.debug("Removing Script: " + script)
-            ovirt_safe_delete_config(script)
-        augtool("rm", self.IFCONFIG_FILE_ROOT+"br"+self.CONFIGURED_NIC, "")
-
-        for line in self.IF_CONFIG:
-            logger.debug(line)
-            try:
-                oper, key, value = line.split()
-                augtool(oper, key, value)
-            except:
-                oper, key = line.split()
-                augtool(oper, key, "")
-
-        for line in self.BR_CONFIG:
-            logger.debug(line)
-            try:
-                oper, key, value = line.split()
-                augtool(oper, key, value)
-            except:
-                try:
-                    oper, key = line.split()
-                    augtool(oper, key, "")
-                except:
-                    pass
-
-        for line in self.VL_CONFIG.split("\n"):
-            logger.debug(line)
-            try:
-                oper, key, value = line.split()
-                augtool(oper, key, value)
-            except:
-                try:
-                    oper, key = line.split()
-                    augtool(oper, key, "")
-                except:
-                    pass
-
-        # preserve current MAC mappings for *all physical* network interfaces
-        for nicdev in glob('/sys/class/net/*/device'):
-            nic=nicdev.split('/')[4]
-            if nic != self.CONFIGURED_NIC:
-                f=open('/sys/class/net/%s/address' % nic)
-                mac=f.read().strip()
-                f.close()
-                if len(mac) > 0:
-                    self.CONFIGURED_NICS.append(nic)
-                    nicroot = "%s%s" % (self.IFCONFIG_FILE_ROOT, nic)
-                    # XXX augtool does save every time!
-                    augtool("set", "%s/DEVICE" % nicroot, nic)
-                    augtool("set", "%s/HWADDR" % nicroot, mac)
-                    augtool("set", "%s/ONBOOT" % nicroot, "no")
-
-        net_configured=1
-        for nic in self.CONFIGURED_NICS:
-            ovirt_store_config("%s%s" % (self.IFSCRIPTS_PATH, nic) )
-        ovirt_store_config(self.NTP_CONFIG_FILE)
-        augtool("set", "/files/etc/sysconfig/network/NETWORKING", "yes")
-        ovirt_store_config("/etc/sysconfig/network")
-        logger.info("Network configured successfully")
-        if net_configured == 1:
-            logger.info("Stopping Network services")
-            os.system("service network stop &> /dev/null")
-            os.system("service ntpd stop &> /dev/null")
-            # XXX eth assumed in breth
-            brctl_cmd = "brctl show|grep breth|awk '{print $1}'"
-            brctl = subprocess.Popen(brctl_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-            brctl_output = brctl.stdout.read()
-            for i in brctl_output.split():
-                if_down_cmd = "ifconfig %s down &> /dev/null" % i
-                os.system(if_down_cmd)
-                del_br_cmd = "brctl delbr %s &> /dev/null" % i
-                os.system(del_br_cmd)
-            logger.info("Starting Network service")
-            os.system("service network start &> /dev/null")
-            os.system("service ntpdate start &> /dev/null")
-            os.system("service ntpd start &> /dev/null")
-            # rhbz#745541
-            os.system("service rpcbind start &> /dev/null")
-            os.system("service nfslock start &> /dev/null")
-            os.system("service rpcidmapd start &> /dev/null")
-            os.system("service rpcgssd start &> /dev/null")
-            if OVIRT_VARS.has_key("NTP"):
-                logger.info("Testing NTP Configuration")
-                test_ntp_configuration()
-
-def get_system_nics():
-    client = gudev.Client(['net'])
-    configured_nics = 0
-    ntp_dhcp = 0
-    nic_dict = {}
-    for device in client.query_by_subsystem("net"):
-        try:
-            dev_interface = device.get_property("INTERFACE")
-            dev_vendor = device.get_property("ID_VENDOR_FROM_DATABASE")
-            dev_type = device.get_property("DEVTYPE")
-            dev_path = device.get_property("DEVPATH")
-            try:
-                dev_vendor = dev_vendor.replace(",", "")
-            except AttributeError:
-                try:
-                    # rhevh workaround since udev version doesn't have vendor info
-                    dev_path = dev_path.split('/')
-                    if "virtio" in dev_path[4]:
-                        pci_dev = dev_path[3].replace("0000:","")
-                    else:
-                        pci_dev = dev_path[4].replace("0000:","")
-                    pci_lookup_cmd = " lspci|grep %s|awk -F \":\" {'print $3'}" % pci_dev
-                    pci_lookup = subprocess.Popen(pci_lookup_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-                    dev_vendor = pci_lookup.stdout.read().strip()
-                except:
-                    dev_vendor = "unknown"
-            try:
-                dev_vendor = dev_vendor.replace(",", "")
-            except AttributeError:
-                dev_vendor = "unknown"
-            dev_vendor = pad_or_trim(25, dev_vendor)
-            try:
-                dev_driver = os.readlink("/sys/class/net/" + dev_interface + "/device/driver")
-                dev_driver = os.path.basename(dev_driver)
-            except:
-                pass
-            nic_addr_file = open("/sys/class/net/" + dev_interface + "/address")
-            dev_address = nic_addr_file.read().strip()
-            cmd = "/files/etc/sysconfig/network-scripts/ifcfg-%s/BOOTPROTO" % str(dev_interface)
-            dev_bootproto = augtool_get(cmd)
-            type_cmd = "/files/etc/sysconfig/network-scripts/ifcfg-%s/TYPE" % str(dev_interface)
-            bridge_cmd = "/files/etc/sysconfig/network-scripts/ifcfg-%s/BRIDGE" % str(dev_interface)
-            dev_bridge =  augtool_get(bridge_cmd)
-            if dev_bootproto is None:
-                cmd = "/files/etc/sysconfig/network-scripts/ifcfg-%s/BOOTPROTO" % str(dev_bridge)
-                dev_bootproto = augtool_get(cmd)
-                if dev_bootproto is None:
-                    dev_bootproto = "Disabled"
-                    dev_conf_status = "Unconfigured"
-                    # check for vlans
-                    logger.debug("checking for vlan")
-                    if len(glob("/etc/sysconfig/network-scripts/ifcfg-" + dev_interface + ".*")) > 0:
-                        logger.debug("found vlan")
-                        dev_conf_status = "Configured  "
-                else:
-                    dev_conf_status = "Configured  "
-            else:
-                dev_conf_status = "Configured  "
-            if dev_conf_status == "Configured  ":
-                configured_nics = configured_nics + 1
-        except:
-            pass
-        if not dev_interface == "lo" and not dev_interface.startswith("bond") and not dev_interface.startswith("sit") and not "." in dev_interface:
-            if not dev_type == "bridge":
-                nic_dict[dev_interface] = "%s,%s,%s,%s,%s,%s,%s" % (dev_interface,dev_bootproto,dev_vendor,dev_address, dev_driver, dev_conf_status,dev_bridge)
-                if dev_bootproto == "dhcp":
-                    ntp_dhcp = 1
-    return nic_dict, configured_nics, ntp_dhcp
-
-def network_auto():
-    try:
-        network = Network()
-        network.configure_interface()
-        network.configure_dns()
-        network.configure_ntp()
-        network.save_ntp_configuration()
-        network.save_network_configuration()
-    except:
-        logger.warn("Network Configuration Failed....")
-        sys.exit(1)
 
+++ /dev/null
-# node configuration
-
-# defines the node's runtime mode, unless overridden
-# on the kernel command line
-# allowed values are:
-#  ovirt   - managed by an oVirt management server
-#  none    - standalone, unmamanged mode
-#  managed - managed by another server type
-OVIRT_RUNTIME_MODE="none"
-
-# the management server hostname or address
-OVIRT_MANAGEMENT_SERVER=""
-
-# the maangement server port
-OVIRT_MANAGEMENT_PORT=""
-
-# the keytab directory
-KEYTAB_FILE=/etc/libvirt/krb5.tab
 
+++ /dev/null
-#!/bin/bash
-#
-# ovirt Start ovirt services
-#
-### BEGIN INIT INFO
-# Provides: ovirt
-# Required-Start: ovirt-awake
-# Default-Start: 2 3 4 5
-# Description: Performs managed node configuration functions.
-### END INIT INFO
-
-# Source functions library
-. /etc/init.d/functions
-. /usr/libexec/ovirt-functions
-
-prog=ovirt
-VAR_SUBSYS_OVIRT=/var/lock/subsys/$prog
-
-ovirt_start() {
-    if is_standalone; then
-        return 0
-    fi
-    find_srv ipa tcp
-    if [ -n "$SRV_HOST" -a -n "$SRV_PORT" ]; then
-        krb5_conf=/etc/krb5.conf
-        # FIXME this is IPA specific
-        wget -q --no-check-certificate \
-            http://$SRV_HOST:$SRV_PORT/ipa/config/krb5.ini -O $krb5_conf.tmp
-        if [ $? -ne 0 ]; then
-            log "Failed to get $krb5_conf"; return 1
-        fi
-        mv $krb5_conf.tmp $krb5_conf
-    else
-        log "skipping Kerberos configuration"
-    fi
-
-
-    find_srv collectd udp
-    if [ -n "$SRV_HOST" -a -n "$SRV_PORT" ]; then
-        collectd_conf=/etc/collectd.conf
-        if [ -f $collectd_conf.in ]; then
-            sed -e "s/@COLLECTD_SERVER@/$SRV_HOST/" \
-                -e "s/@COLLECTD_PORT@/$SRV_PORT/" \
-                -e "/<Plugin rrdtool>/,/<\/Plugin>/d" $collectd_conf.in \
-                > $collectd_conf
-            if [ $? -ne 0 ]; then
-                log "Failed to write $collectd_conf"; return 1
-            fi
-        fi
-    else
-        log "skipping collectd configuration, collectd service not available"
-    fi
-
-    find_srv qpidd tcp
-    if [ -n "$SRV_HOST" -a -n "$SRV_PORT" ]; then
-        libvirt_qpid_conf=/etc/sysconfig/libvirt-qpid
-        if [ -f $libvirt_qpid_conf ]; then
-            echo "LIBVIRT_QPID_ARGS=\"--broker $SRV_HOST --port $SRV_PORT\"" >> $libvirt_qpid_conf
-            echo "/usr/kerberos/bin/kinit -k -t /etc/libvirt/krb5.tab qpidd/`hostname`" >> $libvirt_qpid_conf
-        fi
-        matahari_conf=/etc/sysconfig/matahari
-        if [ -f $matahari_conf ]; then
-            echo "MATAHARI_ARGS=\"--broker $SRV_HOST --port $SRV_PORT\"" >> $matahari_conf
-            echo "/usr/kerberos/bin/kinit -k -t /etc/libvirt/krb5.tab qpidd/`hostname`" >> $matahari_conf
-        fi
-    else
-        log "skipping libvirt-qpid and matahari configuration, could not find $libvirt_qpid_conf"
-    fi
-}
-
-start_ovirt () {
-    touch $VAR_SUBSYS_OVIRT
-    case $OVIRT_RUNTIME_MODE in
-        "ovirt")
-            ovirt_start
-            ;;
-        "managed")
-            if [ -x $MANAGEMENT_SCRIPTS_DIR/ready ]; then
-                log "Executing $MANAGEMENT_SCRIPTS_DIR/ready."
-                $MANAGEMENT_SCRIPTS_DIR/ready
-                RC=$?
-            else
-                log "No script to perform node activation."
-            fi
-    esac
-    rm -f $VAR_SUBSYS_OVIRT
-    return $RC
-}
-
-stop_ovirt () {
-    echo -n "Stopping ovirt: "
-    rm -f $VAR_SUBSYS_OVIRT
-    success
-}
-
-reload_ovirt () {
-        stop_ovirt
-        start_ovirt
-}
-
-case "$1" in
-    start)
-        [ -f "$VAR_SUBSYS_OVIRT" ] && exit 0
-        echo -n "Starting ovirt: "
-        {
-            log "Starting ovirt"
-            start_ovirt
-            log "Completed ovirt"
-        } >> $OVIRT_LOGFILE 2>&1
-        test $? == 0 && success || failure
-        ;;
-    status)
-        status $prog
-        ;;
-    reload)
-        reload_ovirt
-        ;;
-    stop)
-        stop_ovirt
-        ;;
-    *)
-        echo "Usage: ovirt {start}"
-        exit 2
-esac
 
+++ /dev/null
-#!/bin/bash
-. /etc/profile
-# Hide kernel messages on the console
-sudo dmesg -n 1
-TTY=`tty|sed 's/\/dev\///g'`
-# clear leftover lockfiles files created for ssh sessions
-if [[ $TTY =~ "pts" ]]; then
-    TTY=`echo $TTY|sed 's/\///g'`
-    sudo rm -rf /tmp/ovirt-setup.$TTY
-fi
-sudo /usr/libexec/ovirt-config-setup
-
-# check for logout return code and drop to login prompt
-ret=$?
-if [[ $ret == 2 ]]; then
-    sudo rm -rf /tmp/ovirt-setup.$TTY
-    /usr/bin/clear; exit
-fi
 
+++ /dev/null
-#!/usr/bin/env python
-#
-# ovirt-auto-install.py - Copyright (C) 2011 Red Hat, Inc.
-# Written by Joey Boggs <
[email protected]>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-import os
-import sys
-from ovirtnode.ovirtfunctions import *
-from ovirtnode.storage import *
-from ovirtnode.install import *
-from ovirtnode.network import *
-from ovirtnode.log import *
-from ovirtnode.kdump import *
-from ovirtnode.snmp import *
-from ovirt_config_setup.collectd import *
-
-print "Performing automatic disk partitioning"
-if storage_auto():
-    print "Completed automatic disk partitioning"
-    # store /etc/shadow if adminpw/rootpw are set, handled already in ovirt-early
-    file = open("/proc/cmdline")
-    args = file.read()
-    if "adminpw" in args or "rootpw" in args:
-        print "Storing /etc/shadow"
-        ovirt_store_config("/etc/passwd")
-        ovirt_store_config("/etc/shadow")
-    file.close()
-    # network configuration
-    print "Configuring Network"
-    if OVIRT_VARS["OVIRT_BOOTIF"] != "":
-        network_auto()
-
-    if OVIRT_VARS.has_key("OVIRT_HOSTNAME"):
-        system("hostname %s" % OVIRT_VARS["OVIRT_HOSTNAME"])
-    #set ssh_passwd_auth
-    if OVIRT_VARS.has_key("OVIRT_SSH_PWAUTH"):
-        if self.ssh_passwd_status.value() == 1:
-            augtool("set","/files/etc/ssh/sshd_config/PasswordAuthentication", "yes")
-        elif self.ssh_passwd_status.value() == 0:
-            augtool("set","/files/etc/ssh/sshd_config/PasswordAuthentication", "no")
-
-    # iscsi handled in install.py
-    print "Configuring Logging"
-    logging_auto()
-    print "Configuring Collectd"
-    collectd_auto()
-    install = Install()
-    print "Configuring KDump"
-    kdump_auto()
-    print "Configuring SNMP"
-    snmp_auto()
-    print "Installing Bootloader"
-    if install.ovirt_boot_setup():
-        print "Bootloader Installation Completed"
-    else:
-        print "Bootloader Installation Failed"
-        sys.exit(1)
-    print "Installation and Configuration Completed"
-else:
-    print "Automatic installation failed. Please review /tmp/ovirt.log"
-    sys.exit(1)
 
+++ /dev/null
-#!/bin/bash
-#
-# ovirt-awake - Notifies any management server that the node is starting.
-#
-# Copyright (C) 2008-2010 Red Hat, Inc.
-# Written by Darryl L. Pierce <
[email protected]>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-#
-### BEGIN INIT INFO
-# Provides: ovirt-awake
-# Required-Start: ovirt-early
-# Default-Start: 2 3 4 5
-# Description: Managed node service to alert management servers.
-### END INIT INFO
-
-# Source functions library
-# config: /etc/sysconfig/node-config
-
-. /etc/init.d/functions
-. /usr/libexec/ovirt-functions
-
-prog=ovirt-awake
-NODE_CONFIG=/etc/sysconfig/node-config
-VAR_SUBSYS_NODECONFIG=/var/lock/subsys/node-config
-
-
-
-send_text () {
-    local text=${1}
-
-    echo "$text" 1>&3
-}
-
-receive_text () {
-    read 0<&3
-}
-
-error () {
-    local text=${1-}
-
-    send_text "ERR: (ovirt-awake) ${text}"
-    # log "${text}"
-}
-
-ovirt_startup () {
-    local mgmthost=${OVIRT_MANAGEMENT_SERVER}
-    local mgmtport=${OVIRT_MANAGEMENT_PORT}
-
-    if [[ -z "${mgmthost}" ]] || [[ -z "${mgmtport}" ]]; then
-        find_srv identify tcp
-        mgmthost=$SRV_HOST
-        mgmtport=$SRV_PORT
-    fi
-
-    if [[ -n "${mgmthost}" ]] && [[ -n "${mgmtport}" ]]; then
-        # log "Notifying oVirt management server: ${mgmthost}:${mgmtport}"
-        exec 3<>/dev/tcp/$mgmthost/$mgmtport
-
-        receive_text
-        if [ $REPLY == "HELLO?" ]; then
-            log "Starting wakeup conversation."
-            send_text "HELLO!"
-            receive_text
-            if [ $REPLY == "MODE?" ]; then
-                send_text "AWAKEN"
-                receive_text
-                KEYTAB=$(echo $REPLY | awk '{ print $2 }')
-                if [ -n "$KEYTAB" -a -n "$KEYTAB_FILE" ]; then
-                    # log "Retrieving keytab: '$KEYTAB'"
-                    wget -q "$KEYTAB" --no-check-certificate --output-document="$KEYTAB_FILE"
-                else
-                    log "No keytab to retrieve"
-                fi
-                send_text ACK
-            else
-                error "Did not get a mode request."
-            fi
-        else
-            error "Did not get a proper startup marker."
-        fi
-        # log "Disconnecting."
-        <&3-
-    else
-        # log "Missing server information. Failing..."
-        return 1
-    fi
-}
-
-# Override this method to provide support for notifying a management
-# system that the node has started and will be available after
-# system initialization
-start_ovirt_awake () {
-    local RC=0
-
-    touch $VAR_SUBSYS_NODECONFIG
-    # log "Starting ovirt-awake."
-    case "$OVIRT_RUNTIME_MODE" in
-        "none")
-            log "Node is operating in unmanaged mode."
-            ;;
-        "ovirt")
-            log "Node is operating in ovirt mode."
-            ovirt_startup
-            RC=$?
-            ;;
-        "managed")
-            if [ -x /config/$MANAGEMENT_SCRIPTS_DIR/awake ]; then
-                log "Executing /config/$MANAGEMENT_SCRIPTS_DIR/awake"
-                /config/$MANAGEMENT_SCRIPTS_DIR/awake
-            else
-                echo "No script found to notify management server during awake state."
-            fi
-            ;;
-    esac
-
-    # log "Completed ovirt-awake: RC=${RC}"
-    rm -f $VAR_SUBSYS_NODECONFIG
-    return $RC
-}
-
-stop_ovirt_awake () {
-    echo -n "Stopping ovirt-awake: "
-    success
-}
-
-reload_ovirt_awake () {
-    stop_ovirt_awake
-    start_ovirt_awake
-}
-
-case "$1" in
-    start)
-        echo -n "Starting ovirt-awake: "
-        [ -f "$VAR_SUBSYS_NODECONFIG" ] && exit 0
-        {
-            start_ovirt_awake
-            RETVAL=$?
-            log "Completed ovirt-awake: RETVAL=$?"
-        } >> $OVIRT_LOGFILE 2>&1
-        test $RETVAL == 0 && success || failure
-        ;;
-
-    stop)
-        stop_ovirt_awake
-        ;;
-
-    reload)
-        reload_ovirt_awake
-        ;;
-
-    *)
-        echo "Usage: $0 start"
-        RETVAL=2
-        ;;
-esac
-
-exit $RETVAL
 
+++ /dev/null
-# -*-Shell-script-*-
-
-LF=$'\n'
-SEP=','
-TAB=$'\t'
-
-dirname() {
-    if [ -e /usr/bin/dirname ]; then
-        /usr/bin/dirname $@
-    else
-        echo $1 | sed 's/\/'$(basename $1)'$//'
-    fi
-}
-
-# compat function to handle different udev versions
-udev_info() {
-    local name=$1
-    local query=$2
-    local options=$3
-    local out
-
-    out=$(udevadm info --name=$name --query=$query $options)
-    rc=$?
-    if [ $rc -eq 0 ]; then
-        echo $out
-    fi
-    return $rc
-}
-
-
-
-# $(get_live_disk)
-# livecd boot disk
-get_live_disk() {
-    local live_dev=/dev/live
-    if [ ! -e $live_dev ]; then
-      # PXE boot
-      live_dev=/dev/loop0
-      live_disk=
-    else
-      live_part=$(readlink -e $live_dev)
-      live_disk=$(basename $(dirname $(udev_info $live_part path)))
-      if [ "$live_disk" = "block" ]; then
-          live_disk=$(basename $(udev_info $live_part path))
-      fi
-    fi
-    echo $live_disk
-}
-
-# find_disk $bus $serial
-find_disk() {
-    local bus=$1
-    local serial=$2
-    local live=$(get_live_disk)
-    local found=
-    # in initramfs, shell does not expand
-    # /dev/disk/by-id/{ata,cciss,scsi,usb}* correctly,
-    # so manually enumerate them
-    for d in $(ls /dev/disk/by-id/ata* /dev/disk/by-id/cciss* /dev/disk/by-id/scsi* /dev/disk/by-id/usb* 2>/dev/null); do
-        DEVTYPE=
-        eval $(udev_info $(readlink -f $d) property "--export")
-        # ID_FS_USAGE is set for partitions
-        if [ "$DEVTYPE" = "disk" -a "$ID_BUS" = "$bus" ]; then
-            if [ -z "$serial" -o "$serial" = "ALL" \
-                -o "$ID_SERIAL" = "$serial" ]; then
-                local dev="$(readlink -e $d)"
-                if [ -n "$live" -a  "$dev" = "/dev/$live" ]; then
-                # cannot install LiveOS over itself
-                    continue
-                elif [ "$serial" = "ALL" ]; then
-                    if [ "$found" ]; then
-                        echo -n "${SEP}"
-                    fi
-                    echo -n "$dev"
-                    found="yes"
-                    continue
-                else
-                    echo -n "$dev"
-                    found="yes"
-                    break
-                fi
-            fi
-        fi
-    done
-    if [ "$found" ]; then
-      echo
-      return 0
-    else
-       return 1
-    fi
-}
-
-# parse_disk_id DISK_ID
-#   DISK_ID=[ata|cciss|scsi|usb[:serial#]|/dev/...]
-# ata|cciss|scsi|usb - select disk bus, as reported by udev ID_BUS
-# serial# - select exact disk using serial number, as reported by
-#           udev ID_SERIAL
-# e.g. storage_init=usb:Generic_STORAGE_DEVICE_0000145418-0:0
-#           ALL selects all the disks on the specified bus
-# e.g. storage_init=ata:ALL
-#
-# /dev/... - use specified disk device
-#            (for cases when HAL doesn't handle it)
-parse_disk_id() {
-    local i="$1"
-    local disk=
-    local bus=
-    local serial=
-    case "$i" in
-        ata*)
-            bus=ata
-            i=${i#ata}
-            serial=${i#:}
-        ;;
-        scsi*)
-            bus=scsi
-            i=${i#scsi}
-            serial=${i#:}
-        ;;
-        usb*)
-            bus=usb
-            i=${i#usb}
-            serial=${i#:}
-        ;;
-        cciss*)
-            bus=cciss
-            i=${i#cciss}
-            serial=${i#:}
-        ;;
-        /dev/*)
-            disk="$(ls -1 $i 2>/dev/null | head -n1)"
-        ;;
-    esac
-    if [ -n "$bus" ]; then
-        disk=$(find_disk $bus $serial)
-    fi
-    echo "$disk"
-}
-
-
-# execute a function if called as a script, e.g.
-#   ovirt-boot-functions ovirt_store_config /etc/hosts
-
-if [ "$(basename -- "$0")" = "ovirt-boot-functions" ]; then
-    "$@"
-fi
 
+++ /dev/null
-#!/bin/bash
-#
-# ovirt-config-boot - configure local boot/root disk partitions
-
-# SYNOPSIS
-# ovirt-config-boot livecd_path bootparams reboot
-#
-#       livecd_path - where livecd media is mounted,
-#                     parent of LiveOS and isolinux folders
-#                     default is /live
-#
-#       bootparams  - extra boot parameters like console=...
-#                     default is $OVIRT_BOOTPARAMS
-#
-#       reboot      - reboot after install
-#                     default is yes
-
-# Source functions library
-. /etc/init.d/functions
-. /usr/libexec/ovirt-functions
-
-trap '__st=$?; stop_log; exit $__st' 0
-trap 'exit $?' 1 2 13 15
-
-ovirt_boot_setup() {
-    local live=$1
-    local bootparams=$2
-    local disk
-    local disk2
-    local partN=-1
-    log "installing the image."
-
-    if [ "$OVIRT_ROOT_INSTALL" = "n" ]; then
-        log "done."
-        return
-    fi
-
-    if [ -e "$live/syslinux" ]; then
-      syslinux=syslinux
-    elif [ -e "$live/isolinux" ]; then
-      syslinux=isolinux
-    else
-      syslinux=
-    fi
-
-    if [ ! -e "$live/LiveOS/squashfs.img" \
-      -o ! -e "$live/$syslinux/version" ]; then
-      log "source image not valid."
-      return 1
-    fi
-    . /etc/default/version
-    local current_version=$VERSION
-    local current_major=$(echo $VERSION|cut -d. -f1)
-    # image version
-    . $live/$syslinux/version
-    local new_major=$(echo $VERSION|cut -d. -f1)
-    # only N.x -> N.y upgrades are allowed
-    if [ "$current_major" != "$new_major" ]; then
-      log_error "cannot upgrade from $current_version to $VERSION."
-      return 1
-    fi
-
-    grub_dev="$(findfs LABEL=Boot 2>&1)"
-    if [ $? -eq 0 ]; then
-        # minimal boot partition for iscsi root
-        mount "$grub_dev" /boot
-        mountpoint /boot > /dev/null
-        if [ $? -ne 0 ] ; then
-            log_error "Boot partition not available"
-            return 1
-        fi
-        # Grab OVIRT_ISCSI VARIABLES from boot partition for upgrading
-        # file created only if OVIRT_ISCSI_ENABLED=y
-        if [ -f /boot/ovirt ]; then
-            . /boot/ovirt
-            iscsiadm -p $OVIRT_ISCSI_TARGET_IP:$OVIRT_ISCSI_TARGET_PORT -m discovery -t sendtargets
-            log "Restarting iscsi service"
-            service iscsi restart
-        fi
-    fi
-
-    local oldtitle
-    if [ "$OVIRT_ISCSI_ENABLED" != "y" ]; then
-        # get title for the current Root
-        /sbin/dmsetup mknodes
-        if [ $? -ne 0 ] ; then
-          log_error "Could not create DM links"
-          return 1
-        fi
-        mount -r LABEL=Root /liveos
-        mountpoint /liveos > /dev/null
-        if [ $? -ne 0 ] ; then
-          log_error "Root partition not available"
-          return 1
-        fi
-
-        initrd_dest="/liveos"
-        grub_dir="/liveos/grub"
-        grub_prefix="/grub"
-
-        if [ -e "$initrd_dest/vmlinuz0" -a -e "$initrd_dest/initrd0.img" ]; then
-            oldtitle="BACKUP $(grep ^title ${grub_dir}/grub.conf|head -n1|cut -c7-)"
-        fi
-        umount /liveos
-
-        # prepare Root partition update
-        rc=1
-        candidate_dev="$(findfs LABEL=RootBackup 2>/dev/null)"
-        if [ $? -eq 0 ]; then
-            e2label "$candidate_dev" RootNew
-            rc=$?
-        else
-            candidate_dev="$(findfs LABEL=RootUpdate 2>/dev/null)"
-            if [ $? -eq 0 ]; then
-                e2label "$candidate_dev" RootNew
-                rc=$?
-            else
-                candidate_dev="$(findfs LABEL=RootNew 2>/dev/null)"
-                rc=$?
-                umount /liveos ||:
-            fi
-        fi
-        if [ $rc -ne 0 ]; then
-            log_error "root partition not available."
-            log_error "$(ls -al /dev/disk/by-label)"
-            return $rc
-        fi
-
-        mount "$candidate_dev" /liveos
-
-        rm -rf /liveos/LiveOS
-        mkdir -p /liveos/LiveOS
-        grub_dev="$candidate_dev"
-
-    else
-        initrd_dest="/boot"
-        grub_dir="/boot/grub"
-        grub_prefix="/grub"
-        oldtitle=
-    fi
-
-    # find partition number for GRUB, $4 is to allow 0 as a partition number for grub
-    get_part_info "$(readlink -f "$grub_dev")" disk partN y
-    rc=$?
-    if [ $rc -ne 0 -o "$partN" -lt 0 ]; then
-      log_error "unable to determine Root partition"
-      return 1
-    fi
-
-    cp -p $live/$syslinux/version /liveos
-    rc=$?
-    if [ $rc -ne 0 ]; then
-        log_error "version details copy failed."
-        return $rc
-    fi
-
-    cp -p $live/$syslinux/vmlinuz0 $initrd_dest \
-    && cp -p $live/$syslinux/initrd0.img $initrd_dest
-    rc=$?
-    if [ $rc -ne 0 ]; then
-        log_error "kernel image copy failed."
-        return $rc
-    fi
-
-    if [ "$OVIRT_ISCSI_ENABLED" != "y" ]; then
-        cp -p $live/LiveOS/squashfs.img /liveos/LiveOS
-        rc=$?
-        if [ $rc -ne 0 ]; then
-            log_error "squashfs image copy failed."
-            return $rc
-        fi
-    fi
-
-    if [ "$OVIRT_ISCSI_ENABLED" = "y" ]; then
-        root_part="root=LABEL=ovirt-node-root"
-        bootparams="ro rootfstype=ext2 rootflags=ro $bootparams \
-                    netroot=iscsi:$OVIRT_ISCSI_TARGET_IP::$OVIRT_ISCSI_TARGET_PORT::$OVIRT_ISCSI_NODE_NAME ip=eth0:dhcp"
-    else
-        root_part="root=live:LABEL=Root"
-        bootparams="ro rootfstype=ext2 rootflags=ro $bootparams"
-    fi
-    mkdir -p $grub_dir
-    mkdir -p $grub_dir/efi
-    mount LABEL=EFI $grub_dir/efi
-    cp -ra /boot/efi/* $grub_dir/efi
-    umount $grub_dir/efi
-    cat > $grub_dir/grub.conf << EOF
-default saved
-timeout 5
-hiddenmenu
-title $PRODUCT (${VERSION}-${RELEASE})
-    root (hd0,$partN)
-    kernel /vmlinuz0 $root_part $bootparams
-    initrd /initrd0.img
-EOF
-    local backup_entry=0
-    if [ -n "$oldtitle" ]; then
-        local partB
-        partB=0
-        if [ $partN = '0' ]; then
-            partB='1'
-        fi
-        cat >> $grub_dir/grub.conf << EOF
-title ${oldtitle}
-    root (hd0,$partB)
-    kernel /vmlinuz0 root=live:LABEL=RootBackup $bootparams
-    initrd /initrd0.img
-    savedefault
-EOF
-        backup_entry=1
-    fi
-    if echo "$disk" | grep -q " " ; then
-        # workaround for grub setup failing with spaces in dev.name
-        disk2=$(multipath -l "$disk" | awk '/ active / {print $3}')
-        if [ -n "$disk2" ]; then
-            disk="/dev/$disk2"
-            # flush to sync DM and blockdev, workaround from rhbz#623846#c14
-            echo 3 > /proc/sys/vm/drop_caches
-            partprobe "$disk"
-        fi
-    fi
-    echo "(hd0) $disk" > $grub_dir/device.map
-    ( cd /usr/share/grub/*; cp -p stage? e2fs_stage1_5 $grub_dir )
-    # grub setup will do direct changes
-    sync
-    grub --device-map=$grub_dir/device.map <<EOF
-root (hd0,$partN)
-setup --prefix=$grub_prefix (hd0)
-EOF
-    rc=$?
-    if [ $rc -ne 0 ]; then
-        log_error "boot loader install failed."
-        return $rc
-    fi
-
-    if [ "$OVIRT_ISCSI_ENABLED" != "y" ]; then
-        umount /liveos
-        rc=$?
-        if [ $rc -ne 0 ]; then
-            log_error "umount /liveos failed."
-            return $rc
-        fi
-        # mark new Root ready to go, reboot() in ovirt-function switches it to active
-        e2label "$candidate_dev" RootUpdate
-        mount "$candidate_dev" /liveos
-        ln -snf /liveos/grub /boot/grub
-        grub <<EOF_SAVEDEFAULT
-savedefault --default=$backup_entry
-savedefault --default=0 --once
-EOF_SAVEDEFAULT
-        umount /liveos
-    fi
-
-    if [ "$OVIRT_ISCSI_ENABLED" = "y" ]; then
-        # copy defaults for when Root/HostVG is inaccessible(iscsi upgrade)
-        cp $OVIRT_DEFAULTS /boot
-    fi
-
-    log "done."
-}
-
-live=$1
-bootparams=$2
-doreboot=$3
-if [ -z "$live" -o "$live" = "-h" -o "$live" = "--help" ]; then
-    cat <<EOF
-Usage: $0 [livecd_path] [bootparams] [reboot(yes/no)]
-       livecd_path - where livecd media is mounted,
-                     parent of LiveOS and isolinux folders
-                     default is /live
-
-       bootparams  - extra boot parameters like console=...
-                     default is "$OVIRT_BOOTPARAMS"
-
-       reboot      - reboot after install
-                     default is yes
-EOF
-    exit 1
-fi
-
-if ! is_local_storage_configured; then
-    printf "\nLocal storage must be configured prior to installing \n"
-    exit 99
-fi
-
-if [ -z "$bootparams" ]; then
-    bootparams="$OVIRT_BOOTPARAMS"
-fi
-if [ -z "$doreboot" ]; then
-    doreboot="yes"
-fi
-
-start_log
-if [ "$OVIRT_ROOT_INSTALL" = "n" ]; then
-    log "done."
-    return
-else
-    ovirt_boot_setup "$live" "$bootparams"
-fi
-rc=$?
-if [ $rc -eq 0 -a "$doreboot" = "yes" ]; then
-    disable_firstboot
-    if [ "$OVIRT_ISCSI_ENABLED" != "y" ]; then
-        ovirt_store_firstboot_config
-    fi
-    stop_log
-
-    reboot
-fi
-stop_log
-exit $rc
 
+++ /dev/null
-#!/bin/bash
-#
-# Configures the collectd daemon.
-# Source functions library
-. /etc/init.d/functions
-. /usr/libexec/ovirt-functions
-
-trap '__st=$?; stop_log; exit $__st' 0
-trap 'exit $?' 1 2 13 15
-
-collectd_conf="/etc/collectd.conf"
-
-# Creates the collectd file based on the following inputs
-# $1 ipaddress of remote collectd server
-# $2 port of remote collectd server
-# TODO implement and use Augeas lens
-ovirt_collectd() {
-    local collectd_server=$1
-    local collectd_port=$2
-
-    start_log
-    if [ -f $collectd_conf.in ]; then
-        sed -e "s/@COLLECTD_SERVER@/$collectd_server/" \
-            -e "s/@COLLECTD_PORT@/$collectd_port/" $collectd_conf.in \
-            > $collectd_conf
-        if [ $? -ne 0 ]; then
-            echo "Failed to write $collectd_conf"; return 1
-        fi
-    fi
-
-    chkconfig collectd on
-    service collectd restart
-    stop_log
-}
-
-prompt_user() {
-    while true ; do
-        collectd_server_ip=""
-        collectd_server_port=""
-
-        read -p "Please enter the IP address for the collectd server: "
-        if [ -n "$REPLY" ]; then
-            collectd_server_ip=$REPLY
-            while true; do
-                read -p "Please enter the collectd port used: "
-                r=$REPLY
-                if [ -n "$r" ]; then
-                    if [[ $r =~ ^[0-9]+$ ]] && [[ $r -gt 0 ]]; then
-                           collectd_server_port=$REPLY
-                           break
-                    else
-                        printf "Invalid port.\n"
-                    fi
-                fi
-            done
-        else
-            printf "\nDisabling remote collectd.\n"
-        fi
-
-        printf "\n"
-        printf "\nCollectd will be configured as follows:"
-        printf "\n======================================"
-        if [ -n "$collectd_server_ip" ]; then
-            printf "\n    Remote Server: $collectd_server_ip"
-            printf "\n      Remote Port: $collectd_server_port"
-        fi
-        printf "\n"
-        printf "\n"
-        while true; do
-            ask_yes_or_no "Is this correct ([Y]es/[N]o/[A]bort)?" true true
-            rc=$?
-            case $rc in
-                0)
-                    printf "\nSaving configuration.\n"
-                    if [[ -n "$collectd_server_ip" ]] &&
-                        [[ -n "$collectd_server_port" ]]; then
-                        ovirt_collectd $collectd_server_ip \
-                            $collectd_server_port
-                    fi
-                    return
-                    ;;
-
-                1)
-                    printf "\nRestarting collectd configuration.\n"
-                    break
-                    ;;
-                2)
-                    printf "\nAborting collectd configuration.\n"
-                    return
-                    ;;
-            esac
-        done
-    done
-}
-
-# AUTO for auto-install
-if [ "$1" = "AUTO" ]; then
-    if [ -z "$OVIRT_COLLECTD_SERVER" -o -z "$OVIRT_COLLECTD_PORT" ]; then
-        printf "\nAttempting to locate remote collectd server..."
-        find_srv collectd udp
-        if [ -n "$SRV_HOST" -a -n "$SRV_PORT" ]; then
-            printf "found! Using collectd server '$SRV_HOST:$SRV_PORT'.\n"
-            ovirt_collectd $SRV_HOST $SRV_PORT
-        else
-            printf "not found!\n"
-        fi
-    else
-        printf "\nUsing default collectd server '$OVIRT_COLLECTD_SERVER:$OVIRT_COLLECTD_PORT'.\n"
-        ovirt_collectd $OVIRT_COLLECTD_SERVER $OVIRT_COLLECTD_PORT
-    fi
-else
-    printf "\n\n Collectd Configuration\n\n"
-    prompt_user
-fi
 
+++ /dev/null
-#!/bin/bash
-#
-# Configures the hostname file based on kernel cmdline or user prompt
-# Source functions library
-. /etc/init.d/functions
-. /usr/libexec/ovirt-functions
-
-trap '__st=$?; stop_log; exit $__st' 0
-trap 'exit $?' 1 2 13 15
-
-warn() { printf '%s\n' "$*" >&2; }
-
-if ! is_local_storage_configured; then
-    warn "Local storage must be configured prior to setting the hostname."
-    exit 99
-fi
-
-HOSTNAME_FILE="/etc/sysconfig/network"
-
-function set_hostname {
-    start_log
-    augtool <<EOF
-set /files$HOSTNAME_FILE/HOSTNAME "$1"
-EOF
-    rc=$?
-    if [ $rc = 0 ]; then
-        /bin/hostname "$1"
-        rc=$?
-        if [ $rc -eq 0 ]; then /usr/sbin/persist $HOSTNAME_FILE; fi
-    fi
-    stop_log
-    return $rc
-}
-
-function remove_hostname {
-    start_log
-    augtool <<EOF
-rm /files$HOSTNAME_FILE/HOSTNAME
-EOF
-    rc=$?
-    stop_log
-    return $rc
-}
-
-is_valid_hostname () {
-    local host=${1}
-    local result=1
-    if [[ $host =~ ^([a-zA-Z0-9._-]+)$ ]]; then
-        result=$?
-    fi
-    return $result
-}
-
-function prompt_user {
-  rc=0
-  while true; do
-    printf "\n"
-    read -p "What is the hostname for this node? "
-
-    if [ -n "$REPLY" ]; then
-        if ! is_valid_hostname "$REPLY"; then
-            printf "\nInvalid Hostname\n"
-            continue
-        fi
-        if set_hostname $REPLY; then
-            printf "\nHostname has been set\n"
-        else
-            printf "\nSetting hostname failed\n"
-            rc=1
-        fi
-    else
-        printf "\n"
-        ask_yes_or_no "Blank out the hostnames ([Y]es/[N]o)?"
-        case $? in
-            0)
-                if remove_hostname; then
-                    printf "\nHostname was removed.\n"
-                else
-                    printf "\nRemoving hostname failed\n"
-                    rc=1
-                fi
-                ;;
-            1)
-                printf "\nNo changes made.\n"
-                ;;
-        esac
-    fi
-    break
-  done
-  return $rc
-}
-
-# AUTO for auto-install
-if [ "$1" = "AUTO" ]; then
-    if [ -n "$OVIRT_HOSTNAME" ]; then
-        if set_hostname $OVIRT_HOSTNAME; then
-            printf "\nHostname has been set\n"
-        else
-            printf "\nSetting hostname failed\n"
-        fi
-    else
-        printf "\nHostname not provided. Skipping.\n"
-    fi
-else
-    printf "\n\n Hostname Configuration\n\n"
-    prompt_user
-fi
 
+++ /dev/null
-#!/usr/bin/python
-# ovirt-config-installer - Copyright (C) 2010 Red Hat, Inc.
-# Written by Joey Boggs <
[email protected]>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-from snack import *
-import ovirtnode.password as password
-from ovirtnode.install import *
-import ovirtnode.storage as storage
-from ovirtnode.ovirtfunctions import *
-import _snack
-import traceback
-import os
-import dbus
-import fcntl
-import gudev
-import PAM
-import rpm
-
-QUIT_BUTTON = "Quit"
-BACK_BUTTON = "Back"
-NEXT_BUTTON = "Next"
-FINISH_BUTTON = "Finish"
-INSTALL_BUTTON = "Install"
-REBOOT_BUTTON = "Reboot"
-POWEROFF_BUTTON = "Power Off"
-CONTINUE_BUTTON = "Continue"
-SHELL_BUTTON = "Drop To Shell"
-
-WELCOME_PAGE = 1
-ROOT_STORAGE_PAGE = 3
-OTHER_DEVICE_ROOT_PAGE = 4
-HOSTVG_STORAGE_PAGE = 5
-OTHER_DEVICE_HOSTVG_PAGE = 6
-PASSWORD_PAGE = 7
-UPGRADE_PAGE = 9
-FAILED_PAGE = 11
-FINISHED_PAGE = 13
-current_password = ""
-
-def pam_conv(auth, query_list):
-    global current_password
-    resp = []
-    for i in range(len(query_list)):
-        resp.append((current_password, 0))
-    return resp
-
-class NodeInstallScreen:
-    def __init__(self, colorset = None):
-        self.__current_page = 1
-        self.__finished = False
-        self.ovirt_defaults_file = "/etc/default/ovirt"
-        OVIRT_VARS = parse_defaults()
-        _colorset = {
-                        "ROOT"          : ("gray",  "magenta"),
-                        "BORDER"        : ("magenta", "magenta"),
-                        "WINDOW"        : ("magenta", "magenta"),
-                        "ACTBUTTON"     : ("blue",  "white"),
-                        "BUTTON"        : ("blue",  "white"),
-                        "COMPACTBUTTON" : ("black", "magenta"),
-                        "LISTBOX"       : ("green",  "red"),
-                        "ACTLISTBOX"    : ("blue", "white"),
-                        "ACTSELLISTBOX" : ("blue",  "white"),
-                        "TEXTBOX"       : ("cyan",  "magenta"),
-                        "ENTRY"         : ("cyan", "magenta"),
-                        "SHADOW"        : ("magenta",  "magenta"),
-                        "LABEL"         : ("brown",  "magenta"),
-                        "TITLE"         : ("white",  "blue"),
-                        "HELPLINE"      : ("cyan",  "magenta"),
-                        "EMPTYSCALE"    : ("white",  "cyan"),
-                        "FULLSCALE"     : ("cyan",  "white"),
-                        "CHECKBOX"      : ("black",  "red"),
-                        "ROOTTEXT"      : ("white",  "blue"),
-                         }
-        self.__colorset = _colorset
-        self.dev_name = ""
-        self.dev_model = ""
-        self.dev_bus = ""
-        self.dev_serial = ""
-        self.dev_size = ""
-        self.dev_desc = ""
-        self.current_password_fail = 0
-        self.failed_block_dev = 0
-        self.live_disk = "/dev/" + get_live_disk().rstrip('0123456789')
-        logger.info("::::live device::::\n" + self.live_disk)
-    def set_console_colors(self):
-        self.existing_color_array = None
-        tty_file = None
-        try:
-          tty_file = open("/dev/tty", "rw")
-        except:
-          pass
-        if tty_file == None:
-          tty_file = open("/dev/console", "rw")
-        try:
-          self._set_colors(tty_file)
-        except:
-            pass
-        finally:
-            tty_file.close()
-
-    def _set_colors(self, tty_file):
-        GIO_CMAP = 0x4B70
-        PIO_CMAP = 0x4B71
-        self.existing_color_array = bytearray(fcntl.ioctl(tty_file.fileno(), GIO_CMAP, b"\x00" * 48))
-        color_array = self.existing_color_array
-        color_array[3] = 0xde
-        color_array[4] = 0xde
-        color_array[5] = 0xde
-        color_array[6] = 0x30
-        color_array[7] = 0x30
-        color_array[8] = 0x30
-        color_array[9] = 0x52
-        color_array[10] = 0x52
-        color_array[11] = 0x52
-        color_array[12] = 0x00
-        color_array[13] = 0xbb
-        color_array[14] = 0xff
-        color_array[15] = 0xea
-        color_array[16] = 0xea
-        color_array[17] = 0xea
-        color_array[18] = 0x71
-        color_array[19] = 0x71
-        color_array[20] = 0x71
-        color_array[21] = 0xff
-        color_array[22] = 0xff
-        color_array[23] = 0xff
-        fcntl.ioctl(tty_file.fileno(), PIO_CMAP, bytes(color_array))
-
-    def restore_console_colors(self):
-        if self.existing_color_array == None:
-          return
-        tty_file = None
-        try:
-          tty_file = open("/dev/tty", "rw")
-        except:
-          pass
-        if tty_file == None:
-          tty_file = open("/dev/console", "rw")
-        try:
-            self._restore_colors(tty_file)
-        except:
-            pass
-        finally:
-            tty_file.close()
-
-    def _restore_colors(self, tty_file):
-        GIO_CMAP = 0x4B70
-        PIO_CMAP = 0x4B71
-        fcntl.ioctl(tty_file.fileno(), PIO_CMAP, bytes(self.existing_color_array))
-
-    def reset_screen_colors(self):
-        for item in self.__colorset.keys():
-            colors = self.__colorset.get(item)
-            self.screen.setColor(item, colors[0], colors[1])
-
-    def password_check_callback(self):
-        self.valid_password, msg = password_check(self.root_password_1.value(), self.root_password_2.value())
-        if self.current_password_fail == 0:
-            self.pw_msg.setText(msg)
-        return
-
-    def current_password_callback(self):
-        auth = PAM.pam()
-        auth.start("passwd")
-        auth.set_item(PAM.PAM_USER, "admin")
-        global current_password
-        current_password = self.current_password.value()
-        auth.set_item(PAM.PAM_CONV, pam_conv)
-        if self.current_password.value() != "":
-            try:
-                auth.authenticate()
-            except PAM.error, (resp, code):
-                logger.error(resp)
-                self.current_password_fail = 1
-                self.pw_msg.setText("Current Password Invalid")
-                return False
-            except:
-                logger.error("Internal error")
-                return False
-            else:
-                self.current_password_fail = 0
-                self.pw_msg.setText(" ")
-                return True
-
-    def other_device_root_callback(self):
-        ret = os.system("test -b " + self.root_device.value())
-        if ret != 0:
-            self.screen.setColor("BUTTON", "black", "red")
-            self.screen.setColor("ACTBUTTON", "blue", "white")
-            ButtonChoiceWindow(self.screen, "Storage Check", "Invalid Block Device", buttons = ['Ok'])
-            self.reset_screen_colors()
-            self.failed_block_dev = 1
-        else:
-            self.failed_block_dev = 0
-        return
-
-    def other_device_hostvg_callback(self):
-        for dev in self.hostvg_device.value().split(","):
-            ret = os.system("test -b " + dev)
-            if ret != 0:
-                self.screen.setColor("BUTTON", "black", "red")
-                self.screen.setColor("ACTBUTTON", "blue", "white")
-                ButtonChoiceWindow(self.screen, "Storage Check", "Invalid Block Device: " + dev, buttons = ['Ok'])
-            self.reset_screen_colors()
-            self.failed_block_dev = 1
-        else:
-            self.failed_block_dev = 0
-        return
-
-    def menuSpacing(self):
-        menu_option = self.menu_list.current()
-        if self.menuo < self.menu_list.current():
-            if menu_option == 2:
-                try:
-                    self.menu_list.setCurrent(3)
-                    self.menuo = 3
-                except:
-                    try:
-                        self.menu_list.setCurrent(5)
-                        self.menuo = 5
-                    except:
-                        self.menu_list.setCurrent(1)
-                        self.menuo = 1
-            if menu_option == 4:
-                self.menu_list.setCurrent(5)
-                self.menuo = 5
-            if menu_option == 6:
-                self.menu_list.setCurrent(7)
-                self.menuo = 7
-            if menu_option == 8:
-                self.menu_list.setCurrent(9)
-                self.menuo = 9
-            if menu_option == 10:
-                self.menu_list.setCurrent(11)
-                self.menuo = 11
-            if menu_option == 10:
-                self.menu_list.setCurrent(11)
-                self.menuo = 11
-            # prevent going further down list
-            if menu_option == 12:
-                self.menu_list.setCurrent(11)
-                self.menuo = 11
-        elif self.menuo > self.menu_list.current():
-            if menu_option == 10:
-                self.menu_list.setCurrent(9)
-                self.menuo = 9
-            if menu_option == 8:
-                self.menu_list.setCurrent(7)
-                self.menuo = 7
-            if menu_option == 6:
-                self.menu_list.setCurrent(5)
-                self.menuo = 5
-            if menu_option == 4:
-                self.menu_list.setCurrent(3)
-                self.menuo = 3
-            if menu_option == 2:
-                self.menu_list.setCurrent(1)
-                self.menuo = 1
-
-    def get_back_page(self):
-        if self.__current_page == ROOT_STORAGE_PAGE:
-            self.__current_page = WELCOME_PAGE
-        elif self.__current_page == OTHER_DEVICE_ROOT_PAGE:
-            self.__current_page = ROOT_STORAGE_PAGE
-        elif self.__current_page == OTHER_DEVICE_HOSTVG_PAGE:
-            self.__current_page = HOSTVG_STORAGE_PAGE
-        elif self.__current_page == HOSTVG_STORAGE_PAGE:
-            self.__current_page = ROOT_STORAGE_PAGE
-        elif self.__current_page == PASSWORD_PAGE:
-            self.__current_page = HOSTVG_STORAGE_PAGE
-        elif self.__current_page == UPGRADE_PAGE:
-            self.__current_page = WELCOME_PAGE
-        return
-
-    def install_page(self):
-        elements = Grid(2, 5)
-        self.menuo = 1
-        self.menu_list = Listbox(14, width = 73, returnExit = 1, border = 0, showCursor = 0, scroll = 0)
-        try:
-            m_version,m_release = get_media_version_number()
-            m_full_ver = m_version + "-" + m_release
-        finally:
-            if os.path.exists("/dev/HostVG"):
-                if not os.path.exists("/dev/disk/by-label/ROOT"):
-                    try:
-                        e_version, e_release = get_installed_version_number()
-                        e_full_ver = e_version + "-" + e_release
-                        compare = rpm.labelCompare(('1', e_version, e_release), ('1', m_version, m_release))
-                        if compare == -1:
-                            self.menu_list.append(" Upgrade " + e_full_ver + " to " + m_full_ver, 3)
-                        elif compare == 1:
-                            self.menu_list.append(" Downgrade " + e_full_ver + " to " + m_full_ver, 3)
-                        else:
-                            self.menu_list.append(" Reinstall " + m_full_ver, 3)
-                    except:
-                        self.menu_list.append(" Invalid installation, please reboot from media and choose Reinstall", 0)
-                        logger.error("Unable to get version numbers for upgrade, invalid installation or media")
-                        pass
-                else:
-                    self.menu_list.append("Major version upgrades are unsupported, uninstall existing version first", 0)
-            else:
-                self.menu_list.append(" Install Hypervisor " + m_full_ver, 1)
-            self.menu_list.setCallback(self.menuSpacing)
-        elements.setField(self.menu_list, 1,1, anchorLeft = 1, padding = (0,0,0,1))
-        hwvirt_msg =  get_virt_hw_status()
-        self.hwvirt = Textbox(50, 2, hwvirt_msg, wrap = 1)
-        elements.setField(self.hwvirt, 1, 2, anchorLeft = 1, padding=(0,0,0,0))
-        return [Label(""), elements]
-
-    def finish_install_page(self):
-        elements = Grid(2, 5)
-        elements.setField(Label("%s Installation Finished Successfully" %
-            PRODUCT_SHORT), 0, 0,padding=(20,5,0,1))
-        elements.setField(Label(" "), 0, 1)
-        return [Label(""), elements]
-
-    def failed_install_page(self):
-        os.system("cat " + OVIRT_TMP_LOGFILE + ">> " + OVIRT_LOGFILE)
-        elements = Grid(2, 5)
-        elements.setField(Label("%s Installation Failed " %
-            PRODUCT_SHORT), 0, 0)
-        elements.setField(Label(" View Log Files "), 0, 1, anchorLeft = 1, padding = (0,1,0,0))
-        self.log_menu_list = Listbox(3, width = 30, returnExit = 1, border = 0, showCursor = 0, scroll = 0)
-        if os.path.exists("/var/log/ovirt.log"):
-            self.log_menu_list.append(" /var/log/ovirt.log", "/var/log/ovirt.log")
-        if os.path.exists("/tmp/ovirt.log"):
-            self.log_menu_list.append(" /tmp/ovirt.log", "/tmp/ovirt.log")
-        self.log_menu_list.append(" /var/log/messages", "/var/log/messages")
-        elements.setField(self.log_menu_list, 0, 2, anchorLeft = 1, padding = (0,0,0,12))
-        return [Label(""), elements]
-
-    def disk_details_callback(self):
-        if self.__current_page == ROOT_STORAGE_PAGE:
-            dev = self.root_disk_menu_list.current()
-        elif self.__current_page == HOSTVG_STORAGE_PAGE:
-            dev = self.hostvg_checkbox.getCurrent()
-        if "Location" in dev or "NoDevices" in dev:
-            blank_entry = ",,,,,"
-            dev_bus,dev_name,dev_size,dev_desc,dev_serial,dev_model = blank_entry.split(",",5)
-        else:
-            dev = translate_multipath_device(dev)
-            dev_bus,dev_name,dev_size,dev_desc,dev_serial,dev_model = self.disk_dict[dev].split(",",5)
-        self.dev_bus_label.setText(dev_bus)
-        dev_name = dev_name.replace(" ","")
-        self.dev_name_label.setText(dev_name)
-        self.dev_size_label.setText(dev_size + "GB")
-        self.dev_desc_label.setText(dev_desc)
-        self.dev_serial_label.setText(dev_serial)
-        self.dev_model_label.setText(dev_model)
-        return
-    def root_disk_page(self):
-        elements = Grid(2, 9)
-        self.root_disk_menu_list = Listbox(5, width = 70, returnExit = 0, border = 0, scroll = 1)
-        self.root_disk_menu_list.setCallback(self.disk_details_callback)
-        Storage = storage.Storage()
-        dev_names, self.disk_dict = Storage.get_udev_devices()
-        self.displayed_disks = {}
-        self.valid_disks = []
-        for dev in dev_names:
-            dev = translate_multipath_device(dev)
-            if not self.displayed_disks.has_key(dev):
-                if self.disk_dict.has_key(dev) and dev != self.live_disk:
-                    dev_bus,dev_name,dev_size,dev_desc,dev_serial,dev_model = self.disk_dict[dev].split(",",5)
-                    dev_desc = pad_or_trim(33, dev_desc)
-                    self.valid_disks.append(dev_name)
-                    dev_name = os.path.basename(dev_name).replace(" ", "")
-                    dev_name = pad_or_trim(33, dev_name)
-                    dev_entry = " %6s  %11s  %5s GB" % (dev_bus,dev_name, dev_size)
-                    dev_name = translate_multipath_device(dev_name)
-                    self.root_disk_menu_list.append(dev_entry, dev)
-                    self.valid_disks.append(dev_name)
-                    self.displayed_disks[dev] = ""
-        if len(self.valid_disks) == 0:
-            self.root_disk_menu_list.append(" No Valid Install Devices Detected", "NoDevices")
-            self.disk_dict["NoDevices"] = ",,,,,"
-            dev_bus,dev_name,dev_size,dev_desc,dev_serial,dev_model = self.disk_dict["NoDevices"].split(",",5)
-        else:
-            dev_bus,dev_name,dev_size,dev_desc,dev_serial,dev_model = self.disk_dict[self.valid_disks[0]].split(",",5)
-        self.root_disk_menu_list.append(" Other Device", "OtherDevice")
-        self.disk_dict["OtherDevice"] = ",,,,,"
-        elements.setField(Label("Please select the disk to use for booting %s"
-            % PRODUCT_SHORT), 0,1, anchorLeft = 1)
-        elements.setField(Label(" "), 0,2, anchorLeft = 1)
-        elements.setField(Label(" Location              Device Name                           Size"),0,3,anchorLeft =1)
-        elements.setField(self.root_disk_menu_list, 0,4)
-        disk_grid = Grid(5,8)
-        elements.setField(Label("Disk Details"), 0,5, anchorLeft = 1)
-        elements.setField(Label(" "), 0,6)
-        disk_grid.setField(Label("Device       "),0, 0, anchorLeft = 1)
-        disk_grid.setField(Label("Model        "),0, 1, anchorLeft = 1)
-        disk_grid.setField(Label("Bus Type     "),0, 2, anchorLeft = 1)
-        disk_grid.setField(Label("Serial       "),0, 3, anchorLeft = 1)
-        disk_grid.setField(Label("Size         "),0, 4, anchorLeft = 1)
-        disk_grid.setField(Label("Description  "),0, 5, anchorLeft = 1)
-        dev_name = dev_name.replace(" ", "")
-        self.dev_name_label = Label(dev_name)
-        self.dev_model_label = Label(dev_model)
-        self.dev_bus_label = Label(dev_bus)
-        self.dev_serial_label = Label(dev_serial)
-        self.dev_size_label = Label(dev_size + "GB")
-        self.dev_desc_label = Label(dev_desc)
-        disk_grid.setField(self.dev_name_label,1, 0, anchorLeft = 1)
-        disk_grid.setField(self.dev_model_label,1, 1, anchorLeft = 1)
-        disk_grid.setField(self.dev_bus_label,1, 2, anchorLeft = 1)
-        disk_grid.setField(self.dev_serial_label,1, 3, anchorLeft = 1)
-        disk_grid.setField(self.dev_size_label,1, 4, anchorLeft = 1)
-        disk_grid.setField(self.dev_desc_label,1, 5, anchorLeft = 1)
-        elements.setField(disk_grid, 0,7, anchorLeft = 1)
-        elements.setField(Label(" "), 0, 8, anchorLeft = 1)
-        return [Label(""), elements]
-
-    def hostvg_disk_page(self):
-        self.hostvg_checkbox = CheckboxTree(6, width = 73, scroll = 1)
-        self.hostvg_checkbox.setCallback(self.disk_details_callback)
-        self.hostvg_checkbox.append("    Location             Device Name                       Size", selected = 1)
-        elements = Grid(2, 9)
-        Storage = storage.Storage()
-        devs = Storage.get_dev_name()
-        dev_names = []
-        for dev in devs:
-            dev_names.append(dev)
-        dev_names.sort()
-        self.displayed_disks = {}
-        for dev in dev_names:
-            dev = translate_multipath_device(dev)
-            if not self.displayed_disks.has_key(dev) and dev != self.live_disk:
-                if self.disk_dict.has_key(dev):
-                    dev_bus,dev_name,dev_size,dev_desc,dev_serial,dev_model = self.disk_dict[dev].split(",",5)
-                    dev_desc = pad_or_trim(33, dev_desc)
-                    if dev_name == self.root_disk_menu_list.current():
-                        select_status = 1
-                    else:
-                        select_status = 0
-                    # strip all "/dev/*/" references and leave just basename
-                    dev_name = os.path.basename(dev_name).replace(" ", "")
-                    dev_name = pad_or_trim(33, dev_name)
-                    dev_entry = " %6s %10s %2s GB" % (dev_bus,dev_name, dev_size)
-                    self.hostvg_checkbox.addItem(dev_entry, (0, snackArgs['append']), item = dev, selected = select_status)
-                    self.displayed_disks[dev] = ""
-        if self.root_disk_menu_list.current() == "OtherDevice":
-            select_status = 1
-        else:
-            select_status = 0
-        self.hostvg_checkbox.addItem(" Other Device", (0, snackArgs['append']), item = "OtherDevice", selected = select_status)
-        elements.setField(Label("Please select the disk(s) to use for installation of %s" % PRODUCT_SHORT), 0,1, anchorLeft = 1)
-        elements.setField(self.hostvg_checkbox, 0,3)
-        elements.setField(Label("Disk Details"), 0,4, anchorLeft = 1, padding = (0,1,0,0))
-        elements.setField(Label(" "), 0,5)
-        disk_grid = Grid(2,8)
-        disk_grid.setField(Label("Device       "),0, 0, anchorLeft = 1)
-        disk_grid.setField(Label("Model        "),0, 1, anchorLeft = 1)
-        disk_grid.setField(Label("Bus Type     "),0, 2, anchorLeft = 1)
-        disk_grid.setField(Label("Serial       "),0, 3, anchorLeft = 1)
-        disk_grid.setField(Label("Size         "),0, 4, anchorLeft = 1)
-        disk_grid.setField(Label("Description  "),0, 5, anchorLeft = 1)
-        # get disk's info to prepopulate
-        dev_bus,dev_name,dev_size,dev_desc,dev_serial,dev_model = self.disk_dict[self.root_disk_menu_list.current()].split(",",5)
-        self.hostvg_checkbox.setCurrent(self.root_disk_menu_list.current())
-        dev_name = dev_name.replace(" ", "")
-        self.dev_name_label = Label(dev_name)
-        self.dev_model_label = Label(dev_model)
-        self.dev_bus_label = Label(dev_bus)
-        self.dev_serial_label = Label(dev_serial)
-        self.dev_size_label = Label(dev_size + "GB")
-        self.dev_desc_label = Label(dev_desc)
-        disk_grid.setField(self.dev_name_label,1, 0, anchorLeft = 1)
-        disk_grid.setField(self.dev_model_label,1, 1, anchorLeft = 1)
-        disk_grid.setField(self.dev_bus_label,1, 2, anchorLeft = 1)
-        disk_grid.setField(self.dev_serial_label,1, 3, anchorLeft = 1)
-        disk_grid.setField(self.dev_size_label,1, 4, anchorLeft = 1)
-        disk_grid.setField(self.dev_desc_label,1, 5, anchorLeft = 1)
-        elements.setField(disk_grid, 0,6, anchorLeft = 1, padding = (0,0,0,1))
-        return [Label(""), elements]
-
-    def other_device_root_page(self):
-        elements = Grid(2, 8)
-        elements.setField(Label("Please enter the disk to use for booting %s" % PRODUCT_SHORT), 0, 0, anchorLeft = 1)
-        self.root_device = Entry(35)
-        self.root_device.setCallback(self.other_device_root_callback)
-        elements.setField(self.root_device, 0,1, anchorLeft = 1, padding = (0,1,0,14))
-        return [Label(""), elements]
-
-    def other_device_hostvg_page(self):
-        elements = Grid(2, 8)
-        elements.setField(Label("Please select the disk(s) to use for installation of %s" % PRODUCT_SHORT), 0, 0, anchorLeft = 1)
-        elements.setField(Label("Enter multiple entries separated by commas"), 0, 1, anchorLeft = 1)
-        self.hostvg_device = Entry(35)
-        self.hostvg_device.setCallback(self.other_device_hostvg_callback)
-        elements.setField(self.hostvg_device, 0, 2, anchorLeft = 1, padding = (0,1,0,13))
-        return [Label(""), elements]
-
-    def password_page(self):
-        elements = Grid(2, 8)
-        pw_elements = Grid (3,3)
-        elements.setField(Label("Require a password for local console access?"), 0, 0, anchorLeft = 1)
-        elements.setField(Label(" "), 0, 1, anchorLeft = 1)
-        elements.setField(Label(" "), 0, 4)
-        pw_elements.setField(Label("Password: "), 0, 1, anchorLeft = 1)
-        pw_elements.setField(Label("Confirm Password: "), 0, 2, anchorLeft = 1)
-        self.root_password_1 = Entry(15,password = 1)
-        self.root_password_1.setCallback(self.password_check_callback)
-        self.root_password_2 = Entry(15,password = 1)
-        self.root_password_2.setCallback(self.password_check_callback)
-        pw_elements.setField(self.root_password_1, 1,1)
-        pw_elements.setField(self.root_password_2, 1,2)
-        elements.setField(pw_elements, 0, 5, anchorLeft = 1)
-        self.pw_msg = Textbox(60, 6, "", wrap=1)
-        elements.setField(self.pw_msg, 0, 6, padding = (0,1,0,5))
-        return [Label(""), elements]
-
-    def upgrade_page(self):
-        elements = Grid(2, 8)
-        pw_elements = Grid (3,8)
-        self.current_password = Entry(15,password = 1)
-        self.root_password_1 = Entry(15,password = 1)
-        self.root_password_2 = Entry(15,password = 1)
-
-        if pwd_set_check("admin"):
-            elements.setField(Label(" "), 0, 1, anchorLeft = 1)
-            elements.setField(Label("To reset password, please enter the current password "), 0, 2, anchorLeft = 1)
-            pw_elements.setField(Label("Current Password: "), 0, 1, anchorLeft = 1)
-            self.current_password.setCallback(self.current_password_callback)
-            pw_elements.setField(self.current_password, 1,1)
-        elements.setField(Label("Password for local console access"), 0, 3, anchorLeft = 1)
-        elements.setField(Label(" "), 0, 4)
-        pw_elements.setField(Label("Password: "), 0, 2, anchorLeft = 1)
-        pw_elements.setField(Label("Confirm Password: "), 0, 3, anchorLeft = 1)
-        self.root_password_1.setCallback(self.password_check_callback)
-        self.root_password_2.setCallback(self.password_check_callback)
-        pw_elements.setField(self.root_password_1, 1,2)
-        pw_elements.setField(self.root_password_2, 1,3)
-        elements.setField(pw_elements, 0, 5, anchorLeft = 1)
-        self.pw_msg = Textbox(60, 6, "", wrap=1)
-        elements.setField(self.pw_msg, 0, 6, padding = (0,1,0,3))
-        return [Label(""), elements]
-
-    def get_elements_for_page(self, screen, page):
-        if page == WELCOME_PAGE:
-            return self.install_page()
-        if page == ROOT_STORAGE_PAGE:
-            return self.root_disk_page()
-        if page == OTHER_DEVICE_ROOT_PAGE:
-            return self.other_device_root_page()
-        if page == OTHER_DEVICE_HOSTVG_PAGE:
-            return self.other_device_hostvg_page()
-        if page == HOSTVG_STORAGE_PAGE:
-            return self.hostvg_disk_page()
-        if page == PASSWORD_PAGE:
-            return self.password_page()
-        if page == FAILED_PAGE:
-            return self.failed_install_page()
-        if page == UPGRADE_PAGE:
-            return self.upgrade_page()
-        if page == FINISHED_PAGE:
-            return self.finish_install_page()
-        return []
-
-    def install_node(self):
-        self.__current_page = FAILED_PAGE
-        gridform = GridForm(self.screen, "", 2, 3)
-        dev_name = self.storage_init.replace(" ","")
-        gridform.add(Label("Partitioning and Creating File Systems On"), 0, 0)
-        gridform.add(Label(dev_name), 0, 1)
-        progress_bar = Scale(50,100)
-        progress_bar.set(25)
-        gridform.add(progress_bar, 0, 2)
-        gridform.draw()
-        self.screen.refresh()
-        config_storage = storage.Storage()
-        storage_setup = config_storage.perform_partitioning()
-        if storage_setup:
-            progress_bar.set(50)
-            gridform = GridForm(self.screen, "", 2, 2)
-            gridform.add(Label("Setting Root Password"), 0, 0)
-            gridform.add(progress_bar, 0, 1)
-            gridform.draw()
-            self.screen.refresh()
-            admin_pw_set = password.set_password(self.root_password_1.value(), "admin")
-            if admin_pw_set:
-                gridform.add(progress_bar, 0, 1)
-                gridform.draw()
-                self.screen.refresh()
-                progress_bar.set(75)
-                gridform = GridForm(self.screen, "", 2, 3)
-                gridform.add(Label("Installing Bootloader Configuration On "), 0, 0)
-                gridform.add(Label(dev_name), 0, 1)
-                gridform.add(progress_bar, 0, 2)
-                gridform.draw()
-                self.screen.refresh()
-                install = Install()
-                boot_setup = install.ovirt_boot_setup()
-                if boot_setup:
-                    progress_bar.set(100)
-                    self.__current_page = FINISHED_PAGE
-
-    def upgrade_node(self):
-        gridform = GridForm(self.screen, "", 2, 2)
-        # can also cover downgrading/reinstalling so changed to "updating"
-        gridform.add(Label("Updating Hypervisor"), 0, 0, anchorLeft = 1)
-        progress_bar = Scale(50,100)
-        progress_bar.set(75)
-        gridform.add(progress_bar, 0, 1)
-        gridform.draw()
-        self.screen.refresh()
-        admin_pw_set = password.set_password(self.root_password_1.value(), "admin")
-        if admin_pw_set:
-            install = Install()
-            boot_setup = install.ovirt_boot_setup()
-            progress_bar.set(100)
-            self.__current_page = FINISHED_PAGE
-            return
-
-    def start(self):
-        self.set_console_colors()
-        active = True
-        while active and (self.__finished == False):
-            # reread defaults every refresh
-            OVIRT_VARS = parse_defaults()
-            self.screen = SnackScreen()
-            screen = self.screen
-            for item in self.__colorset.keys():
-                colors = self.__colorset.get(item)
-                screen.setColor(item, colors[0], colors[1])
-            screen.pushHelpLine(" ")
-            PRODUCT_TITLE = "%s %s-%s" % (PRODUCT_SHORT, PRODUCT_VERSION, PRODUCT_RELEASE)
-            screen.drawRootText(1,0, "".ljust(78))
-            screen.drawRootText(1,1, "   %s" % PRODUCT_TITLE.ljust(75))
-            screen.drawRootText(1,2, "".ljust(78))
-            elements = self.get_elements_for_page(screen, self.__current_page)
-            self.gridform = GridForm(screen, "", 8, 8)
-            gridform = self.gridform
-            content = Grid(1, len(elements) + 3) # extra = button bar + padding row
-            current_element = 1
-            for element in elements:
-                # set the title of the page
-                content.setField(element, 0, current_element, anchorLeft = 1)
-                current_element += 1
-            (fullwidth, fullheight) = _snack.size()
-            current_element += 1
-            buttons = []
-            if self.__current_page == FINISHED_PAGE:
-                buttons.append(["Reboot", REBOOT_BUTTON])
-            if self.__current_page != FINISHED_PAGE:
-                buttons.append(["Quit", QUIT_BUTTON])
-            if self.__current_page != WELCOME_PAGE and self.__current_page != FAILED_PAGE and self.__current_page != FINISHED_PAGE:
-                buttons.append(["Back", BACK_BUTTON])
-            if self.__current_page == HOSTVG_STORAGE_PAGE or self.__current_page == ROOT_STORAGE_PAGE or self.__current_page == UPGRADE_PAGE:
-                buttons.append(["Continue", CONTINUE_BUTTON])
-            if self.__current_page == OTHER_DEVICE_ROOT_PAGE or self.__current_page == OTHER_DEVICE_HOSTVG_PAGE:
-                buttons.append(["Continue", CONTINUE_BUTTON])
-            if self.__current_page == PASSWORD_PAGE:
-                buttons.append(["Install", INSTALL_BUTTON])
-            if self.__current_page == FAILED_PAGE:
-                buttons.append(["Reboot", REBOOT_BUTTON])
-                buttons.append(["Power Off", POWEROFF_BUTTON])
-            buttonbar = ButtonBar(screen, buttons, compact = 1)
-            buttongrid = Grid(1,1)
-            if self.__current_page == FINISHED_PAGE:
-                buttongrid.setField(buttonbar, 0, 0, padding = (14,0,0,0))
-                buttongrid_anchor = 0
-            else:
-                buttongrid.setField(buttonbar, 0, 0, anchorLeft = 1)#, growx = 0)
-                buttongrid_anchor = 1
-
-            current_element += 1
-            gridform.add(content, 2, 0, anchorTop = 1)
-            if self.__current_page == FINISHED_PAGE:
-                gridform.add(buttongrid, 2, 1, anchorLeft = buttongrid_anchor, padding = (6,0,0,0))
-            else:
-                gridform.add(buttongrid, 2, 1, anchorLeft = buttongrid_anchor)
-            gridform.addHotKey("F2")
-            gridform.addHotKey("F3")
-            try:
-                (top, left) = (1, 4)
-                result = gridform.runOnce(top, left)
-                pressed = buttonbar.buttonPressed(result)
-                menu_choice = self.menu_list.current()
-                self.screen.setColor("BUTTON", "black", "red")
-                self.screen.setColor("ACTBUTTON", "blue", "white")
-                if result == "F2" or pressed == SHELL_BUTTON:
-                    warn = ButtonChoiceWindow(self.screen, "Support Shell", "This is for troubleshooting with support representatives. Do not use this option without guidance from support.")
-                    if warn == "ok":
-                        screen.popWindow()
-                        screen.finish()
-                        os.system("/usr/bin/clear;SHELL=/bin/bash /bin/bash")
-                elif pressed == QUIT_BUTTON:
-                    abort = ButtonChoiceWindow(self.screen, "Abort Installation","The installation of %s is not complete." %
-             PRODUCT_SHORT, buttons = ['Back','Reboot','Shutdown'])
-                    if abort == "reboot":
-                        os.system("/usr/bin/clear;reboot")
-                    elif abort == "shutdown":
-                        os.system("/usr/bin/clear;halt")
-                elif pressed == REBOOT_BUTTON:
-                    screen.finish()
-                    os.system("/usr/bin/clear;/sbin/reboot")
-                elif pressed == POWEROFF_BUTTON:
-                    os.system("/usr/bin/clear;halt")
-                elif pressed == BACK_BUTTON:
-                    self.get_back_page()
-                elif not result == "F2":
-                    if self.__current_page == WELCOME_PAGE:
-                        if menu_choice == 1:
-                            self.__current_page = ROOT_STORAGE_PAGE
-                        elif menu_choice == 3:
-                            self.__current_page = UPGRADE_PAGE
-                    elif self.__current_page == ROOT_STORAGE_PAGE:
-                            self.storage_init = self.root_disk_menu_list.current()
-                            if self.storage_init == "OtherDevice":
-                                self.__current_page = OTHER_DEVICE_ROOT_PAGE
-                            elif self.storage_init == "NoDevices":
-                                ButtonChoiceWindow(self.screen, "Root Storage Selection", "You must enter a valid device", buttons = ['Ok'])
-                                self.__current_page = ROOT_STORAGE_PAGE
-                            else:
-                                augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_INIT", '"' + self.storage_init + '"')
-                                augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_ROOT_INSTALL", '"y"')
-                                self.__current_page =  HOSTVG_STORAGE_PAGE
-                    elif self.__current_page == OTHER_DEVICE_ROOT_PAGE:
-                        if not self.root_device.value():
-                            ButtonChoiceWindow(self.screen, "Root Storage Selection", "You must enter a valid device", buttons = ['Ok'])
-                            self.__current_page == OTHER_DEVICE_ROOT_PAGE
-                        else:
-                            if self.failed_block_dev == 0:
-                                self.storage_init = translate_multipath_device(self.root_device.value())
-                                augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_INIT", '"' + self.storage_init + '"')
-                                augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_ROOT_INSTALL", '"y"')
-                                self.__current_page = HOSTVG_STORAGE_PAGE
-                            else:
-                                self.__current_page = OTHER_DEVICE_ROOT_PAGE
-                    elif self.__current_page == HOSTVG_STORAGE_PAGE:
-                        self.hostvg_init = self.hostvg_checkbox.getSelection()
-                        if not self.hostvg_checkbox.getSelection():
-                            ButtonChoiceWindow(self.screen, "HostVG Storage Selection", "You must select a HostVG device", buttons = ['Ok'])
-                            self.__current_page = HOSTVG_STORAGE_PAGE
-                        else:
-                            if "OtherDevice" in self.hostvg_init:
-                                self.__current_page = OTHER_DEVICE_HOSTVG_PAGE
-                            else:
-                                hostvg_list = ""
-                                for dev in self.hostvg_init:
-                                    hostvg_list += dev + ","
-                                augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_INIT", '"' + self.storage_init + "," + hostvg_list + '"')
-                                self.__current_page = PASSWORD_PAGE
-                                if check_existing_hostvg(""):
-                                    self.screen.setColor("BUTTON", "black", "red")
-                                    self.screen.setColor("ACTBUTTON", "blue", "white")
-                                    msg = "Existing HostVG Detected on %s, Overwrite?" % check_existing_hostvg("")
-                                    warn = ButtonChoiceWindow(self.screen, "HostVG Check", msg)
-                                    self.reset_screen_colors()
-                                    if warn != "ok":
-                                        self.__current_page = HOSTVG_STORAGE_PAGE
-                                        augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_INIT", '"' + self.storage_init + "," + hostvg_list + '"')
-                    elif self.__current_page == OTHER_DEVICE_HOSTVG_PAGE:
-                        if not self.hostvg_device.value():
-                            ButtonChoiceWindow(self.screen, "HostVG Storage Selection", "You must enter a valid device", buttons = ['Ok'])
-                        else:
-                            self.hostvg_init = translate_multipath_device(self.hostvg_device.value())
-                            hostvg_list = ""
-                            for dev in self.hostvg_init.split(","):
-                                hostvg_list += dev + ","
-                            augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_INIT", '"' + self.storage_init + "," + hostvg_list + '"')
-                            self.__current_page = PASSWORD_PAGE
-                    elif self.__current_page == UPGRADE_PAGE:
-                        if not self.current_password_fail == 1:
-                            self.upgrade_node()
-                    elif self.__current_page == PASSWORD_PAGE:
-                        if self.valid_password == 0:
-                            self.install_node()
-                        else:
-                            ButtonChoiceWindow(self.screen, "Password Check", "You must enter a valid password", buttons = ['Ok'])
-                            self.__current_page = PASSWORD_PAGE
-                    elif self.__current_page == FAILED_PAGE:
-                        f = self.log_menu_list.current()
-                        log = open(f)
-                        log = log.read()
-                        ButtonChoiceWindow(screen, "Log Viewer", log, buttons=['Ok'], width=68, x = 1, y = 6)
-
-            except Exception, error:
-                self.screen.setColor("BUTTON", "black", "red")
-                self.screen.setColor("ACTBUTTON", "blue", "white")
-                ButtonChoiceWindow(screen,
-                                   "An Exception Has Occurred",
-                                   str(error) + "\n" + traceback.format_exc(),
-                                   buttons = ["OK"])
-            screen.popWindow()
-            screen.finish()
-            self.restore_console_colors()
-
-if __name__ == "__main__":
-   screen = NodeInstallScreen()
-   screen.start()
 
+++ /dev/null
-#!/bin/bash
-#
-# Configures the hostname file based on kernel cmdline or user prompt
-# Source functions library
-. /etc/init.d/functions
-. /usr/libexec/ovirt-functions
-
-trap '__st=$?; stop_log; exit $__st' 0
-trap 'exit $?' 1 2 13 15
-
-warn() { printf '%s\n' "$*" >&2; }
-
-if ! is_local_storage_configured; then
-    warn "Local storage must be configured prior to setting the iSCSI Initiator Name."
-    exit 99
-fi
-
-INITIATOR_FILE="/etc/iscsi/initiatorname.iscsi"
-
-function prompt_user {
-    printf "\n"
-    printf "Enter iSCSI Initiator Name (If blank one will be automatically generated)\n"
-    printf "Enter Q to quit\n"
-    read REPLY
-    if [[ $REPLY == "q" || $REPLY == "Q" ]]; then
-        printf "Aborting due to user request"
-        return
-    fi
-
-    set_initiator $REPLY
-}
-
-function set_initiator {
-    if [ -z "$1" ]; then
-        INITIATOR_NAME=$(iscsi-iname)
-    else
-        INITIATOR_NAME=$1
-    fi
-
-    echo "InitiatorName=$INITIATOR_NAME" > $INITIATOR_FILE
-    ovirt_store_config $INITIATOR_FILE
-    rc=$?
-    if [ $rc = 0 ]; then
-        printf "Initiator name set as: $INITIATOR_NAME\n"
-    else
-        printf "Setting initiator name failed\n"
-    fi
-}
-
-# AUTO for auto-install
-if [ "$1" = "AUTO" ]; then
-    set_initiator $OVIRT_ISCSI_NAME
-else
-    printf "\n\n iSCSI Initiator Configuration\n\n"
-    prompt_user
-fi
 
+++ /dev/null
-#!/bin/bash
-#
-# Configure kdump
-# Source functions library
-. /etc/init.d/functions
-. /usr/libexec/ovirt-functions
-
-trap '__st=$?; stop_log; exit $__st' 0
-trap 'exit $?' 1 2 13 15
-
-warn() { printf '%s\n' "$*" >&2; }
-
-check() {
-if ! is_local_storage_configured; then
-    warn "Configure local storage before configuring kdump."
-    exit 99
-fi
-if ! network_up; then
-    warn "Configure network before configuring kdump."
-    exit 99
-fi
-}
-
-function write_kdump_config {
-    cat > /etc/kdump.conf <<EOF
-default reboot
-net $1
-EOF
-    ovirt_store_config /etc/kdump.conf
-    return 0
-}
-
-function kdump_confirm {
-
-    local server=$1
-    local server_type=$2
-
-    printf "\nkdump $server_type Configuration\n"
-    printf "\n$server_type: $server \n\n"
-        if ask_yes_or_no "Confirm these values ([Y]es/[N]o)?"; then
-            write_kdump_config $server
-            if [ $server_type = "SSH" ]; then
-                # /dev/console is occupied by firstboot, need to make /dev/tty available
-                rm -rf /dev/tty
-                ln -s /dev/console /dev/tty
-                service kdump propagate
-            fi
-            service kdump restart
-        fi
-
-}
-
-function nfs_config {
-    nfs_server=""
-    printf "\n"
-    read -p "Enter nfs server path (example.redhat.com:/var/crash): " -er
-    test -z "$REPLY" && return 1
-    nfs_server="$REPLY"
-    kdump_confirm $nfs_server NFS
-}
-
-
-function ssh_config {
-    ssh_login=""
-    printf "\n"
-    read -p "Enter ssh user/hostname (
[email protected]): " -er
-    test -z "$REPLY" && return 1
-    ssh_login="$REPLY"
-    kdump_confirm $ssh_login SSH
-}
-
-function restore_config {
-    cat > /etc/kdump.conf <<\EOF
-default reboot
-ext4 /dev/HostVG/Data
-path /core
-EOF
-    ovirt_store_config /etc/kdump.conf
-    service kdump restart
-}
-
-NFS="Setup NFS Configuration"
-SSH="Setup SSH Configuration"
-RESTORE="Restore Default Configuration"
-QUIT="Return to the Hypervisor Configuration Menu"
-
-if [ "$1" = "AUTO" ]; then
-    if [ -n "$OVIRT_KDUMP_NFS" ]; then
-        write_kdump_config $OVIRT_KDUMP_NFS
-    fi
-else
-    check
-    printf "\n\n kdump Configuration\n\n"
-    while true; do
-        PS3="Choose an option: "
-        select option in "$NFS" "$SSH" "$RESTORE" "$QUIT"
-          do
-
-          case $option in
-              $NFS) nfs_config; break;;
-              $SSH) ssh_config; break;;
-              $RESTORE) restore_config; break;;
-              $QUIT) exit;;
-          esac
-        done
-
-        printf "\n"
-    done
-fi
 
+++ /dev/null
-#!/bin/bash
-#
-# Configures the rsyslog daemon.
-# Source functions library
-. /etc/init.d/functions
-. /usr/libexec/ovirt-functions
-
-trap '__st=$?; stop_log; exit $__st' 0
-trap 'exit $?' 1 2 13 15
-
-if ! is_local_storage_configured; then
-    printf "Local storage must be configured prior to configuring the logging system.\n"
-    exit 99
-fi
-
-RSYSLOG_FILE="/etc/rsyslog.conf"
-
-# Creates the rsyslog file based on the following inputs
-# $1 ipaddress of remote syslog server
-# $2 port of remote syslog server
-# $3 protocol (tcp or udp)
-# TODO implement and use Augeas lens
-function ovirt_rsyslog {
-
-if [ "$3" = "tcp" ]; then
-    DELIM="@@"
-else DELIM="@"
-fi
-
-cat > $RSYSLOG_FILE << EOF
-#ovirt rsyslog config file
-
-#### MODULES ####
-\$ModLoad imuxsock.so    # provides support for local system logging (e.g. via logger command)
-\$ModLoad imklog.so      # provides kernel logging support (previously done by rklogd)
-
-#### GLOBAL DIRECTIVES ####
-# Use default timestamp format
-\$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
-
-#### RULES ####
-# Log anything (except mail) of level info or higher.
-# Don't log private authentication messages!
-*.info;mail.none;authpriv.none;cron.none                /var/log/messages
-
-# The authpriv file has restricted access.
-authpriv.*                                              /var/log/secure
-
-# Log all the mail messages in one place.
-mail.*                                                  -/var/log/maillog
-
-# Log cron stuff
-cron.*                                                  /var/log/cron
-
-# Everybody gets emergency messages
-*.emerg                                                 *
-
-# Save news errors of level crit and higher in a special file.
-uucp,news.crit                                          /var/log/spooler
-
-# Save boot messages also to boot.log
-local7.*                                                /var/log/boot.log
-
-\$WorkDirectory /var/spool/rsyslog
-\$ActionQueueFileName ovirtNode
-\$ActionQueueMaxDiskSpace 10m
-\$ActionQueueSaveOnShutdown on
-\$ActionQueueType LinkedList
-\$ActionResumeRetryCount -1
-*.* $DELIM$1:$2
-EOF
-
-start_log
-/sbin/service rsyslog restart
-stop_log
-}
-
-function is_numeric {
-    printf "$1" | grep -q -E '^[0-9]+$'
-}
-
-function prompt_user {
-    while true ; do
-        max_log_size="1024"
-        syslog_server_ip=""
-        syslog_server_port=""
-
-        while true; do
-               printf "\n"
-            read -p "What is the max size, in kilobytes, for local log files (def. ${max_log_size}k)? "
-
-            if [ -n "$REPLY" ]; then
-                r=$REPLY
-                if [[ $r =~ ^[0-9]+$ ]] && [[ $r -gt 0 ]]; then
-                    max_log_size=$r
-                    printf "\nMaximum logging size will be ${max_log_size}k.\n"
-                    break
-                else
-                    printf "\nInvalid input.\n"
-                fi
-            else
-                printf "\nLeaving log size as ${max_log_size}k.\n"
-                break
-            fi
-        done
-
-        printf "\n"
-        read -p "What is the IP address for the syslog server, hit Enter to skip? "
-        if [ -n "$REPLY" ]; then
-            syslog_server_ip=$REPLY
-            while true; do
-                read -p "Please enter the remote logging port used:  "
-                r=$REPLY
-                if [ -n "$r" ]; then
-                    if [[ $r =~ ^[0-9]+$ ]] && [[ $r -gt 0 ]]; then
-                           syslog_server_port=$REPLY
-                           break
-                    else
-                        printf "Invalid port.\n"
-                    fi
-                fi
-            done
-
-            printf "\n"
-            while true; do
-                read -p "Remote logging uses [t]cp or [u]dp? "
-                r=$(echo $REPLY|tr '[[:lower:]]' '[[:upper:]]')
-                if [ "$r" == "T" ]; then syslog_server_protocol="tcp"; break; fi
-                if [ "$r" == "U" ]; then syslog_server_protocol="udp"; break; fi
-                # else
-                       printf "Invalid input.\n"
-            done
-        else
-            printf "\nDisabling remote logging.\n"
-        fi
-
-        printf "\n"
-        printf "\nLogging will be configured as follows:"
-        printf "\n======================================"
-        printf "\n Max Logfile Size: $max_log_size"
-        if [ -n "$syslog_server_ip" ]; then
-            printf "\n    Remote Server: $syslog_server_ip"
-            printf "\n      Remote Port: $syslog_server_port"
-            printf "\n Logging Protocol: $syslog_server_protocol"
-        fi
-        printf "\n"
-        printf "\n"
-        while true; do
-            ask_yes_or_no "Is this correct ([Y]es/[N]o/[A]bort)?" true true
-            case $? in
-                0)
-                    printf "\nSaving configuration.\n"
-                    if [[ -n "$syslog_server_ip" ]] &&
-                        [[ -n "$syslog_server_port" ]] &&
-                        [[ -n "$syslog_server_protocol" ]]; then
-                        ovirt_rsyslog $syslog_server_ip \
-                            $syslog_server_port \
-                            $syslog_server_protocol
-                    fi
-                    sed -c -i -e "s/size.*/size ${max_log_size}k/" \
-                        /etc/logrotate.d/ovirt-node
-                    return
-                    ;;
-                1)
-                    printf "\nRestarting logging configuration.\n"
-                    break
-                    ;;
-                2)
-                    printf "\nAborting logging configuration.\n"
-                    return
-                    ;;
-            esac
-        done
-    done
-}
-
-function ovirt_netconsole {
-    augtool <<EOF
-set /files/etc/sysconfig/netconsole/SYSLOGADDR $OVIRT_NETCONSOLE_SERVER
-set /files/etc/sysconfig/netconsole/SYSLOGPORT $OVIRT_NETCONSOLE_PORT
-EOF
-    ovirt_store_config /etc/sysconfig/netconsole
-}
-# AUTO for auto-install
-if [ "$1" = "AUTO" ]; then
-    if [ -z "$OVIRT_SYSLOG_SERVER" -o -z "$OVIRT_SYSLOG_PORT" ]; then
-        printf "\nAttempting to locate remote syslog server..."
-        find_srv syslog udp
-        if [ -n "$SRV_HOST" -a -n "$SRV_PORT" ]; then
-            printf "found! Using syslog server '$SRV_HOST:$SRV_PORT'.\n"
-            ovirt_rsyslog $SRV_HOST $SRV_PORT udp
-        else
-            printf "not found!\n"
-        fi
-    else
-        printf "\nUsing default syslog server '$OVIRT_SYSLOG_SERVER:$OVIRT_SYSLOG_PORT'.\n"
-        ovirt_rsyslog $OVIRT_SYSLOG_SERVER $OVIRT_SYSLOG_PORT udp
-    fi
-    if [ -n "$OVIRT_NETCONSOLE_SERVER" -a -n "$OVIRT_NETCONSOLE_PORT" ]; then
-        printf "\nConfiguring netconsole server..."
-        ovirt_netconsole
-    fi
-else
-    printf "\n\n Logging Configuration\n\n"
-    prompt_user
-fi
 
+++ /dev/null
-#!/bin/bash
-#
-# Iterates over the list of network devices on the node and prompts the user
-# to configure each.
-
-. /usr/libexec/ovirt-functions
-
-ME=$(basename "$0")
-warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
-die() { warn "$*"; exit 1; }
-
-WORKDIR=$(mktemp -d) || exit 1
-
-# Remove $WORKDIR upon interrupt (and HUP, PIPE, TERM) and upon normal
-# termination, being careful not to change the exit status.
-trap '__st=$?; rm -rf "$WORKDIR"; stop_log; exit $__st' 0
-trap 'exit $?' 1 2 13 15
-
-IFCONFIG_FILE_ROOT="/files/etc/sysconfig/network-scripts/ifcfg"
-NTPCONF_FILE_ROOT="/files/etc/ntp"
-NTP_CONFIG_FILE="/etc/ntp.conf"
-NTPSERVERS=""
-CONFIGURED_NIC=""
-CONFIGURED_NICS=""
-VLAN_ID=""
-VL_ROOT=""
-
-if [[ -z "$ROOTDRIVE" && "$OVIRT_ISCSI_ENABLED" != "y" ]]; then
-# if local storage is not configured, then exit the script
-    if [[ ! is_local_storage_configured && "$OVIRT_ISCSI_NETWORKING" != "y" ]] ; then
-        printf "Local storage must be configured prior to configuring the management interface.\n\n"
-        exit 99
-    fi
-fi
-
-# $1 - the variable name to set
-# $2 - the input prompt
-function input_ipv4_address {
-    local varname=$1
-    local prompt=$2
-
-    eval $varname=\"\"
-
-    while true; do
-        read -ep "${prompt}: "
-
-        if [ -z "$REPLY" ]; then return; fi
-
-        if is_valid_ipv4 $REPLY; then
-            eval $varname=\"$REPLY\"
-            return
-        else
-            printf "\nThe address $REPLY is not a valid IPv4 address.\n"
-        fi
-    done
-}
-
-# Checks that a network interface was already configured.
-function has_configured_interface
-{
-    local show_message=${1-false}
-
-    if [[ -n "${CONFIGURED_NIC}" ]]; then
-        return 0
-    else
-        if $show_message; then
-            printf "\nYou must configure a network interface first.\n\n"
-        fi
-        return 1
-    fi
-}
-
-# Configures vlan for the node.
-# $1 - the nic
-# $2 - the network bridge name
-# $3 - the vlan id
-# $4 - the VL_ROOT variable
-# $5 - the VL_CONFIG variable
-# $6 - the IF_ROOT value
-# $7 - the vlan config filename variable
-# $8 - the NIC config filename
-function setup_vlan
-{
-    local nic=$1
-    local bridge=$2
-    local vlan_id=$3
-    local vlroot=$4
-    local vlconfig=$5
-    local ifroot=$6
-    local vlfilename=$7
-    local iffilename=$8
-
-    eval $vlroot="${ifroot}.${vlan_id}"
-    eval $vlconfig=\"rm \$${vlroot}\\nset \$${vlroot}/DEVICE ${nic}.${vlan_id}\"
-    eval $vlconfig=\"\$${vlconfig}\\nset \$${vlroot}/BRIDGE ${bridge}\"
-    eval $vlconfig=\"\$${vlconfig}\\nset \$${vlroot}/VLAN yes\"
-    eval $vlfilename="${iffilename}.${vlan_id}"
-}
-
-function configure_interface
-{
-    local NIC=$1
-    local AUTO=$2
-    if [[   "$AUTO" == "AUTO"    &&
-         -n "$OVIRT_IP_ADDRESS" ]]; then
-        IPADDR=$OVIRT_IP_ADDRESS
-        NETMASK=$OVIRT_IP_NETMASK
-        GATEWAY=$OVIRT_IP_GATEWAY
-        PREFIX=$OVIRT_IP_PREFIX
-    fi
-
-    if has_configured_interface; then
-        printf "This will delete the current configuration for ${CONFIGURED_NIC}.\n"
-        if ask_yes_or_no "Do you wish to continue ([Y]es/[N]o)?"; then
-            printf "\nDeleting existing network configuration...\n"
-            cp -a  /etc/sysconfig/network-scripts/ifcfg-lo /etc/sysconfig/network-scripts/backup.lo
-            remove_config /etc/sysconfig/network-scripts/ifcfg-*
-            rm -rf /etc/sysconfig/network-scripts/ifcfg-*
-            cp -a  /etc/sysconfig/network-scripts/backup.lo /etc/sysconfig/network-scripts/ifcfg-lo
-        else
-            printf "\nAborting...\n"
-            return
-        fi
-    fi
-
-    rm -rf $WORKDIR/*
-    CONFIGURED_NIC=$NIC
-
-    local BRIDGE=br$NIC
-    local IF_FILENAME="$WORKDIR/augtool-$NIC"
-    local BR_FILENAME="$WORKDIR/augtool-$BRIDGE"
-
-    printf "\nConfigure $BRIDGE for use by $NIC..\n\n"
-
-    local IF_ROOT="$IFCONFIG_FILE_ROOT-$NIC"
-    local IF_CONFIG="rm $IF_ROOT\nset $IF_ROOT/DEVICE $NIC"
-
-    local BR_ROOT="$IFCONFIG_FILE_ROOT-$BRIDGE"
-    local BR_CONFIG="rm $BR_ROOT\nset $BR_ROOT/DEVICE $BRIDGE"
-
-    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/TYPE Bridge"
-    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/PEERNTP yes"
-    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/DELAY 0"
-    local BR_CONFIG_BASE=$BR_CONFIG
-
-    if [ -z "$AUTO" ]; then
-        while true; do
-            local VL_CONFIG=""
-
-            printf "\n"
-            LINK=`ethtool $NIC| grep "Link detected"`:u
-            [ -z "$LINK" ] && return
-            if echo $LINK | grep -q "Link detected: yes" ; then
-                NICSTATUS="ACTIVE"
-            else
-                NICSTATUS="INACTIVE"
-            fi
-            echo "NIC is: $NICSTATUS"
-
-            if ask_yes_or_no "Help identify ${NIC} by blinking lights for 10 seconds ([Y]es/[N]o)?"; then
-                ethtool --identify $NIC 10
-            fi
-
-            ask_yes_or_no "Include VLAN support ([Y]es/[N]o/[A]bort)? " true true
-            case $? in
-                0)
-                    while true; do
-                        read -ep "What is the VLAN ID for this device (a=abort) "
-                        case $REPLY in
-                            A|a) CONFIGURED_NIC=""; return;;
-                            *)
-                                if [[ -n "$REPLY" ]] && [[ "$REPLY" =~ ^[0-9]{1,}$ ]]; then
-                                   VLAN_ID=$REPLY
-                                   setup_vlan $NIC $BRIDGE $VLAN_ID VL_ROOT VL_CONFIG $IF_ROOT VL_FILENAME $IF_FILENAME
-                                    break
-                                fi
-                                ;;
-                        esac
-                    done
-                    ;;
-                1)  IF_CONFIG="${IF_CONFIG}\nset ${IF_ROOT}/BRIDGE ${BRIDGE}" ;;
-                2)
-                    CONFIGURED_NIC=""
-                    VLAN_ID=""
-                    return;;
-            esac
-
-            while true; do
-                read -ep "Enable IPv4 support ([S]tatic IP, [D]HCP, [N]o or [A]bort)? "
-                case $REPLY in
-                    D|d)
-                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/BOOTPROTO dhcp"
-                        break
-                        ;;
-                    S|s)
-                        printf "\n"
-                        input_ipv4_address IPADDR  "IP Address"
-                        input_ipv4_address NETMASK "   Netmask"
-                        input_ipv4_address GATEWAY "   Gateway"
-
-                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/BOOTPROTO none"
-                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPADDR $IPADDR"
-                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/NETMASK $NETMASK"
-                        if [ -n "${GATEWAY}" ]; then
-                            BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/GATEWAY $GATEWAY"
-                        fi
-                        break
-                        ;;
-                    A|a)
-                        CONFIGURED_NIC=""
-                        VLAN_ID=""
-                        return
-                        ;;
-                    N|n)
-                        break
-                        ;;
-
-                esac
-            done
-
-            printf "\n"
-
-            while true; do
-                read -ep "Enable IPv6 support ([S]tatic, [D]HCPv6, A[u]to, [N]o or [A]bort)? "
-                case $REPLY in
-                    S|s)
-                        read -ep "IPv6 Address: "; IPADDR=$REPLY
-                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6INIT yes"
-                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6ADDR $IPADDR"
-                        break
-                        ;;
-                    D|d)
-                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6INIT yes"
-                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6AUTCONF no"
-                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6FORWARDING no"
-                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/DHCPV6C yes"
-                        break
-                        ;;
-                    U|u)
-                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6INIT yes"
-                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6FORWARDING no"
-                        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6AUTOCONF yes"
-                        break
-                        ;;
-                    A|a)
-                        CONFIGURED_NIC=""
-                        VLAN_ID=""
-                        return
-                        ;;
-                    N|n)
-                        break
-                        ;;
-
-                esac
-            done
-
-            printf "\n"
-            ask_yes_or_no "Is this correct ([Y]es/[N]o/[A]bort)?" true true
-            case $? in
-                0)
-                    IF_CONFIG="$IF_CONFIG\nset $IF_ROOT/ONBOOT yes"
-                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/ONBOOT yes"
-                    if [[ -n "$VLAN_ID" ]]; then
-                        VL_CONFIG="$VL_CONFIG\nset $VL_ROOT/ONBOOT yes"
-                    fi
-                    printf "$IF_CONFIG\n" > $IF_FILENAME
-                    printf "$BR_CONFIG\n" > $BR_FILENAME
-                    if [[ -n "$VLAN_ID" ]]; then
-                        printf "$VL_CONFIG\n" > $VL_FILENAME
-                    fi
-                    break
-                    ;;
-                1)
-                    BR_CONFIG=$BR_CONFIG_BASE
-                    ;;
-                2)
-                    CONFIGURED_NIC=""
-                    VLAN_ID=""
-                    return
-                    ;;
-            esac
-        done
-    else
-        if [ -n "$OVIRT_IPV6" ]; then
-            case "$OVIRT_IPV6" in
-                "auto")
-                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6INIT yes"
-                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6FORWARDING no"
-                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6_AUTOCONF yes"
-                    ;;
-                "dhcp")
-                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6INIT yes"
-                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6_AUTOCONF no"
-                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6FORWARDING no"
-                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/DHCPV6C yes"
-                    ;;
-                *)
-                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6INIT yes"
-                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6ADDR $OVIRT_IPV6"
-                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6_AUTOCONF no"
-                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPV6FORWARDING no"
-            esac
-        fi
-
-        if [ -n "$OVIRT_VLAN" ]; then
-           VLAN_ID=$OVIRT_VLAN
-           setup_vlan $NIC $BRIDGE $VLAN_ID VL_ROOT VL_CONFIG $IF_ROOT VL_FILENAME $IF_FILENAME
-        fi
-
-        if [ -z "$OVIRT_IP_ADDRESS" ]; then
-           if [ -z "$VL_CONFIG" ]; then
-               IF_CONFIG="${IF_CONFIG}\nset ${IF_ROOT}/BRIDGE ${BRIDGE}"
-           fi
-           BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/BOOTPROTO dhcp"
-        else
-            if [ "$OVIRT_IP_ADDRESS" != "off" ]; then
-               if [ -z "$VL_CONFIG" ]; then
-                    IF_CONFIG="${IF_CONFIG}\nset ${IF_ROOT}/BRIDGE ${BRIDGE}"
-               fi
-                BR_CONFIG="${BR_CONFIG}\nset ${BR_ROOT}/BOOTPROTO static"
-                BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/IPADDR $OVIRT_IP_ADDRESS"
-                if [ -n "$OVIRT_IP_NETMASK" ]; then
-                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/NETMASK $OVIRT_IP_NETMASK"
-                fi
-                if [ -n "$OVIRT_IP_GATEWAY" ]; then
-                    BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/GATEWAY $OVIRT_IP_GATEWAY"
-                fi
-            fi
-        fi
-
-        IF_CONFIG="$IF_CONFIG\nset $IF_ROOT/ONBOOT yes"
-        BR_CONFIG="$BR_CONFIG\nset $BR_ROOT/ONBOOT yes"
-       if [ -n "${VL_CONFIG}" ]; then
-           VL_CONFIG="$VL_CONFIG\nset $VL_ROOT/ONBOOT yes"
-       fi
-
-        printf "$IF_CONFIG\n" > $IF_FILENAME
-        printf "$BR_CONFIG\n" > $BR_FILENAME
-       if [ -n "$VL_CONFIG" ]; then
-           printf "$VL_CONFIG\n" > $VL_FILENAME
-       fi
-    fi
-}
-
-function configure_dns
-{
-    local DNS=$1
-    local AUTO=$2
-    if [[   "$AUTO" == "AUTO"    &&
-         -n "$OVIRT_DNS" ]]; then
-        DNS=$OVIRT_DNS
-    fi
-
-    local IF_FILENAME="$WORKDIR/augtool-br${CONFIGURED_NIC}"
-    local IF_ROOT="$IFCONFIG_FILE_ROOT-br${CONFIGURED_NIC}"
-    local IF_CONFIG=
-
-    if [ -z "$AUTO" ]; then
-        if has_configured_interface true; then
-            while true; do
-                for dns in first second; do
-                    while true; do
-                        printf "\n"
-                        read -erp "Please enter the ${dns} DNS server (or ENTER to exit): "
-                        local ADDRESS=$(trim_whitespace $REPLY)
-                        if [[ -z "${ADDRESS}" ]]; then
-                            if [[ -z "${DNS}" ]]; then
-                                printf "\nAborted...\n"
-                                return
-                            else
-                                break
-                            fi
-                        fi
-                        if is_valid_ipv4 $ADDRESS; then
-                            if [[ -z "${DNS}" ]]; then
-                                DNS="${ADDRESS}"
-                                break
-                            elif [[ -n "${ADDRESS}" ]]; then
-                                if [[ ! $DNS =~ "${ADDRESS}" ]]; then
-                                    DNS="${DNS}:${ADDRESS}"
-                                    break
-                                else
-                                    printf "${ADDRESS} is already defined as a DNS server.\n"
-                                fi
-                            fi
-                        else
-                            printf "${ADDRESS} is an invalid address.\n"
-                        fi
-                    done
-                done
-
-                printf "\n"
-                ask_yes_or_no "Is this correct ([Y]es/[N]o/[A]bort)?" true true
-                case $? in
-                    0) break ;;
-                    1) DNS="";;
-                    2) return ;;
-                esac
-            done
-        fi
-    fi
-
-    if [ -n "$DNS" ]; then
-        DNS1=$(echo "$DNS" | awk -F\: '{print $1}')
-        DNS2=$(echo "$DNS" | awk -F\: '{print $2}')
-
-        test -n "$DNS1" && printf "set $IF_ROOT/DNS1 $DNS1\n" >> $IF_FILENAME
-        test -n "$DNS2" && printf "set $IF_ROOT/DNS2 $DNS2\n" >> $IF_FILENAME
-    fi
-}
-
-function configure_ntp
-{
-    local AUTO=$2
-    if [[ "$AUTO" == "AUTO" && -n "$OVIRT_NTP" ]]; then
-        NTPSERVERS=$OVIRT_NTP
-    else
-        NTPSERVERS=""
-    fi
-
-    if [ -z "$AUTO" ]; then
-        if has_configured_interface true; then
-            while true; do
-                read -rp "Enter an NTP server (hit return when finished): "
-                local ADDRESS=$(trim_whitespace $REPLY)
-
-                if [ -z "${ADDRESS}" ]; then break; fi
-                if is_valid_ipv4 $ADDRESS; then
-                    if [[ ! $NTPSERVERS =~ $ADDRESS ]]; then
-                        NTPSERVERS="${NTPSERVERS}:${ADDRESS}"
-                    else
-                        printf "${ADDRESS} is already defined as an NTP server.\n"
-                    fi
-                else
-                    printf "${ADDRESS} is an invalid address.\n"
-                fi
-            done
-        fi
-    fi
-}
-
-function save_ntp_configuration
-{
-    local ntpconf="$WORKDIR/augtool-ntp"
-    local ntproot="/files/etc/ntp.conf"
-
-    printf "\
-rm ${ntproot}\n\
-set ${ntproot}/driftfile /var/lib/ntp/drift\n\
-set ${ntproot}/includefile /etc/ntp/crypto/pw\n\
-set ${ntproot}/keys /etc/ntp/keys\n\
-" > $ntpconf
-
-    if [ -n "$NTPSERVERS" ]; then
-        offset=1
-        SERVERS=$(echo $NTPSERVERS | awk 'BEGIN{FS=":"}{for (i=1; i<=NF; i++) print $i}')
-        for server in $SERVERS; do
-            printf "set /files/etc/ntp.conf/server[${offset}] ${server}\n" >> $ntpconf
-            offset=$(echo "$offset+1" | bc)
-        done
-    fi
-}
-
-function setup_menu
-{
-    NICS=""
-    nics=$(ls -bd /sys/class/net/*)
-    for nic in $nics; do
-        nic=$(basename $nic)
-        address=$(systool -c net -d $nic -A address | awk '/address\ += "(.*)"/ { print $3; }')
-        if [[ ! "$address" =~ '00:00:00:00' ]]; then
-            NICS="$NICS $nic"
-        fi
-    done
-
-    # Add virtio NICs that were possibly not detected by other means
-    NICS="$(ifconfig -a | awk '/Ethernet/ {print $1}'|xargs)"
-    NICS=$(echo $NICS | tr ' ' '\n' | sort -u | xargs)
-
-    PS3="Please select an interface or configuration option: "
-}
-
-if [ "$1" == "AUTO" ]; then
-    if [ -n "$OVIRT_BOOTIF" ]; then
-       configure_interface "$OVIRT_BOOTIF" AUTO
-       configure_dns "$OVIRT_DNS" AUTO
-       configure_ntp "$OVIRT_NTP" AUTO
-    else
-       printf "No network interface specified. Unable to configure networking."
-       exit 0
-    fi
-else
-    setup_menu
-
-    while true; do
-        printf "\n\nManagement Network Configuration\n\n" >&2
-        printf "***** WARNING *****\n"
-        printf "Configuring the network will destroy any existing networking\n"
-        printf "configuration on this system.\n"
-        printf "***** WARNING *****\n"
-        printf "\nPhysical Networking Devices (*=PXE boot interface)\n"
-        printf " %-10s %-12s %-18s\n" "Name" "Driver" "MAC"
-        PHY_NICS=""
-        for nic in $NICS; do
-            driver=$(basename $(readlink /sys/class/net/$nic/device/driver) 2>/dev/null)
-            mac=$(cat /sys/class/net/$nic/address)
-            if [ "$nic" = "$OVIRT_BOOTIF" ]; then
-                pxe="*"
-            else
-                pxe=" "
-            fi
-            if [ -n "$driver" ]; then
-                PHY_NICS="$PHY_NICS $nic"
-                printf "%s%-10s %-12s %-18s\n" "$pxe" "$nic" "$driver" "$mac"
-            fi
-        done
-
-        DNS="DNS"
-        NTP="NTP"
-        Abort="Abort"
-        Save="Save And Return To Menu"
-        select NIC in $PHY_NICS "$DNS" "$NTP" "$Abort" "$Save"
-        do
-            printf "\n"
-            case "$NIC" in
-                "$DNS") configure_dns "$OVIRT_DNS"; break ;;
-                "$NTP") configure_ntp "$OVIRT_NTP"; break ;;
-                "$Abort") rm -f "${WORKDIR}"/augtool-*; exit 99;;
-                "$Save")
-                    save_ntp_configuration
-                    break 2;;
-                *)
-                    if [[ -n "${NIC}" ]] && [[ "${NICS}" =~ "${NIC}" ]]; then
-                        configure_interface $NIC $IFACE_NUMBER
-                    else
-                        printf "\nInvalid option selected.\n"
-                    fi
-                    break
-                    ;;
-            esac
-        done
-    done
-fi
-
-start_log
-net_configured=0
-if ls "$WORKDIR"/augtool-* > /dev/null 2>&1 ; then
-    log "Configuring network"
-
-    # delete existing scripts
-    for vlan in /proc/net/vlan/*; do
-        if [[ ! "${vlan}" =~ config ]]; then
-            vlan=$(echo $vlan|awk -F "/" {'print $5'})
-            vconfig rem $vlan
-        fi
-    done
-
-    for script in /etc/sysconfig/network-scripts/ifcfg-*; do
-        if [[ ! "${script}" =~ ifcfg-lo ]]; then
-            ovirt_safe_delete_config $script
-        fi
-    done
-
-    config="$WORKDIR"/config-augtool
-    cat "$WORKDIR"/augtool-* > $config
-    echo "set /files/etc/sysconfig/network/NETWORKING yes" >> $config
-    CONFIGURED_NICS="$CONFIGURED_NIC br$CONFIGURED_NIC"
-    if [ -n "${VLAN_ID}" ]; then
-        CONFIGURED_NICS="$CONFIGURED_NICS $CONFIGURED_NIC.$VLAN_ID"
-    fi
-    # preserve current MAC mappings for *all physical* network interfaces
-    # to avoid dev$RANDOM rhbz#489927
-    for nic in $(ls -d /sys/class/net/*/device|cut -d/ -f5) ; do
-        mac=$(cat /sys/class/net/$nic/address)
-        if [ -n "$nic" -a -n "$mac" ]; then
-            if_root="$IFCONFIG_FILE_ROOT-$nic"
-            printf "\nset $if_root/DEVICE $nic" >> $config
-            # store the hwaddr field in both, physical and vlan ifcfg if vlan is used
-            if [ -n "${VLAN_ID}" -a "$nic" = "${CONFIGURED_NIC}" ]; then
-                printf "\nset $if_root/HWADDR $mac" >> $config
-                printf "\n" >> $config
-                if_root="${VL_ROOT}"
-            fi
-            if [ ${CONFIGURED_NIC} != $nic ]; then
-                printf "\nset $if_root/ONBOOT no" >> $config
-                CONFIGURED_NICS="$CONFIGURED_NICS $nic"
-            fi
-            printf "\nset $if_root/HWADDR $mac" >> $config
-            printf "\n" >> $config
-        fi
-    done
-    cp $config /tmp/augconfig
-    augtool $config
-    if [ $? = 0 ]; then
-        log "Network configured successfully"
-        net_configured=1
-        for nic in $CONFIGURED_NICS; do
-            ovirt_store_config /etc/sysconfig/network-scripts/ifcfg-$nic
-        done
-        ovirt_store_config $NTP_CONFIG_FILE
-    else
-        log "Error configuring network, see $OVIRT_LOGFILE"
-        stop_log
-        exit 1
-    fi
-fi
-stop_log
-
-if [ "$net_configured" = 1 ]; then
-    service network stop > /dev/null 2>&1
-    # XXX eth assumed in breth
-    for i in `brctl show | grep breth | awk '{print $1}'`
-    do
-      ifconfig $i down
-      brctl delbr $i
-    done
-    service network start 2> /dev/null
-    if [ $NTPSERVERS ]; then
-        log "Testing NTP Configuration"
-        test_ntp_configuration
-    fi
-fi
 
+++ /dev/null
-#!/bin/bash
-#
-# Set the root password and others
-# Source functions library
-. /etc/init.d/functions
-. /usr/libexec/ovirt-functions
-
-trap '__st=$?; stop_log; exit $__st' 0
-trap 'exit $?' 1 2 13 15
-
-warn() { printf '%s\n' "$*" >&2; }
-
-if ! is_local_storage_configured; then
-    warn "Local storage must be configured prior to setting the administrator password."
-    exit 99
-fi
-
-# Usage: set_sasl_password USER
-# Prompt(twice) for a password for the specified USER.
-# If they match, set that user's system password,
-# and add USER to the SASL list for libvirt.
-function set_sasl_password {
-    user=$1
-
-    printf "\nNode SASL User ($user):\n"
-    saslpasswd2 -a libvirt "$user"
-    return 0
-}
-
-# Prompts the user for a single username, password combo
-function prompt_sasl_user {
-    while true; do
-        printf "\nPlease enter a new username (hit return to skip) "
-        read -e
-        test -z "$REPLY" && return 1
-        set_sasl_password "$REPLY"
-    done
-}
-
-set_password () {
-    printf "\n\n Password Configuration\n\n"
-    local user=${1-root}
-
-    # prompt user
-    # Set the password for the root user first
-    printf "\nSystem Administrator ($user):\n"
-    unmount_config /etc/shadow
-    passwd $user
-    ovirt_store_config /etc/shadow
-}
-
-toggle_ssh_access ()
-{
-    local permit=$1
-
-    augtool <<EOF
-set /files/etc/ssh/sshd_config/PasswordAuthentication ${permit}
-EOF
-    ovirt_store_config /etc/ssh/sshd_config
-    service sshd reload
-}
-
-toggle_ssh () {
-    printf "\nSSH password authentication\n\n"
-
-    if ask_yes_or_no "Enable SSH password authentication ([Y]es/[N]o)?"; then
-        toggle_ssh_access yes
-    else
-        toggle_ssh_access no
-    fi
-}
-
-PASSWORD="Set root password"
-ADMIN_PASSWORD="Set admin user password"
-SSH="Toggle SSH password authentication"
-QUIT="Quit and Return To Menu"
-
-if [[ "$1" == "AUTO" ]]; then
-    if [ -n "${OVIRT_SSH_PWAUTH}" ]; then
-       toggle_ssh_access $OVIRT_SSH_PWAUTH
-    fi
-else
-    while true; do
-       state="disabled"
-       /usr/bin/augtool get /files/etc/ssh/sshd_config/PasswordAuthentication|grep -q yes$
-       if [ $? == 0 ]; then
-            state="enabled"
-       fi
-       printf "\nSSH password authentication is currently ${state}.\n\n"
-
-       PS3="Please select an option: "
-       select option in "$PASSWORD" "$ADMIN_PASSWORD" "$SSH" "$QUIT"
-       do
-            case $option in
-               $PASSWORD) set_password; break;;
-               $ADMIN_PASSWORD) set_password admin; break;;
-               $SSH) toggle_ssh; break;;
-               $QUIT) exit;;
-            esac
-       done
-
-       printf "\n"
-    done
-fi
 
+++ /dev/null
-#!/bin/bash
-#
-# Register system to RHN
-# Source functions library
-. /etc/init.d/functions
-. /usr/libexec/ovirt-functions
-
-trap '__st=$?; stop_log; exit $__st' 0
-trap 'exit $?' 1 2 13 15
-
-warn() { printf '%s\n' "$*" >&2; }
-
-check() {
-if ! is_local_storage_configured; then
-    warn "Configure local storage before registering to RHN."
-    exit 99
-fi
-if ! network_up; then
-    warn "Configure network before registering to RHN."
-    exit 99
-fi
-}
-
-# Usage: rhnreg_ks ARGS
-# $1 - serverUrl
-# $2 - CaCert
-# $3 - activationkey
-# $4 - username
-# $5 - password
-# $6 - profilename
-function run_rhnreg {
-
-    local serverUrl=$1
-    local CaCert=$2
-    local activationkey=$3
-    local userName=$4
-    local passWord=$5
-    local profileName=$6
-    local proxyuser=$7
-    local proxypass=$8
-    local proxyhost=$9
-
-    # have to run with novirtinfo b/c vdsm is not running before
-    # rhevm registration
-    # after reboot, rhn-virtualization daemon should refresh virtinfo
-    extra_args="--novirtinfo --norhnsd --nopackages --force"
-    args=""
-
-    # Get CaCert location
-    if [ -n "$serverUrl" ]; then
-        args="$args --serverUrl $serverUrl/XMLRPC"
-        if [ -z "$CaCert" ]; then
-            CaCert="$serverUrl/pub/RHN-ORG-TRUSTED-SSL-CERT"
-        fi
-        cert=$(echo $CaCert | awk -F/ '{print $NF}')
-        location="/etc/sysconfig/rhn/$cert"
-        log "Downloading Satellite CA cert....."
-        log "From: $CaCert To: $location"
-        wget -q -r -nd --no-check-certificate --timeout=30 --tries=3 -O "$location" "$CaCert"
-        if [ -s "${location}" ]; then
-            args="${args} --sslCACert $location"
-            ovirt_store_config $location
-        else
-            log "Error Downloading Satellite CA cert!"
-            return 1
-        fi
-    else
-        serverUrl="https://xmlrpc.rhn.redhat.com/XMLRPC"
-        location="/usr/share/rhn/RHNS-CA-CERT"
-        args="${args} --serverUrl $serverUrl --sslCACert $location"
-    fi
-
-    if [ -n "$activationkey" ]; then
-        args="${args} --activationkey $activationkey"
-    elif [ -n "$userName" ]; then
-        args="${args} --username $userName"
-        if [ -n "$passWord" ]; then
-            args="${args} --password $passWord"
-        fi
-    else
-        # skip RHN registration when neither activationkey
-        # nor username/password is supplied
-        # return success for AUTO w/o rhn_* parameters
-        return 0
-    fi
-
-    if [ -n "$profileName" ]; then
-        args="${args} --profilename $profileName"
-    fi
-
-    if [ -n "$proxyhost" ]; then
-        args="${args} --proxy=$proxyhost"
-        if [ -n "$proxyuser" ]; then
-            args="${args} --proxyUser=$proxyuser"
-            if [ -n "$proxypass" ]; then
-                args="${args} --proxyPassword=$proxypass"
-            fi
-        fi
-    fi
-
-    if [ -n "$extra_args" ]; then
-        args="${args} $extra_args"
-    fi
-
-    log "Registering to RHN account....."
-
-    unmount_config /etc/sysconfig/rhn/systemid
-    unmount_config /etc/sysconfig/rhn/up2date
-    # regenerate up2date config
-    rm -rf /etc/sysconfig/rhn/up2date
-    if rhnreg_ks $args; then
-        ovirt_store_config \
-            /etc/sysconfig/rhn/up2date \
-            /etc/sysconfig/rhn/systemid
-        log "System "$profileName" sucessfuly registered "$serverUrl""
-        return 0
-    else
-        log "Error registering to RHN account!"
-        return 1
-    fi
-}
-
-function run_rhsm {
-
-    local serverUrl=$1
-    local CaCert=$2
-    local activationkey=$3
-    local userName=$4
-    local passWord=$5
-    local profileName=$6
-    local proxyuser=$7
-    local proxypass=$8
-    local proxyhost=$9
-
-    extra_args="--force --autosubscribe"
-    args=""
-
-    if [ -n "$activationkey" ]; then
-        args="${args} --activationkey=$activationkey"
-    elif [ -n "$userName" ]; then
-        args="${args} --username=$userName"
-        if [ -n "$passWord" ]; then
-            args="${args} --password=$passWord"
-        fi
-    else
-        # skip RHSM registration when neither activationkey
-        # nor username/password is supplied
-        # return success for AUTO w/o rhn_* parameters
-        return 0
-    fi
-
-    if [ -n "$serverUrl" ]; then
-        eval $(serverUrl=$serverUrl python -c "
-import os
-u=os.getenv('serverUrl')
-if u.count('://') == 1:
-    (proto, u) = u.split('://')
-else:
-    proto = ''
-if u.count(':') == 1:
-    (u, port) = u.split(':')
-elif proto == 'http':
-    port = 80
-elif proto == 'https':
-    port = 443
-else:
-    port = 0
-host = u.split('/')[0]
-print 'host=%s' % host
-print 'port=%s' % port
-")
-        if [ -z "$port" -o "$port" == "0" ]; then
-            port=443
-        fi
-    else
-        host="subscription.rhn.redhat.com"
-        port="443"
-    fi
-    if subscription-manager config --server.hostname=$host --server.port=$port; then
-        ovirt_store_config /etc/rhsm/rhsm.conf
-    fi
-
-    if [ -n "$profileName" ]; then
-        args="${args} --name=$profileName"
-    fi
-
-    if [ -n "$proxyhost" ]; then
-        args="${args} --proxy=$proxyhost"
-        if [ -n "$proxyuser" ]; then
-            args="${args} --proxyuser=$proxyuser"
-            if [ -n "$proxypass" ]; then
-                args="${args} --proxypassword=$proxypass"
-            fi
-        fi
-    fi
-
-    if [ -n "$extra_args" ]; then
-        args="${args} $extra_args"
-    fi
-
-    log "Registering to RHN account....."
-
-    unmount_config /etc/pki/consumer/*pem
-    unmount_config /var/lib/rhsm/productid.js /var/lib/rhsm/cache/installed_products.json /var/lib/rhsm/facts/facts.json
-    rm -rf /var/lib/rhsm/productid.js /var/lib/rhsm/cache/installed_products.json /var/lib/rhsm/facts/facts.json
-    if subscription-manager register $args; then
-        ovirt_store_config \
-            /etc/pki/consumer/*pem \
-            /var/lib/rhsm/productid.js \
-            /var/lib/rhsm/cache/installed_products.json \
-            /var/lib/rhsm/facts/facts.json
-        log "System "$profileName" sucessfuly registered "$serverUrl""
-        return 0
-    else
-        log "Error registering to RHN account!"
-        return 1
-    fi
-}
-
-# Prompts the user for a single username, password combo
-function prompt_user {
-        servertype="$1"
-        serverurl=""
-        cacert=""
-        username=""
-        password=""
-        profilename=""
-        proxyhost=""
-        proxyuser=""
-        proxypass=""
-
-        if [ "$servertype" = "SAT" ]; then
-            printf "\n"
-            read -p "Enter URL of RHN Satellite (ie. https://satellite.example.com): " -er
-            test -z "$REPLY" && return 1
-            serverurl=$REPLY
-
-            default=$serverurl/pub/RHN-ORG-TRUSTED-SSL-CERT
-            printf "\n"
-            read -p "Enter location of satellite cert ($default): " -er
-            #test -z "$REPLY" && REPLY=$default
-            cacert=$REPLY
-        elif [ "$servertype" = "SAM" ]; then
-            printf "\n"
-            read -p "Enter URL of Subscription Asset Manager (ie. https://subscription.rhn.redhat.com): " -er
-            test -z "$REPLY" && return 1
-            serverurl=$REPLY
-            #XXX where is cacert for SAM?
-        fi
-
-        printf "\n"
-        read -p "Enter RHN account username: " -er
-        test -z "$REPLY" && return 1
-        username=$REPLY
-
-
-        printf "\n"
-        read -p "Enter password for RHN account: " -esr
-        test -z "$REPLY" && return 1
-        password=$REPLY
-
-
-        printf "\n"
-        read -p "Enter profile name for this system (optional): " -er
-        profilename=$REPLY
-
-        printf "\n"
-        read -p "Enter HTTP proxy in host:port format, e.g. proxy.example.com:3128 (leave blank if not required): " -er
-        if [ -n "$REPLY" ]; then
-            proxyhost=$REPLY
-
-            printf "\n"
-            read -p "Enter proxy username (leave blank if not required): " -er
-            proxyuser=$REPLY
-
-            printf "\n"
-            read -p "Enter proxy password (leave blank if not required): " -esr
-            proxypass=$REPLY
-        fi
-
-        if [ "$servertype" = "SAT" ]; then
-            run_rhnreg "$serverurl" "$cacert" "" "$username" "$password" "$profilename" "$proxyuser" "$proxypass" "$proxyhost"
-        else
-            run_rhsm "$serverurl" "$cacert" "" "$username" "$password" "$profilename" "$proxyuser" "$proxypass" "$proxyhost"
-        fi
-}
-
-HOSTED="Register to public RHN"
-SATELLITE="Register to RHN Satellite"
-SAM="Register to Subscription Asset Manager"
-QUIT="Return to the Hypervisor Configuration Menu"
-
-if [ "$1" = "AUTO" ]; then
-    if [ "$OVIRT_RHN_TYPE" = "sam" ]; then
-        run_rhsm "${OVIRT_RHN_URL}" "${OVIRT_RHN_CA_CERT}" "${OVIRT_RHN_ACTIVATIONKEY}" "${OVIRT_RHN_USERNAME}" "${OVIRT_RHN_PASSWORD}" "${OVIRT_RHN_PROFILE}" "${OVIRT_RHN_PROXY}" "${OVIRT_RHN_PROXYUSER}" "${OVIRT_RHN_PROXYPASSWORD}"
-    else
-        run_rhnreg "${OVIRT_RHN_URL}" "${OVIRT_RHN_CA_CERT}" "${OVIRT_RHN_ACTIVATIONKEY}" "${OVIRT_RHN_USERNAME}" "${OVIRT_RHN_PASSWORD}" "${OVIRT_RHN_PROFILE}" "${OVIRT_RHN_PROXY}" "${OVIRT_RHN_PROXYUSER}" "${OVIRT_RHN_PROXYPASSWORD}"
-    fi
-    exit $?
-else
-    check
-    while true; do
-        PS3="Choose an option: "
-        select option in "$HOSTED" "$SATELLITE" "$SAM" "$QUIT"
-          do
-
-          case $option in
-              $HOSTED) prompt_user; break;;
-              $SATELLITE) prompt_user "SAT"; break;;
-              $SAM) prompt_user "SAM"; break;;
-              $QUIT) exit;;
-          esac
-        done
-
-        printf "\n"
-    done
-fi
 
+++ /dev/null
-#!/usr/bin/env python
-#
-# ovirt-config-setup.py - Copyright (C) 2010 Red Hat, Inc.
-# Written by Joey Boggs <
[email protected]>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-from snack import *
-import _snack
-import os
-import traceback
-import fcntl
-import libvirt
-import PAM
-import gudev
-import pkgutil
-import ovirt_config_setup
-import sys
-from ovirtnode.ovirtfunctions import *
-from ovirtnode.password import *
-from ovirtnode.log import *
-from ovirtnode.network import *
-from ovirtnode.kdump import *
-from ovirtnode.iscsi import *
-
-OK_BUTTON = "OK"
-BACK_BUTTON = "Back"
-RESET_BUTTON = "Reset"
-CANCEL_BUTTON = "Cancel"
-APPLY_BUTTON = "Apply"
-IDENTIFY_BUTTON = "Identify NIC"
-LOCK_BUTTON = "Lock"
-RESTART_BUTTON = "Restart"
-POWER_OFF_BUTTON = "Power Off"
-UNLOCK_BUTTON = "Unlock"
-MENU_BUTTON = "Back to Menu"
-LOG_OFF_BUTTON = "Log Off"
-login_password = ""
-
-STATUS_PAGE = 1
-NETWORK_PAGE = 3
-AUTHENTICATION_PAGE = 5
-LOGGING_PAGE = 7
-KDUMP_PAGE = 9
-LAST_OPTION = REMOTE_STORAGE_PAGE = 11
-# max. 3 plugin menu options/pages: 13,15,17
-FIRST_PLUGIN_PAGE = 13
-LAST_PLUGIN_PAGE = 17
-#
-NETWORK_DETAILS_PAGE = 19
-SUPPORT_PAGE = 21
-LOCKED_PAGE = 99
-
-OVIRT_VARS = parse_defaults()
-
-def pam_conv(auth, query_list):
-    global login_password
-    resp = []
-    for i in range(len(query_list)):
-        resp.append((login_password, 0))
-    return resp
-
-class NodeConfigScreen():
-      """
-      User interface for Hypervisor Node Configuration.
-      """
-
-      def __init__(self):
-            self.__colorset = {
-                        "ROOT"           : ("gray",  "magenta"),
-                        "BORDER"         : ("magenta", "magenta"),
-                        "WINDOW"         : ("magenta", "magenta"),
-                         "ACTBUTTON"     : ("blue",  "white"),
-                         "BUTTON"        : ("blue",  "white"),
-                         "COMPACTBUTTON" : ("black", "magenta"),
-                         "LISTBOX"       : ("green",  "red"),
-                         "ACTLISTBOX"    : ("cyan", "red"),
-                         "ACTSELLISTBOX" : ("blue",  "white"),
-                         "TEXTBOX"       : ("cyan",  "magenta"),
-                         "ENTRY"         : ("cyan", "magenta"),
-                         "DISENTRY"      : ("white", "cyan"),
-                         "SHADOW"        : ("magenta",  "magenta"),
-                         "LABEL"         : ("brown",  "magenta"),
-                         "TITLE"         : ("white",  "blue"),
-                         "HELPLINE"      : ("cyan",  "magenta"),
-                         "EMPTYSCALE"    : ("white",  "cyan"),
-                         "FULLSCALE"     : ("cyan",  "white"),
-                         "CHECKBOX"      : ("black",  "red"),
-                         "ACTCHECKBOX"   : ("blue", "white")
-                         }
-            self.__current_page = 1
-            self.__finished = False
-            self.__nic_config_failed = 0
-            self.net_apply_config = 0
-
-      def _set_title(self):
-          PRODUCT_TITLE = "%s %s-%s" % (PRODUCT_SHORT, PRODUCT_VERSION, PRODUCT_RELEASE)
-          self.screen.drawRootText(1,0, "".ljust(78))
-          self.screen.drawRootText(1,1, "  %s" % PRODUCT_TITLE.ljust(76))
-          self.screen.drawRootText(1,2, "  %s" % os.uname()[1].ljust(76))
-
-      def _create_blank_screen(self):
-          self.screen = SnackScreen()
-          self.reset_screen_colors()
-          self.gridform = GridForm(self.screen, "", 2, 2)
-          self.screen.pushHelpLine(" ")
-          self._set_title()
-
-      def _create_warn_screen(self):
-          self._create_blank_screen()
-          self.screen.setColor("BUTTON", "black", "red")
-          self.screen.setColor("ACTBUTTON", "blue", "white")
-
-      def set_console_colors(self):
-          self.existing_color_array = None
-          tty_file = None
-          try:
-            tty_file = open("/dev/tty", "rw")
-          except:
-            pass
-          if tty_file == None:
-            tty_file = open("/dev/console", "rw")
-          try:
-            self._set_colors(tty_file)
-          except:
-              pass
-          finally:
-              tty_file.close()
-
-      def _set_colors(self, tty_file):
-          GIO_CMAP = 0x4B70
-          PIO_CMAP = 0x4B71
-          self.existing_color_array = bytearray(fcntl.ioctl(tty_file.fileno(), GIO_CMAP, b"\x00" * 48))
-          color_array = self.existing_color_array
-          color_array[3] = 0xde
-          color_array[4] = 0xde
-          color_array[5] = 0xde
-          color_array[6] = 0x30
-          color_array[7] = 0x30
-          color_array[8] = 0x30
-          color_array[9] = 0x52
-          color_array[10] = 0x52
-          color_array[11] = 0x52
-          color_array[12] = 0x00
-          color_array[13] = 0xbb
-          color_array[14] = 0xff
-          color_array[15] = 0xea
-          color_array[16] = 0xea
-          color_array[17] = 0xea
-          color_array[18] = 0x71
-          color_array[19] = 0x71
-          color_array[20] = 0x71
-          color_array[21] = 0xff
-          color_array[22] = 0xff
-          color_array[23] = 0xff
-          fcntl.ioctl(tty_file.fileno(), PIO_CMAP, bytes(color_array))
-
-      def restore_console_colors(self):
-          if self.existing_color_array == None:
-            return
-          tty_file = None
-          try:
-            tty_file = open("/dev/tty", "rw")
-          except:
-            pass
-          if tty_file == None:
-            tty_file = open("/dev/console", "rw")
-          try:
-              self._restore_colors(tty_file)
-          except:
-              pass
-          finally:
-              tty_file.close()
-
-      def _restore_colors(self, tty_file):
-          GIO_CMAP = 0x4B70
-          PIO_CMAP = 0x4B71
-          fcntl.ioctl(tty_file.fileno(), PIO_CMAP, bytes(self.existing_color_array))
-
-      def reset_screen_colors(self):
-          for item in self.__colorset.keys():
-              colors = self.__colorset.get(item)
-              self.screen.setColor(item, colors[0], colors[1])
-
-      def get_elements_for_page(self, screen, page):
-            if page == STATUS_PAGE :
-                return self.status_page(screen)
-            if page == NETWORK_PAGE :
-                return self.network_configuration_page(screen)
-            if page == AUTHENTICATION_PAGE :
-                return self.authentication_configuration_page(screen)
-            if page == LOGGING_PAGE :
-                return self.logging_configuration_page(screen)
-            if page == KDUMP_PAGE :
-                return self.kdump_configuration_page(screen)
-            if page == REMOTE_STORAGE_PAGE :
-                return self.remote_storage_configuration_page(screen)
-            if page == NETWORK_DETAILS_PAGE :
-                return self.network_details_page(screen)
-            if page == SUPPORT_PAGE :
-                return self.support_page(screen)
-            if page == LOCKED_PAGE :
-                return self.screen_locked_page(screen)
-            # plugin pages
-            plugin_page=FIRST_PLUGIN_PAGE
-            for p in self.plugins :
-                if page == plugin_page:
-                    return p.form()
-                plugin_page+=2
-                if plugin_page > LAST_PLUGIN_PAGE :
-                    # should not happen
-                    return None
-
-      def network_proto_Callback(self):
-          return
-
-      def nic_lb_callback(self):
-         try:
-             get_ip_address(self.nic_lb.current())
-             self.nic_disabled.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_RESET)
-         except:
-             self.nic_disabled.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_SET)
-         return
-
-      def nic_dhcp_callback(self):
-          if self.nic_dhcp.value() == 1:
-              flag = _snack.FLAGS_SET
-          else:
-              flag = _snack.FLAGS_RESET
-          for i in self.netdevip, self.netdevmask, self.netdevgateway:
-              i.setFlags(_snack.FLAG_DISABLED, flag)
-          return
-
-      def dns_host1_callback(self):
-          warn = 0
-          if not self.dns_host1.value() is None and not self.dns_host1.value() == "":
-               if not is_valid_ipv4(self.dns_host1.value()):
-                   if not is_valid_ipv6(self.dns_host1.value()):
-                       warn = 1
-          if warn == 1:
-              self.screen.setColor("BUTTON", "black", "red")
-              self.screen.setColor("ACTBUTTON", "blue", "white")
-              ButtonChoiceWindow(self.screen, "Network", "Invalid IP Address", buttons = ['Ok'])
-              self.dns_host1.set("")
-              self.reset_screen_colors()
-          return
-
-      def dns_host2_callback(self):
-          warn = 0
-          if not self.dns_host2.value() is None and not self.dns_host2.value() == "":
-              if not is_valid_ipv4(self.dns_host2.value()):
-                   if not is_valid_ipv6(self.dns_host1.value()):
-                       warn = 1
-          if warn == 1:
-              self.screen.setColor("BUTTON", "black", "red")
-              self.screen.setColor("ACTBUTTON", "blue", "white")
-              ButtonChoiceWindow(self.screen, "Network", "Invalid IP Address", buttons = ['Ok'])
-              self.dns_host2.set("")
-              self.reset_screen_colors()
-          return
-
-      def ntp_host1_callback(self):
-          warn = 0
-          if not self.ntp_host1.value() is None and not self.ntp_host1.value() == "":
-               if not is_valid_ipv4(self.ntp_host1.value()):
-                   if not is_valid_ipv6(self.ntp_host1.value()):
-                       if not is_valid_hostname(self.ntp_host1.value()):
-                           warn = 1
-          if warn == 1:
-              self.screen.setColor("BUTTON", "black", "red")
-              self.screen.setColor("ACTBUTTON", "blue", "white")
-              ButtonChoiceWindow(self.screen, "Network", "Invalid IP Address", buttons = ['Ok'])
-              self.ntp_host1.set("")
-              self.reset_screen_colors()
-          return
-
-      def ntp_host2_callback(self):
-          warn = 0
-          if not self.ntp_host2.value() is None and not self.ntp_host2.value() == "":
-              if not is_valid_ipv4(self.ntp_host2.value()):
-                   if not is_valid_ipv6(self.ntp_host2.value()):
-                       if not is_valid_hostname(self.ntp_host2.value()):
-                           warn = 1
-          if warn == 1:
-              self.screen.setColor("BUTTON", "black", "red")
-              self.screen.setColor("ACTBUTTON", "blue", "white")
-              ButtonChoiceWindow(self.screen, "Network", "Invalid IP Address", buttons = ['Ok'])
-              self.ntp_host2.set("")
-              self.reset_screen_colors()
-          return
-
-      def ipv4_ip_callback(self):
-          warn = 0
-          if not self.ipv4_netdevip.value() is None and not self.ipv4_netdevip.value() == "":
-               if not is_valid_ipv4(self.ipv4_netdevip.value()):
-                   warn = 1
-          if warn == 1:
-              self.screen.setColor("BUTTON", "black", "red")
-              self.screen.setColor("ACTBUTTON", "blue", "white")
-              ButtonChoiceWindow(self.screen, "Network", "Invalid IP Address", buttons = ['Ok'])
-              self.ipv4_netdevip.set("")
-              self.reset_screen_colors()
-          return
-
-      def ipv4_netmask_callback(self):
-          warn = 0
-          if not self.ipv4_netdevmask.value() is None and not self.ipv4_netdevmask.value() == "":
-               if not is_valid_ipv4(self.ipv4_netdevmask.value()):
-                   warn = 1
-          if warn == 1:
-              self.screen.setColor("BUTTON", "black", "red")
-              self.screen.setColor("ACTBUTTON", "blue", "white")
-              ButtonChoiceWindow(self.screen, "Network", "Invalid IP Address", buttons = ['Ok'])
-              self.ipv4_netdevmask.set("")
-              self.reset_screen_colors()
-          return
-
-      def ipv4_gateway_callback(self):
-          warn = 0
-          if not self.ipv4_netdevgateway.value() is None and not self.ipv4_netdevgateway.value() == "":
-               if not is_valid_ipv4(self.ipv4_netdevgateway.value()):
-                   warn = 1
-          if warn == 1:
-              self.screen.setColor("BUTTON", "black", "red")
-              self.screen.setColor("ACTBUTTON", "blue", "white")
-              ButtonChoiceWindow(self.screen, "Network", "Invalid IP Address", buttons = ['Ok'])
-              self.ipv4_netdevgateway.set("")
-              self.reset_screen_colors()
-          return
-
-      def ipv4_disabled_callback(self):
-          if self.disabled_ipv4_nic_proto.value() == 1:
-              flag = _snack.FLAGS_SET
-              for i in self.ipv4_netdevip, self.ipv4_netdevmask, self.ipv4_netdevgateway:
-                  i.setFlags(_snack.FLAG_DISABLED, flag)
-                  self.dhcp_ipv4_nic_proto.setValue(" 0")
-                  self.static_ipv4_nic_proto.setValue(" 0")
-
-      def ipv4_dhcp_callback(self):
-          if self.dhcp_ipv4_nic_proto.value() == 1:
-              flag = _snack.FLAGS_SET
-              for i in self.ipv4_netdevip, self.ipv4_netdevmask, self.ipv4_netdevgateway:
-                  i.setFlags(_snack.FLAG_DISABLED, flag)
-                  self.disabled_ipv4_nic_proto.setValue(" 0")
-                  self.static_ipv4_nic_proto.setValue(" 0")
-
-      def ipv4_static_callback(self):
-          if self.static_ipv4_nic_proto.value() == 1:
-              flag = _snack.FLAGS_RESET
-              for i in self.ipv4_netdevip, self.ipv4_netdevmask, self.ipv4_netdevgateway:
-                  i.setFlags(_snack.FLAG_DISABLED, flag)
-                  self.disabled_ipv4_nic_proto.setValue(" 0")
-                  self.dhcp_ipv4_nic_proto.setValue(" 0")
-
-      def ipv6_disabled_callback(self):
-          if self.disabled_ipv6_nic_proto.value() == 1:
-              flag = _snack.FLAGS_SET
-              for i in self.ipv6_netdevip, self.ipv6_netdevmask, self.ipv6_netdevgateway:
-                  i.setFlags(_snack.FLAG_DISABLED, flag)
-                  self.dhcp_ipv6_nic_proto.setValue(" 0")
-                  self.static_ipv6_nic_proto.setValue(" 0")
-                  self.auto_ipv6_nic_proto.setValue(" 0")
-
-      def ipv6_dhcp_callback(self):
-          if self.dhcp_ipv6_nic_proto.value() == 1:
-              flag = _snack.FLAGS_SET
-              for i in self.ipv6_netdevip, self.ipv6_netdevmask, self.ipv6_netdevgateway:
-                  i.setFlags(_snack.FLAG_DISABLED, flag)
-                  self.disabled_ipv6_nic_proto.setValue(" 0")
-                  self.static_ipv6_nic_proto.setValue(" 0")
-                  self.auto_ipv6_nic_proto.setValue(" 0")
-
-      def ipv6_static_callback(self):
-          if self.static_ipv6_nic_proto.value() == 1:
-              flag = _snack.FLAGS_RESET
-              for i in self.ipv6_netdevip, self.ipv6_netdevmask, self.ipv6_netdevgateway:
-                  i.setFlags(_snack.FLAG_DISABLED, flag)
-                  self.disabled_ipv6_nic_proto.setValue(" 0")
-                  self.dhcp_ipv6_nic_proto.setValue(" 0")
-                  self.auto_ipv6_nic_proto.setValue(" 0")
-
-      def ipv6_auto_callback(self):
-          if self.auto_ipv6_nic_proto.value() == 1:
-              flag = _snack.FLAGS_SET
-              for i in self.ipv6_netdevip, self.ipv6_netdevmask, self.ipv6_netdevgateway:
-                  i.setFlags(_snack.FLAG_DISABLED, flag)
-                  self.disabled_ipv6_nic_proto.setValue(" 0")
-                  self.dhcp_ipv6_nic_proto.setValue(" 0")
-                  self.static_ipv6_nic_proto.setValue(" 0")
-      def ipv6_ip_callback(self):
-          warn = 0
-          if not self.ipv6_netdevip.value() is None and not self.ipv6_netdevip.value() == "":
-               if not is_valid_ipv6(self.ipv6_netdevip.value()):
-                   warn = 1
-          if warn == 1:
-              self.screen.setColor("BUTTON", "black", "red")
-              self.screen.setColor("ACTBUTTON", "blue", "white")
-              ButtonChoiceWindow(self.screen, "Network", "Invalid IP Address", buttons = ['Ok'])
-              self.ipv6_netdevip.set("")
-              self.reset_screen_colors()
-          return
-
-      def ipv6_netmask_callback(self):
-          warn = 0
-          if not self.ipv6_netdevmask.value() is None and not self.ipv6_netdevmask.value() == "":
-              try:
-                  if not int(self.ipv6_netdevmask.value()) in range(1,128):
-                      warn = 1
-              except:
-                  warn = 1
-          if warn == 1:
-              self.screen.setColor("BUTTON", "black", "red")
-              self.screen.setColor("ACTBUTTON", "blue", "white")
-              ButtonChoiceWindow(self.screen, "Network", "Invalid IPv6 Netmask", buttons = ['Ok'])
-              self.ipv6_netdevmask.set("")
-              self.reset_screen_colors()
-          return
-
-      def ipv6_gateway_callback(self):
-          warn = 0
-          if not self.ipv6_netdevgateway.value() is None and not self.ipv6_netdevgateway.value() == "":
-               if not is_valid_ipv6(self.ipv6_netdevgateway.value()):
-                   warn = 1
-          if warn == 1:
-              self.screen.setColor("BUTTON", "black", "red")
-              self.screen.setColor("ACTBUTTON", "blue", "white")
-              ButtonChoiceWindow(self.screen, "Network", "Invalid IP Address", buttons = ['Ok'])
-              self.ipv6_netdevgateway.set("")
-              self.reset_screen_colors()
-          return
-
-      def netvlanid_callback(self):
-          warn = 0
-          try:
-              if not self.netvlanid.value() == "":
-                  if not int(self.netvlanid.value()) in range(1,4095) or " " in self.netvlanid.value():
-                      warn = 1
-          except:
-              warn = 1
-          finally:
-              if warn == 1:
-                  self.screen.setColor("BUTTON", "black", "red")
-                  self.screen.setColor("ACTBUTTON", "blue", "white")
-                  ButtonChoiceWindow(self.screen, "Configuration Check", "Invalid VLAN ID", buttons = ['Ok'])
-                  self.reset_screen_colors()
-                  self.netvlanid.set("")
-      def password_check_callback(self):
-          resp, msg = password_check(self.root_password_1.value(), self.root_password_2.value())
-          self.pw_msg.setText(msg)
-          return
-
-      def valid_logrotate_max_size_callback(self):
-          if not self.logrotate_max_size.value().isdigit():
-              self.screen.setColor("BUTTON", "black", "red")
-              self.screen.setColor("ACTBUTTON", "blue", "white")
-              ButtonChoiceWindow(self.screen, "Configuration Check", "Invalid Log File Size", buttons = ['Ok'])
-              self.reset_screen_colors()
-
-      def valid_syslog_port_callback(self):
-          if not is_valid_port(self.syslog_port.value()):
-              self.screen.setColor("BUTTON", "black", "red")
-              self.screen.setColor("ACTBUTTON", "blue", "white")
-              ButtonChoiceWindow(self.screen, "Configuration Check", "Invalid Port Number", buttons = ['Ok'])
-              self.reset_screen_colors()
-
-      def valid_syslog_server_callback(self):
-          if not is_valid_host_or_ip(self.syslog_server.value()):
-              self.screen.setColor("BUTTON", "black", "red")
-              self.screen.setColor("ACTBUTTON", "blue", "white")
-              ButtonChoiceWindow(self.screen, "Configuration Check", "Invalid Hostname or Address", buttons = ['Ok'])
-              self.reset_screen_colors()
-
-      def kdump_nfs_callback(self):
-          self.kdump_ssh_type.setValue(" 0")
-          self.kdump_restore_type.setValue(" 0")
-          self.kdump_nfs_config.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_RESET)
-          self.kdump_ssh_config.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_SET)
-
-      def kdump_valid_nfs_callback(self):
-          if not is_valid_nfs(self.kdump_nfs_config.value()):
-              self.screen.setColor("BUTTON", "black", "red")
-              self.screen.setColor("ACTBUTTON", "blue", "white")
-              ButtonChoiceWindow(self.screen, "Configuration Check", "Invalid NFS Entry", buttons = ['Ok'])
-              self.reset_screen_colors()
-
-      def kdump_ssh_callback(self):
-          self.kdump_nfs_type.setValue(" 0")
-          self.kdump_restore_type.setValue(" 0")
-          self.kdump_nfs_config.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_SET)
-          self.kdump_ssh_config.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_RESET)
-
-      def kdump_valid_ssh_callback(self):
-          if not is_valid_user_host(self.kdump_ssh_config.value()):
-              self.screen.setColor("BUTTON", "black", "red")
-              self.screen.setColor("ACTBUTTON", "blue", "white")
-              ButtonChoiceWindow(self.screen, "Configuration Check", "Invalid SSH Entry", buttons = ['Ok'])
-              self.reset_screen_colors()
-
-      def kdump_restore_callback(self):
-          self.kdump_ssh_type.setValue(" 0")
-          self.kdump_nfs_type.setValue(" 0")
-          self.kdump_nfs_config.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_SET)
-          self.kdump_ssh_config.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_SET)
-
-      def valid_netconsole_server_callback(self):
-          if not is_valid_host_or_ip(self.netconsole_server.value()):
-              self.screen.setColor("BUTTON", "black", "red")
-              self.screen.setColor("ACTBUTTON", "blue", "white")
-              ButtonChoiceWindow(self.screen, "Configuration Check", "Invalid NetConsole Hostname or Address", buttons = ['Ok'])
-              self.reset_screen_colors()
-
-      def valid_netconsole_server_port_callback(self):
-          if not is_valid_port(self.netconsole_server_port.value()):
-              self.screen.setColor("BUTTON", "black", "red")
-              self.screen.setColor("ACTBUTTON", "blue", "white")
-              ButtonChoiceWindow(self.screen, "Configuration Check", "Invalid NetConsole Server Port", buttons = ['Ok'])
-              self.reset_screen_colors()
-
-      def valid_hostname_callback(self):
-          if not self.net_hostname.value() == "":
-              if not is_valid_hostname(self.net_hostname.value()):
-                  self.screen.setColor("BUTTON", "black", "red")
-                  self.screen.setColor("ACTBUTTON", "blue", "white")
-                  ButtonChoiceWindow(self.screen, "Configuration Check", "Invalid Hostname", buttons = ['Ok'])
-                  self.reset_screen_colors()
-
-      def valid_fqdn_or_ipv4(self):
-          warn = 0
-          if not self.ntp_host1.value() == "":
-               if not is_valid_ipv4(self.ntp_host1.value()):
-                   if not is_valid_hostname(self.ntp_host1.value()):
-                       if not is_valid_ipv6(self.ntp_host1.value()):
-                           warn = 1
-          if not self.ntp_host2.value() == "":
-               if not is_valid_ipv4(self.ntp_host2.value()):
-                   if not is_valid_hostname(self.ntp_host2.value()):
-                       if not is_valid_ipv6(self.ntp_host2.value()):
-                           warn = 1
-
-          if not self.dns_host1.value() == "":
-               if not is_valid_ipv4(self.dns_host1.value()):
-                   if not is_valid_ipv6(self.dns_host1.value()):
-                           warn = 1
-          if not self.dns_host2.value() == "":
-               if not is_valid_ipv4(self.dns_host2.value()):
-                   if not is_valid_ipv6(self.dns_host2.value()):
-                           warn = 1
-          if warn == 1:
-              self.screen.setColor("BUTTON", "black", "red")
-              self.screen.setColor("ACTBUTTON", "blue", "white")
-              ButtonChoiceWindow(self.screen, "Network", "Invalid IP/Hostname", buttons = ['Ok'])
-              self.reset_screen_colors()
-          return
-
-      def screen_locked_page(self, screen):
-            self.screen_locked = True
-            elements = Grid(1, 3)
-            pw_elements = Grid(2, 2)
-            pad = 34 - len(os.uname()[1]) / 2
-            elements.setField(Label("Unlock " + os.uname()[1]), 0, 0, padding=(pad - 3,1,0,1))
-            self.login_username = os.getlogin()
-            self.login_password = Entry(15, "", password = 1)
-            pw_elements.setField(Label("Username: "), 0, 0, padding=(pad,1,0,1))
-            pw_elements.setField(Label(self.login_username), 1, 0)
-            pw_elements.setField(Label("Password: "), 0, 1, padding=(pad,0,0,1))
-            pw_elements.setField(self.login_password, 1, 1)
-            elements.setField(pw_elements, 0, 1)
-            return [Label(""), elements]
-
-      def status_page(self, screen):
-            elements = Grid(2, 10)
-            main_grid = Grid(2, 10)
-            if network_up():
-                self.network_status = {}
-                status_text = ""
-                client = gudev.Client(['net'])
-                # reload augeas tree
-                aug.load()
-                for nic in client.query_by_subsystem("net"):
-                    try:
-                        interface = nic.get_property("INTERFACE")
-                        logger.debug(interface)
-                        if not interface == "lo":
-                            if has_ip_address(interface) or get_ipv6_address(interface):
-                                ipv4_address = get_ip_address(interface)
-                                try:
-                                    ipv6_address, netmask = get_ipv6_address(interface)
-                                except:
-                                    ipv6_address = ""
-                                self.network_status[interface] = (ipv4_address,ipv6_address)
-                    except:
-                        pass
-                # remove parent/bridge duplicates
-                for key in sorted(self.network_status.iterkeys()):
-                    if key.startswith("br"):
-                        parent_dev = key[+2:]
-                        if self.network_status.has_key(parent_dev):
-                            del self.network_status[parent_dev]
-                for key in sorted(self.network_status.iterkeys()):
-                    ipv4_addr, ipv6_addr = self.network_status[key]
-                    cmd = "/files/etc/sysconfig/network-scripts/ifcfg-%s/BOOTPROTO" % str(key)
-                    dev_bootproto = augtool_get(cmd)
-                    if dev_bootproto is None:
-                      cmd = "/files/etc/sysconfig/network-scripts/ifcfg-br%s/BOOTPROTO" % str(key)
-                      dev_bootproto = augtool_get(cmd)
-                      if dev_bootproto is None:
-                          dev_bootproto = "Disabled"
-                    link_status_cmd = "ethtool %s|grep \"Link detected\"" % key
-                    link_status = subprocess.Popen(link_status_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-                    link_status = link_status.stdout.read()
-                    if not "yes" in link_status:
-                        ipv4_addr = "(Link Inactive)"
-                    if ipv4_addr.strip() == "" and dev_bootproto.strip() == "dhcp":
-                        if "Inactive" in ipv4_addr:
-                            ipv4_addr = "(Link Inactive)"
-                        else:
-                            ipv4_addr = "(DHCP Failed)"
-                    if OVIRT_VARS.has_key("OVIRT_IPV6") and ipv6_addr != "" :
-                            status_text += "%1s: %5s %14s \nIPv6: %1s\n\n" % (key.strip(),dev_bootproto.strip(),ipv4_addr.strip(),ipv6_addr.strip())
-                    else:
-                        status_text += "%1s: %5s %14s \n" % (key.strip(),dev_bootproto.strip(),ipv4_addr.strip())
-                    status_text.strip()
-                    networking = TextboxReflowed(32, status_text, maxHeight=7)
-                    networking.setText(status_text)
-                logger.debug(status_text)
-                logger.debug(self.network_status)
-            else:
-                networking = Textbox(25, 1, "Not Connected")
-            elements.setField(Label("Networking:"), 0, 0, anchorLeft = 1, anchorTop = 1)
-            elements.setField(networking, 1, 0, anchorLeft = 1, padding=(4, 0, 0, 1))
-            elements.setField(Label("Logical Network   Device    MAC Address"),1,4,anchorLeft =1)
-            networks = logical_to_physical_networks()
-            if len(networks) >= 4:
-               net_scroll = 1
-            else:
-                net_scroll = 0
-            self.network_list = Textbox(50, 4, "", scroll = net_scroll)
-            net_entry = ""
-            for key in networks.iterkeys():
-                device, mac = networks[key]
-                key = pad_or_trim(12, key)
-                device = pad_or_trim(8,device)
-                net_entry += " %1s %6s  %9s\n" % (key, device, mac)
-            elements.setField(self.network_list, 1, 5, anchorLeft = 1, padding=(4, 0, 0, 1))
-            self.network_list.setText(net_entry)
-            logging_status = Textbox(18, 1, "local only")
-            elements.setField(Label("Logs:"), 0, 6, anchorLeft = 1)
-            elements.setField(logging_status, 1, 6, anchorLeft = 1, padding=(4, 0, 0, 0))
-            try:
-                conn = libvirt.openReadOnly(None)
-                self.dom_count = conn.numOfDomains()
-                conn.close()
-            except:
-                self.dom_count = "Failed to connect"
-            self.jobs_status = Textbox(18, 1, str(self.dom_count))
-            running_vms_grid = Grid(2,1)
-            running_vms_grid.setField(Label("Running VMs:   "), 0, 0, anchorLeft = 1)
-            running_vms_grid.setField(self.jobs_status, 1, 0, anchorLeft = 1)
-            main_grid.setField(elements, 0, 1, anchorLeft = 1)
-            hwvirt_msg =  get_virt_hw_status()
-            if not hwvirt_msg is "":
-                self.hwvirt = Textbox(50, 1, hwvirt_msg)
-                main_grid.setField(self.hwvirt, 0, 3, anchorLeft = 1, padding=(0,1,0,0))
-            else:
-                main_grid.setField(running_vms_grid, 0, 3, anchorLeft = 1, padding=(0,0,0,0))
-            help_text = Textbox(62, 1, "Press F8 For Support Menu")
-            main_grid.setField(help_text, 0, 4, anchorLeft = 1, padding=(0,1,0,0))
-
-
-            return [Label(""), main_grid]
-
-      def logging_configuration_page(self, screen):
-          elements = Grid(2, 8)
-          heading = Label("Logging")
-          heading.setColors(customColorset(1))
-          elements.setField(heading, 0, 0, anchorLeft = 1)
-          logrotate_grid = Grid(2,2)
-          logrotate_grid.setField(Label("  Logrotate Max Log Size (KB): "), 0, 0, anchorLeft = 1)
-          self.logrotate_max_size = Entry(5, "", scroll = 0)
-          self.logrotate_max_size.setCallback(self.valid_logrotate_max_size_callback)
-          logrotate_grid.setField(self.logrotate_max_size, 1, 0, anchorLeft = 1)
-          current_logrotate_size = get_logrotate_size()
-          self.logrotate_max_size.set(current_logrotate_size)
-          elements.setField(logrotate_grid, 0, 1, anchorLeft = 1, padding = (0,1,0,0))
-          elements.setField(Label(" "), 0, 2, anchorLeft = 1)
-          elements.setField(Textbox(45,2,"Rsyslog is an enhanced multi-threaded syslogd"), 0, 3, anchorLeft = 1)
-          rsyslog_grid = Grid(2,2)
-          rsyslog_grid.setField(Label("  Server Address:"), 0, 0, anchorLeft = 1)
-          self.syslog_server = Entry(25, "")
-          self.syslog_server.setCallback(self.valid_syslog_server_callback)
-          rsyslog_grid.setField(self.syslog_server, 1, 0, anchorLeft = 1, padding=(2, 0, 0, 1))
-          self.syslog_port = Entry(6, "", scroll = 0)
-          self.syslog_port.setCallback(self.valid_syslog_port_callback)
-          rsyslog_grid.setField(Label("  Server Port:"), 0, 1, anchorLeft = 1, padding=(0, 0, 0, 1))
-          rsyslog_grid.setField(self.syslog_port, 1, 1, anchorLeft = 1, padding=(2, 0, 0, 1))
-          rsyslog_config = get_rsyslog_config()
-          logger.debug(rsyslog_config)
-          if not rsyslog_config is None:
-              rsyslog_server, rsyslog_port = rsyslog_config
-              self.syslog_server.set(rsyslog_server)
-              self.syslog_port.set(rsyslog_port)
-          else:
-              self.syslog_port.set("514")
-          elements.setField(rsyslog_grid, 0, 4, anchorLeft = 1)
-          elements.setField(Textbox(48,3,"Netconsole service allows a remote syslog daemon\nto record kernel printk() messages"), 0, 5, anchorLeft = 1, padding = (0,0,0,0))
-          netconsole_grid = Grid(2,2)
-          netconsole_grid.setField(Label("  Server Address:"), 0, 0, anchorLeft = 1)
-          self.netconsole_server = Entry(25, "")
-          self.netconsole_server.setCallback(self.valid_netconsole_server_callback)
-          netconsole_grid.setField(Label("  Server Port:"), 0, 1, anchorLeft = 1)
-          self.netconsole_server_port = Entry(5, "", scroll = 0)
-          self.netconsole_server_port.setCallback(self.valid_netconsole_server_port_callback)
-          netconsole_grid.setField(self.netconsole_server, 1, 0, anchorLeft = 1, padding=(2, 0, 0, 1))
-          netconsole_grid.setField(self.netconsole_server_port, 1, 1, anchorLeft = 1, padding=(2, 0, 0, 0))
-          elements.setField(netconsole_grid, 0, 6, anchorLeft = 1, padding = (0,0,0,0))
-          netconsole_server = augtool_get("/files/etc/sysconfig/netconsole/SYSLOGADDR")
-          netconsole_server_port = augtool_get("/files/etc/sysconfig/netconsole/SYSLOGPORT")
-          if netconsole_server is None:
-              self.netconsole_server.set("")
-          else:
-              self.netconsole_server.set(netconsole_server)
-          if netconsole_server_port is None:
-              self.netconsole_server_port.set("6666")
-          else:
-              self.netconsole_server_port.set(netconsole_server_port)
-          return [Label(""), elements]
-
-
-      def authentication_configuration_page(self, screen):
-          elements = Grid(2, 9)
-          heading = Label("Remote Access")
-          heading.setColors(customColorset(1))
-          elements.setField(heading, 0, 0, anchorLeft = 1)
-          pw_elements = Grid (3,3)
-          self.current_ssh_pwd_status = augtool_get("/files/etc/ssh/sshd_config/PasswordAuthentication")
-          if self.current_ssh_pwd_status == "yes":
-              self.current_ssh_pwd_status = 1
-          else:
-              self.current_ssh_pwd_status = 0
-          self.ssh_passwd_status = Checkbox("Enable ssh password authentication", isOn=self.current_ssh_pwd_status)
-          elements.setField(self.ssh_passwd_status, 0, 1, anchorLeft = 1)
-          local_heading = Label("Local Access")
-          local_heading.setColors(customColorset(1))
-          elements.setField(local_heading, 0, 3, anchorLeft = 1, padding = (0,2,0,0))
-          elements.setField(Label(" "), 0, 6)
-          pw_elements.setField(Label("Password: "), 0, 1, anchorLeft = 1)
-          pw_elements.setField(Label("Confirm Password: "), 0, 2, anchorLeft = 1)
-          self.root_password_1 = Entry(15,password = 1)
-          self.root_password_1.setCallback(self.password_check_callback)
-          self.root_password_2 = Entry(15,password = 1)
-          self.root_password_2.setCallback(self.password_check_callback)
-          pw_elements.setField(self.root_password_1, 1,1)
-          pw_elements.setField(self.root_password_2, 1,2)
-          self.pw_msg = Textbox(60, 6, "", wrap=1)
-          elements.setField(pw_elements, 0, 7, anchorLeft=1)
-          elements.setField(self.pw_msg, 0, 8, padding = (0,1,0,0))
-          return [Label(""), elements]
-
-      def network_configuration_page(self, screen):
-          grid = Grid(2,15)
-          self.heading = Label("System Identification")
-          grid.setField(self.heading, 0, 1, anchorLeft = 1)
-          hostname_grid = Grid(2,2)
-          hostname_grid.setField(Label("Hostname: "), 0, 1, anchorLeft = 1, padding=(0,0,4,0))
-          self.current_hostname = os.uname()[1]
-          hostname = os.uname()[1]
-          self.net_hostname = Entry(35, hostname)
-          self.net_hostname.setCallback(self.valid_hostname_callback)
-          self.ntp_dhcp = 0
-          hostname_grid.setField(self.net_hostname, 1, 1, anchorLeft = 1, padding=(0,0,0,0))
-          grid.setField(hostname_grid, 0, 3, anchorLeft=1)
-          dns_grid = Grid(2,2)
-          self.dns_host1 = Entry(25)
-          self.dns_host1.setCallback(self.dns_host1_callback)
-          self.current_dns_host1 = augtool_get("/files/etc/resolv.conf/nameserver[1]")
-          if self.current_dns_host1:
-              self.dns_host1.set(self.current_dns_host1)
-          else:
-              self.dns_host1.set("")
-          self.dns_host2 = Entry(25)
-          self.dns_host2.setCallback(self.dns_host2_callback)
-          self.current_dns_host2 = augtool_get("/files/etc/resolv.conf/nameserver[2]")
-          if self.current_dns_host2:
-              self.dns_host2.set(self.current_dns_host2)
-          else:
-              self.dns_host2.set("")
-          dns_grid.setField(Label("DNS Server 1: "), 0, 0, anchorLeft = 1)
-          dns_grid.setField(Label("DNS Server 2: "), 0, 1, anchorLeft = 1)
-          dns_grid.setField(self.dns_host1, 1, 0, anchorLeft = 1)
-          dns_grid.setField(self.dns_host2, 1, 1, anchorLeft = 1)
-          grid.setField(Label("  "), 0, 4)
-          grid.setField(dns_grid, 0, 6, anchorLeft =1)
-          grid.setField(Label("  "), 0, 7)
-          ntp_grid = Grid(2,2)
-          self.ntp_host1 = Entry(25)
-          self.ntp_host1.setCallback(self.ntp_host1_callback)
-
-          self.ntp_host2 = Entry(25)
-          self.ntp_host2.setCallback(self.ntp_host2_callback)
-
-          self.current_ntp_host1 = augtool_get("/files/etc/ntp.conf/server[1]")
-          if self.current_ntp_host1:
-              self.ntp_host1.set(self.current_ntp_host1)
-          self.current_ntp_host2 = augtool_get("/files/etc/ntp.conf/server[2]")
-          if self.current_ntp_host2:
-              self.ntp_host2.set(self.current_ntp_host2)
-          ntp_grid.setField(Label("NTP Server 1: "), 0, 0, anchorLeft = 1)
-          ntp_grid.setField(Label("NTP Server 2: "), 0, 1, anchorLeft = 1)
-          ntp_grid.setField(self.ntp_host1, 1, 0, anchorLeft = 1)
-          ntp_grid.setField(self.ntp_host2, 1, 1, anchorLeft = 1)
-          grid.setField(Label("  "), 0, 10)
-          grid.setField(ntp_grid, 0, 9, anchorLeft =1)
-          self.nic_dict, self.configured_nics, self.ntp_dhcp = get_system_nics()
-          if len(self.nic_dict) > 5:
-              self.nic_lb = Listbox(height = 5, width = 56, returnExit = 1, scroll = 1)
-          else:
-              self.nic_lb = Listbox(height = 5, width = 56, returnExit = 1, scroll = 0)
-          for key in sorted(self.nic_dict.iterkeys()):
-              dev_interface,dev_bootproto,dev_vendor,dev_address,dev_driver,dev_conf_status,dev_bridge = self.nic_dict[key].split(",", 6)
-              dev_vendor = pad_or_trim(10, dev_vendor)
-              dev_interface = pad_or_trim(6, dev_interface)
-              nic_option = '%2s %13s %10s %19s\n' % (dev_interface,dev_conf_status,dev_vendor,dev_address)
-              self.nic_lb.append(nic_option, dev_interface.strip())
-          NIC_LABEL = Label("Device  Status          Model     MAC Address")
-          grid.setField(NIC_LABEL, 0, 11, (0, 0, 0, 0), anchorLeft = 1)
-          grid.setField(self.nic_lb, 0, 12)
-          if os.path.exists("/etc/sysconfig/network-scripts/ifcfg-rhevm"):
-              for item in self.dns_host1, self.dns_host2, self.ntp_host1, self.ntp_host2:
-                  item.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_SET)
-              self.heading.setText("Managed by RHEV-M (Read Only)")
-          if self.ntp_dhcp == 1:
-              for item in self.ntp_host1, self.ntp_host2:
-                  item.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_SET)
-          return [Label(""),
-                  grid]
-
-      def network_details_page(self,screen):
-          grid = Grid(1,15)
-          if system("ethtool %s|grep \"Link detected\"|grep yes" % self.nic_lb.current()):
-              link_status = "Active"
-          else:
-              link_status = "Inactive"
-          dev = self.nic_lb.current()
-          interface,bootproto,vendor,address,driver,conf_status,dev_bridge = self.nic_dict[dev].split(",", 6)
-          nic_detail_grid = Grid(6, 10)
-          nic_detail_grid.setField(Label("Interface:   "), 0, 1, anchorLeft = 1, padding=(0,0,1,0))
-          nic_detail_grid.setField(Label("Protocol:    "), 0, 2, anchorLeft = 1, padding=(0,0,1,0))
-          nic_detail_grid.setField(Label("Link Status: "), 0, 3, anchorLeft = 1, padding=(0,0,1,0))
-          nic_detail_grid.setField(Label("Driver:      "), 3, 1, anchorLeft = 1, padding=(0,0,1,0))
-          nic_detail_grid.setField(Label("Vendor:      "), 3, 2, anchorLeft = 1, padding=(0,0,1,0))
-          nic_detail_grid.setField(Label("MAC Address: "), 3, 3, anchorLeft = 1, padding=(0,0,1,0))
-          nic_detail_grid.setField(Label(interface), 1, 1, anchorLeft = 1, padding=(0,0,5,0))
-          nic_detail_grid.setField(Label(bootproto), 1, 2, anchorLeft = 1, padding=(0,0,5,0))
-          nic_detail_grid.setField(Label(link_status), 1, 3, anchorLeft = 1, padding=(0,0,5,0))
-          nic_detail_grid.setField(Label(driver), 4, 1, anchorLeft = 1, padding=(0,0,0,0))
-          nic_detail_grid.setField(Label(vendor), 4, 2, anchorLeft = 1, padding=(0,0,0,0))
-          nic_detail_grid.setField(Label(address), 4, 3, anchorLeft = 1, padding=(0,0,0,0))
-          grid.setField(nic_detail_grid, 0, 1)
-          ipv4_main_grid = Grid(6,8)
-          self.disabled_ipv4_nic_proto = Checkbox("Disabled ")
-          self.disabled_ipv4_nic_proto.setCallback(self.ipv4_disabled_callback)
-          self.dhcp_ipv4_nic_proto = Checkbox("DHCP ")
-          self.dhcp_ipv4_nic_proto.setCallback(self.ipv4_dhcp_callback)
-          self.static_ipv4_nic_proto = Checkbox("Static ")
-          self.static_ipv4_nic_proto.setCallback(self.ipv4_static_callback)
-          if bootproto.lower() == "dhcp":
-              self.dhcp_ipv4_nic_proto.setValue("*")
-          elif bootproto.lower() == "static":
-              self.static_ipv4_nic_proto.setValue("*")
-          else:
-              self.disabled_ipv4_nic_proto.setValue("*")
-          ipv4_proto_grid = Grid(6,1)
-          ipv4_proto_grid.setField(self.disabled_ipv4_nic_proto, 0, 0, anchorLeft = 1)
-          ipv4_proto_grid.setField(self.dhcp_ipv4_nic_proto, 2, 0, anchorLeft = 1)
-          ipv4_proto_grid.setField(self.static_ipv4_nic_proto, 4, 0, anchorLeft = 1)
-          ipv4_main_grid.setField(Label("IPv4 Settings"), 0, 0, anchorLeft = 1)
-          ipv4_main_grid.setField(ipv4_proto_grid, 0, 2, anchorLeft = 1)
-          self.ipv4_netdevip = Entry(16, "", scroll = 0)
-          self.ipv4_netdevip.setCallback(self.ipv4_ip_callback)
-          self.ipv4_netdevmask = Entry(16, "", scroll = 0)
-          self.ipv4_netdevmask.setCallback(self.ipv4_netmask_callback)
-          self.ipv4_netdevgateway = Entry(16, "", scroll = 0)
-          self.ipv4_netdevgateway.setCallback(self.ipv4_gateway_callback)
-          if not dev_bridge is None:
-              dev = dev_bridge
-          if "OVIRT_IP_ADDRESS" in OVIRT_VARS:
-              self.ipv4_netdevip.set(OVIRT_VARS["OVIRT_IP_ADDRESS"])
-          else:
-              current_ip = get_ip_address(dev)
-              if current_ip != "":
-                  self.ipv4_netdevip.set(current_ip)
-          if "OVIRT_IP_NETMASK" in OVIRT_VARS:
-              self.ipv4_netdevmask.set(OVIRT_VARS["OVIRT_IP_NETMASK"])
-          else:
-              current_netmask = get_netmask(dev)
-              if current_netmask != "":
-                  self.ipv4_netdevmask.set(current_netmask)
-          if "OVIRT_IP_GATEWAY" in OVIRT_VARS:
-              self.ipv4_netdevgateway.set(OVIRT_VARS["OVIRT_IP_GATEWAY"])
-          else:
-              current_gateway = get_gateway(dev)
-              if is_valid_ipv4(current_gateway) or is_valid_ipv6(current_gateway):
-                  self.ipv4_netdevgateway.set(current_gateway)
-          ipv4_grid = Grid (5,3)
-          ipv4_grid.setField(Label("IP Address: "), 0, 1, anchorLeft = 1)
-          ipv4_grid.setField(Label(" Netmask: "), 3, 1, anchorLeft = 1)
-          ipv4_grid.setField(Label("Gateway:"), 0, 2, anchorLeft = 1)
-          ipv4_grid.setField(self.ipv4_netdevip, 2, 1)
-          ipv4_grid.setField(self.ipv4_netdevmask, 4, 1)
-          ipv4_grid.setField(self.ipv4_netdevgateway, 2, 2)
-          ipv4_main_grid.setField(ipv4_grid, 0,3)
-          if self.dhcp_ipv4_nic_proto.value() == 1:
-              self.ipv4_dhcp_callback()
-          elif self.static_ipv4_nic_proto.value() == 1:
-              self.ipv4_static_callback()
-          else:
-              self.ipv4_disabled_callback()
-          # prepopulate current values only in case of missing values
-          if self.__nic_config_failed == 1:
-              try:
-                  self.ipv4_netdevip.set(self.ipv4_current_netdevip)
-                  self.ipv4_netdevmask.set(self.ipv4_current_netdevmask)
-                  self.ipv4_netdevgateway.set(self.ipv4_current_netdevgateway)
-                  self.static_ipv4_nic_proto.setValue("*")
-                  self.ipv4_static_callback()
-              except:
-                  pass
-          # ipv6 grids
-          ipv6_main_grid = Grid(6,8)
-          self.disabled_ipv6_nic_proto = Checkbox("Disabled ")
-          self.disabled_ipv6_nic_proto.setCallback(self.ipv6_disabled_callback)
-          self.dhcp_ipv6_nic_proto = Checkbox("DHCP ")
-          self.dhcp_ipv6_nic_proto.setCallback(self.ipv6_dhcp_callback)
-          self.static_ipv6_nic_proto = Checkbox("Static ")
-          self.static_ipv6_nic_proto.setCallback(self.ipv6_static_callback)
-          self.auto_ipv6_nic_proto = Checkbox("Auto")
-          self.auto_ipv6_nic_proto.setCallback(self.ipv6_auto_callback)
-          ipv6_autoconf_lookup_cmd = "/files/etc/sysconfig/network-scripts/ifcfg-%s/IPV6_AUTOCONF" % self.nic_lb.current()
-          ipv6_autoconf = augtool_get(ipv6_autoconf_lookup_cmd)
-          if ipv6_autoconf is None:
-              ipv6_autoconf_lookup_cmd = "/files/etc/sysconfig/network-scripts/ifcfg-br%s/IPV6_AUTOCONF" % self.nic_lb.current()
-              ipv6_autoconf = augtool_get(ipv6_autoconf_lookup_cmd)
-          ipv6_dhcp_lookup_cmd = "/files/etc/sysconfig/network-scripts/ifcfg-%s/DHCPV6C" % self.nic_lb.current()
-          ipv6_dhcp = augtool_get(ipv6_dhcp_lookup_cmd)
-          if ipv6_dhcp is None:
-              ipv6_dhcp_lookup_cmd = "/files/etc/sysconfig/network-scripts/ifcfg-br%s/DHCPV6C" % self.nic_lb.current()
-              ipv6_dhcp = augtool_get(ipv6_dhcp_lookup_cmd)
-          ipv6_bootproto = ""
-          if ipv6_autoconf == "yes":
-              ipv6_bootproto = "auto"
-          if ipv6_dhcp == "yes":
-              ipv6_bootproto = "dhcp"
-          if ipv6_bootproto == "dhcp":
-              self.dhcp_ipv6_nic_proto.setValue("*")
-          elif ipv6_bootproto == "auto":
-              self.auto_ipv6_nic_proto.setValue("*")
-          else:
-              self.disabled_ipv6_nic_proto.setValue("*")
-          ipv6_proto_grid = Grid(6,1)
-          ipv6_proto_grid.setField(self.disabled_ipv6_nic_proto, 0, 0, anchorLeft = 1)
-          ipv6_proto_grid.setField(self.dhcp_ipv6_nic_proto, 1, 0, anchorLeft = 1)
-          ipv6_proto_grid.setField(self.static_ipv6_nic_proto, 2, 0, anchorLeft = 1)
-          ipv6_proto_grid.setField(self.auto_ipv6_nic_proto, 3, 0, anchorLeft = 1)
-          ipv6_main_grid.setField(Label("IPv6 Settings"), 0, 0, anchorLeft = 1)
-          ipv6_main_grid.setField(ipv6_proto_grid, 0, 2, anchorLeft = 1)
-          self.ipv6_netdevip = Entry(39, "", scroll = 0)
-          self.ipv6_netdevip.setCallback(self.ipv6_ip_callback)
-          self.ipv6_netdevmask = Entry(39, "", scroll = 0)
-          self.ipv6_netdevmask.setCallback(self.ipv6_netmask_callback)
-          self.ipv6_netdevgateway = Entry(39, "", scroll = 0)
-          self.ipv6_netdevgateway.setCallback(self.ipv6_gateway_callback)
-          if "OVIRT_IPV6_ADDRESS" in OVIRT_VARS:
-              self.ipv6_netdevip.set(OVIRT_VARS["OVIRT_IPV6_ADDRESS"])
-          else:
-              try:
-                  current_ip, current_netmask = get_ipv6_address(self.nic_lb.current())
-              except:
-                  current_ip = ""
-                  current_netmask = ""
-              if current_ip == "":
-                  try:
-                      current_ip, current_netmask = get_ipv6_address("br" + self.nic_lb.current())
-                  except:
-                      pass
-              if current_ip != "":
-                  self.ipv6_netdevip.set(current_ip)
-          if "OVIRT_IPV6_NETMASK" in OVIRT_VARS:
-              self.ipv6_netdevmask.set(OVIRT_VARS["OVIRT_IPV6_NETMASK"])
-          else:
-              if current_ip != "":
-                  self.ipv6_netdevmask.set(current_netmask)
-          if "OVIRT_IPV6_GATEWAY" in OVIRT_VARS:
-              self.ipv6_netdevgateway.set(OVIRT_VARS["OVIRT_IPV6_GATEWAY"])
-          else:
-              current_gateway = get_ipv6_gateway(self.nic_lb.current())
-              if current_gateway == "":
-                  current_gateway = get_gateway("br" + self.nic_lb.current())
-          ipv6_grid = Grid (5,4)
-          ipv6_grid.setField(Label("IP Address: "), 0, 1, anchorLeft = 1)
-          ipv6_grid.setField(Label("Netmask: "), 0, 2, anchorLeft = 1)
-          ipv6_grid.setField(Label("Gateway:"), 0, 3, anchorLeft = 1)
-          ipv6_grid.setField(self.ipv6_netdevip, 2, 1)
-          ipv6_grid.setField(self.ipv6_netdevmask, 2, 2)
-          ipv6_grid.setField(self.ipv6_netdevgateway, 2, 3)
-          ipv6_main_grid.setField(ipv6_grid, 0,3)
-          if self.dhcp_ipv6_nic_proto.value() == 1:
-              self.ipv6_dhcp_callback()
-          elif self.static_ipv6_nic_proto.value() == 1:
-              self.ipv6_static_callback()
-          else:
-              self.ipv6_disabled_callback()
-          grid.setField(Label(" "), 0, 4, anchorLeft = 1)
-          grid.setField(ipv4_main_grid, 0, 5, anchorLeft = 1)
-          grid.setField(Label(" "), 0, 6, anchorLeft = 1)
-          # only display ipv6 settings if OVIRT_IPV6 key is in defaults file
-          if OVIRT_VARS.has_key("OVIRT_IPV6"):
-              grid.setField(ipv6_main_grid, 0, 7, anchorLeft = 1)
-          else:
-              grid.setField(Label(" "), 0, 7, anchorLeft = 1, padding=(0,4,0,0))
-          grid.setField(Label(" "), 0, 8, anchorLeft = 1)
-          vlan_grid = Grid(2,2)
-          self.netvlanid = Entry(4, "", scroll = 0)
-          self.netvlanid.setCallback(self.netvlanid_callback)
-          if "OVIRT_VLAN" in OVIRT_VARS:
-              self.netvlanid.set(OVIRT_VARS["OVIRT_VLAN"])
-          vlan_grid.setField(Label("VLAN ID: "), 0, 0, anchorLeft = 1)
-          vlan_grid.setField(self.netvlanid, 1, 0)
-          grid.setField(vlan_grid, 0, 9, anchorLeft = 1)
-          # disable all items if registered to rhevm server
-          if os.path.exists("/etc/sysconfig/network-scripts/ifcfg-rhevm"):
-              for item in self.disabled_ipv4_nic_proto, self.dhcp_ipv4_nic_proto, self.static_ipv4_nic_proto, \
-                  self.ipv4_netdevip, self.ipv4_netdevmask, self.ipv4_netdevgateway, self.disabled_ipv6_nic_proto, \
-                  self.dhcp_ipv6_nic_proto, self.static_ipv6_nic_proto, self.auto_ipv6_nic_proto, \
-                  self.ipv6_netdevip, self.ipv6_netdevmask, self.ipv6_netdevgateway, self.netvlanid:
-                  item.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_SET)
-          try:
-              current_ip = get_ipv6_address("br" + self.nic_lb.current()).split("\n")
-              if current_ip == "":
-                  current_ip = get_ipv6_address(self.nic_lb.current()).split("\n")
-              if current_ip != "":
-                  if len(current_ip) > 1:
-                      current_ip = current_ip[0]
-                      current_ip, netmask = current_ip.split("/")
-                  else:
-                      current_ip, netmask = current_ip.split("/")
-                  self.ipv6_netdevip.set(current_ip)
-                  self.ipv6_netdevmask.set(netmask)
-          except:
-              pass
-          return [Label(""),
-                  grid]
-      def kdump_configuration_page(self, screen):
-          elements = Grid(2, 12)
-          heading = Label("Kernel Dump")
-          heading.setColors(customColorset(1))
-          elements.setField(heading, 0, 0, anchorLeft = 1)
-          if not network_up():
-              elements.setField(Label(" * Network Down, Configuration Disabled * "), 0, 1, anchorLeft = 1)
-          else:
-              elements.setField(Label(" "), 0, 1, anchorLeft = 1)
-          kdump_type_grid = Grid(5, 2)
-          self.kdump_nfs_type = Checkbox("NFS ")
-          self.kdump_nfs_type.setCallback(self.kdump_nfs_callback)
-          self.kdump_ssh_type = Checkbox("SSH ")
-          self.kdump_ssh_type.setCallback(self.kdump_ssh_callback)
-          self.kdump_restore_type = Checkbox("Restore (Local)")
-          self.kdump_restore_type.setCallback(self.kdump_restore_callback)
-          kdump_type_grid.setField(self.kdump_nfs_type, 0, 0, anchorLeft = 1)
-          kdump_type_grid.setField(self.kdump_ssh_type, 1, 0, anchorLeft = 1)
-          kdump_type_grid.setField(self.kdump_restore_type, 2, 0, anchorLeft = 1)
-          elements.setField(kdump_type_grid, 0, 2, anchorLeft = 1)
-          elements.setField(Label(" "), 0, 3, anchorLeft = 1)
-          elements.setField(Label("NFS Location (example.redhat.com:/var/crash):"), 0, 4, anchorLeft = 1)
-          self.kdump_nfs_config = Entry(30, "")
-          self.kdump_nfs_config.setCallback(self.kdump_valid_nfs_callback)
-          elements.setField(self.kdump_nfs_config, 0, 5, anchorLeft = 1)
-          elements.setField(Label(" "), 0, 6, anchorLeft = 1)
-          elements.setField(Label("SSH Location (
[email protected])"), 0, 7, anchorLeft = 1)
-          self.kdump_ssh_config = Entry(30, "")
-          self.kdump_ssh_config.setCallback(self.kdump_valid_ssh_callback)
-          elements.setField(self.kdump_ssh_config, 0, 8, anchorLeft = 1, padding =(0,0,0,6))
-          try:
-              kdump_config_file = open("/etc/kdump.conf")
-              for line in kdump_config_file:
-                  if not line.startswith("#"):
-                      if line.startswith("net"):
-                          line = line.replace("net ", "")
-                          if "@" in line:
-                              self.kdump_ssh_type.setValue("*")
-                              self.kdump_ssh_config.set(line.strip())
-                              self.kdump_nfs_config.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_SET)
-                          elif ":" in line:
-                              self.kdump_nfs_type.setValue("*")
-                              self.kdump_nfs_config.set(line.strip())
-                              self.kdump_ssh_config.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_SET)
-                      elif "/dev/HostVG/Data" in line:
-                          self.kdump_restore_type.setValue("*")
-              kdump_config_file.close()
-          except:
-              pass
-          if not network_up():
-              self.kdump_nfs_type.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_SET)
-              self.kdump_ssh_type.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_SET)
-              self.kdump_nfs_config.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_SET)
-              self.kdump_ssh_config.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_SET)
-          return [Label(""), elements]
-
-      def support_page(self, screen):
-          logger.info("Loading Support Page")
-          elements = Grid(2, 8)
-          elements.setField(Label(" View Log Files "), 0, 1, anchorLeft = 1, padding = (0,1,0,0))
-          self.log_menu_list = Listbox(5, width = 40, returnExit = 1, border = 0, showCursor = 0, scroll = 0)
-          self.log_menu_list.append(" oVirt Log (ovirt.log)", "/var/log/ovirt.log")
-          self.log_menu_list.append(" System Messages (messages)", "/var/log/messages")
-          self.log_menu_list.append(" Security Log (secure)", "/var/log/secure")
-          if os.path.exists("/var/log/vdsm/vdsm.log"):
-              self.log_menu_list.append(" VDSM Log (vdsm.log)", "/var/log/vdsm/vdsm.log")
-          if os.path.exists("/var/log/vdsm-reg/vdsm-reg.log"):
-              self.log_menu_list.append(" VDSM Registration Log (vdsm-reg.log)", "/var/log/vdsm-reg/vdsm-reg.log")
-          elements.setField(self.log_menu_list, 0, 2, anchorLeft = 1, padding = (0,0,0,8))
-          elements.setField(Label(" After viewing press \"q\" to quit "), 0, 3, anchorLeft = 1, padding = (0,1,0,0))
-
-          return [Label(""), elements]
-
-      def remote_storage_configuration_page(self, screen):
-          elements = Grid(2, 8)
-          heading = Label("Remote Storage")
-          heading.setColors(customColorset(1))
-          elements.setField(heading, 0, 0, anchorLeft = 1)
-          elements.setField(Label(" "), 0, 1, anchorLeft = 1)
-          elements.setField(Label("iSCSI Initiator Name:"), 0, 2, anchorLeft = 1)
-          self.iscsi_initiator_config = Entry(50, "")
-          elements.setField(self.iscsi_initiator_config, 0, 3, anchorLeft = 1, padding =(0,0,0,11))
-          current_iscsi_initiator_name = get_current_iscsi_initiator_name()
-          if current_iscsi_initiator_name is not None:
-              self.iscsi_initiator_config.set(current_iscsi_initiator_name)
-          return [Label(""), elements]
-
-      def menuSpacing(self):
-          menu_option = self.menu_list.current()
-          if menu_option > self.last_option:
-              self.menu_list.setCurrent(self.last_option)
-          elif menu_option % 2 == 0:
-              if self.menuo < menu_option:
-                  self.menu_list.setCurrent(menu_option+1)
-              else:
-                  self.menu_list.setCurrent(menu_option-1)
-          self.menuo = self.menu_list.current()
-
-      def process_network_config(self):
-          if self.net_hostname.value() == "":
-              augtool("set", "/files/etc/sysconfig/network/HOSTNAME", "")
-              os.system("hostname \"" + self.net_hostname.value()+"\"")
-          elif self.net_hostname.value() != self.current_hostname and is_valid_hostname(self.net_hostname.value()):
-              augtool("set", "/files/etc/sysconfig/network/HOSTNAME", self.net_hostname.value())
-              os.system("hostname " + self.net_hostname.value())
-          ovirt_store_config("/etc/sysconfig/network")
-          dns_servers = ""
-          ntp_servers = ""
-          if not self.dns_host1.value() == "":
-              dns_servers += self.dns_host1.value()
-          if not self.dns_host2.value() == "":
-              dns_servers += "," + self.dns_host2.value()
-          if not self.ntp_host1.value() == "":
-              ntp_servers += self.ntp_host1.value()
-          if not self.ntp_host2.value() == "":
-              ntp_servers += "," + self.ntp_host2.value()
-          if not dns_servers == "":
-              augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_DNS", '"' + dns_servers + '"')
-          if not ntp_servers == "":
-              augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_NTP", '"' + ntp_servers + '"')
-          network = Network()
-          if len(dns_servers) > 0:
-              network.configure_dns()
-          if len(ntp_servers) > 0:
-              network.configure_ntp()
-              network.save_ntp_configuration()
-          self.net_apply_config = 1
-          return
-
-      def process_nic_config(self):
-          self._create_warn_screen()
-          warn = ButtonChoiceWindow(self.screen, "Confirm Network Settings", "Network Configuration may take a few moments, proceed?")
-          self.reset_screen_colors()
-          if warn == "ok":
-              self._create_blank_screen()
-              gridform = GridForm(self.screen, "", 2, 2)
-              gridform.add(Label("Verifying Networking Configuration"), 0, 0)
-              progress_bar = Scale(50,100)
-              gridform.add(progress_bar, 0, 1)
-              progress_bar.set(25)
-              gridform.draw()
-              self.screen.refresh()
-              msg = ""
-              if self.static_ipv4_nic_proto.value() == 1:
-                  if self.ipv4_netdevip.value() == "":
-                      msg = "  - IPv4 Address\n"
-                  if self.ipv4_netdevmask.value() == "":
-                      msg += "  - IPv4 Netmask Address\n"
-                  if self.ipv4_netdevgateway.value() == "":
-                      msg = "  - IPv4 Gateway Address\n"
-                  augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_IP_ADDRESS", '"' + self.ipv4_netdevip.value() + '"')
-                  augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_IP_NETMASK", '"' + self.ipv4_netdevmask.value() + '"')
-                  augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_IP_GATEWAY", '"' + self.ipv4_netdevgateway.value() + '"')
-
-              if self.static_ipv6_nic_proto.value() == 1:
-                  if self.ipv6_netdevmask.value() == "":
-                      msg += "  - IPv6 Netmask Address\n"
-                  if self.ipv6_netdevgateway.value() == "":
-                      msg += "  - IPv6 Gateway Address\n"
-                  # left out gateway check to prevent multiple ones
-              if msg != "":
-                  msg = "Please Input:\n" + msg
-                  self._create_warn_screen()
-                  warn = ButtonChoiceWindow(self.screen, "Network Settings", msg, buttons = ['Ok'])
-                  self.__nic_config_failed = 1
-                  self.ipv4_current_netdevip = self.ipv4_netdevip.value()
-                  self.ipv4_current_netdevmask = self.ipv4_netdevmask.value()
-                  self.ipv4_current_netdevgateway = self.ipv4_netdevgateway.value()
-                  self.reset_screen_colors()
-                  return
-              else:
-                  # if exists remove static keys from dictionary
-                  if OVIRT_VARS.has_key("OVIRT_IP_ADDRESS"):
-                      del OVIRT_VARS["OVIRT_IP_ADDRESS"]
-                  if OVIRT_VARS.has_key("OVIRT_IP_NETMASK"):
-                      del OVIRT_VARS["OVIRT_IP_NETMASK"]
-                  if OVIRT_VARS.has_key("OVIRT_IP_GATEWAY"):
-                      del OVIRT_VARS["OVIRT_IP_GATEWAY"]
-                  if OVIRT_VARS.has_key("OVIRT_IPV6"):
-                      del OVIRT_VARS["OVIRT_IPV6"]
-                  if OVIRT_VARS.has_key("OVIRT_ADDRESS"):
-                      del OVIRT_VARS["OVIRT_IPV6_ADDRESS"]
-                  if OVIRT_VARS.has_key("OVIRT_IPV6_NETMASK"):
-                      del OVIRT_VARS["OVIRT_IPV6_NETMASK"]
-                  if OVIRT_VARS.has_key("OVIRT_IPV6_GATEWAY"):
-                      del OVIRT_VARS["OVIRT_IPV6_GATEWAY"]
-                  if OVIRT_VARS.has_key("OVIRT_VLAN"):
-                      del OVIRT_VARS["OVIRT_VLAN"]
-
-              gridform = GridForm(self.screen, "", 2, 2)
-              gridform.add(Label("Configuring Networking"), 0, 0)
-              progress_bar = Scale(50,100)
-              gridform.add(progress_bar, 0, 1)
-              progress_bar.set(50)
-              gridform.draw()
-              self.screen.refresh()
-
-              augtool("rm", "/files/" + OVIRT_DEFAULTS + "/OVIRT_BOOTIF", "")
-              if self.netvlanid.value() == "":
-                  augtool("rm", "/files/" + OVIRT_DEFAULTS + "/OVIRT_VLAN", "")
-              if self.disabled_ipv4_nic_proto.value() == 1:
-                  augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_BOOTIF", '"' + self.nic_lb.current() + '-DISABLED"')
-              else:
-                  augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_BOOTIF", '"' + self.nic_lb.current() + '"')
-              augtool("rm", "/files/" + OVIRT_DEFAULTS + "/OVIRT_IP_ADDRESS", "")
-              augtool("rm", "/files/" + OVIRT_DEFAULTS + "/OVIRT_IP_NETMASK", "")
-              augtool("rm", "/files/" + OVIRT_DEFAULTS + "/OVIRT_IP_GATEWAY", "")
-              augtool("rm", "/files/" + OVIRT_DEFAULTS + "/OVIRT_IPV6" ,"")
-              augtool("rm", "/files/" + OVIRT_DEFAULTS + "/OVIRT_IPV6_ADDRESS", "")
-              augtool("rm", "/files/" + OVIRT_DEFAULTS + "/OVIRT_IPV6_NETMASK", "")
-              augtool("rm", "/files/" + OVIRT_DEFAULTS + "/OVIRT_IPV6_GATEWAY", "")
-
-              msg = ""
-              if self.static_ipv4_nic_proto.value() == 1:
-                  if self.ipv4_netdevip.value() == "":
-                      msg = "  - IPv4 Address\n"
-                  if self.ipv4_netdevmask.value() == "":
-                      msg += "  - IPv4 Netmask Address\n"
-                  if self.ipv4_netdevgateway.value() == "":
-                      msg = "  - IPv4 Gateway Address\n"
-                  augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_IP_ADDRESS", '"' + self.ipv4_netdevip.value() + '"')
-                  augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_IP_NETMASK", '"' + self.ipv4_netdevmask.value() + '"')
-                  augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_IP_GATEWAY", '"' + self.ipv4_netdevgateway.value() + '"')
-
-              if self.static_ipv6_nic_proto.value() == 1:
-                  if self.ipv6_netdevmask.value() == "":
-                      msg += "  - IPv6 Netmask Address\n"
-                  if self.ipv6_netdevgateway.value() == "":
-                      msg += "  - IPv6 Gateway Address\n"
-                  # left out gateway check to prevent multiple ones
-              if msg != "":
-                  msg = "Please Input:\n" + msg
-                  self._create_warn_screen()
-                  warn = ButtonChoiceWindow(self.screen, "Network Settings", msg, buttons = ['Ok'])
-                  self.__nic_config_failed = 1
-                  self.ipv4_current_netdevip = self.ipv4_netdevip.value()
-                  self.ipv4_current_netdevmask = self.ipv4_netdevmask.value()
-                  self.ipv4_current_netdevgateway = self.ipv4_netdevgateway.value()
-                  self.reset_screen_colors()
-                  return
-              else:
-                  # if exists remove static keys from dictionary
-                  if OVIRT_VARS.has_key("OVIRT_IP_ADDRESS"):
-                      del OVIRT_VARS["OVIRT_IP_ADDRESS"]
-                  if OVIRT_VARS.has_key("OVIRT_IP_NETMASK"):
-                      del OVIRT_VARS["OVIRT_IP_NETMASK"]
-                  if OVIRT_VARS.has_key("OVIRT_IP_GATEWAY"):
-                      del OVIRT_VARS["OVIRT_IP_GATEWAY"]
-                  if OVIRT_VARS.has_key("OVIRT_IPV6"):
-                      del OVIRT_VARS["OVIRT_IPV6"]
-                  if OVIRT_VARS.has_key("OVIRT_ADDRESS"):
-                      del OVIRT_VARS["OVIRT_IPV6_ADDRESS"]
-                  if OVIRT_VARS.has_key("OVIRT_IPV6_NETMASK"):
-                      del OVIRT_VARS["OVIRT_IPV6_NETMASK"]
-                  if OVIRT_VARS.has_key("OVIRT_IPV6_GATEWAY"):
-                      del OVIRT_VARS["OVIRT_IPV6_GATEWAY"]
-
-              if self.netvlanid.value() != "":
-                  augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_VLAN", '"' + self.netvlanid.value() + '"')
-              if self.dhcp_ipv6_nic_proto.value() == 1:
-                  augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_IPV6", '"' + "dhcp" + '"')
-              if self.auto_ipv6_nic_proto.value() == 1:
-                  augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_IPV6", '"' + "auto" + '"')
-              if self.static_ipv6_nic_proto.value() == 1:
-                  augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_IPV6", '"' + "static" + '"')
-                  if self.ipv6_netdevip.value():
-                      augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_IPV6_ADDRESS", '"' + self.ipv6_netdevip.value() + '"')
-                  if self.ipv6_netdevmask.value():
-                      augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_IPV6_NETMASK", '"' + self.ipv6_netdevmask.value() + '"')
-                  if self.ipv6_netdevgateway.value():
-                      augtool("set", "/files/" + OVIRT_DEFAULTS + "/OVIRT_IPV6_GATEWAY", '"' + self.ipv6_netdevgateway.value() + '"')
-
-              network = Network()
-              network.configure_interface()
-              gridform = GridForm(self.screen, "", 2, 2)
-              gridform.add(Label("Enabling Network Configuration"), 0, 0)
-              progress_bar = Scale(50,100)
-              gridform.add(progress_bar, 0, 1)
-              progress_bar.set(75)
-              gridform.draw()
-              self.screen.refresh()
-              network.save_network_configuration()
-              self.screen.popWindow()
-              self.net_apply_config = 1
-              return
-          else:
-              self.__nic_config_failed = 1
-              return
-
-      def process_authentication_config(self):
-          self.screen.setColor("BUTTON", "black", "red")
-          self.screen.setColor("ACTBUTTON", "blue", "white")
-          ssh_restart = False
-          if self.root_password_1.value() != "" or self.root_password_2.value() != "":
-              if self.root_password_1.value() != self.root_password_2.value():
-                  ButtonChoiceWindow(self.screen, "Remote Access", "Passwords Do Not Match", buttons = ['Ok'])
-              else:
-                  set_password(self.root_password_1.value(), "admin")
-                  ButtonChoiceWindow(self.screen, "Remote Access", "Password Successfully Changed", buttons = ['Ok'])
-                  logger.info("Admin Password Changed")
-          if self.ssh_passwd_status.value() == 1 and self.current_ssh_pwd_status == 0:
-              self.current_ssh_pwd_status = augtool("set","/files/etc/ssh/sshd_config/PasswordAuthentication", "yes")
-              ssh_restart = True
-          elif self.ssh_passwd_status.value() == 0 and self.current_ssh_pwd_status == 1:
-              self.current_ssh_pwd_status = augtool("set","/files/etc/ssh/sshd_config/PasswordAuthentication", "no")
-              ssh_restart = True
-          if ssh_restart:
-              os.system("service sshd restart &>/dev/null")
-              ButtonChoiceWindow(self.screen, "Remote Access", "SSH Restarted", buttons = ['Ok'])
-              logger.info("SSH service restarted")
-              ovirt_store_config("/etc/ssh/sshd_config")
-          self.reset_screen_colors()
-          return True
-
-      def process_logging_config(self):
-          ovirt_rsyslog(self.syslog_server.value(), self.syslog_port.value(), "udp")
-          ovirt_netconsole(self.netconsole_server.value(), self.netconsole_server_port.value())
-          set_logrotate_size(self.logrotate_max_size.value())
-          return True
-
-      def process_locked_screen(self):
-          auth = PAM.pam()
-          auth.start("passwd")
-          auth.set_item(PAM.PAM_USER, self.login_username)
-          global login_password
-          login_password = self.login_password.value()
-          auth.set_item(PAM.PAM_CONV, pam_conv)
-          try:
-              auth.authenticate()
-          except PAM.error, (resp, code):
-              logger.debug(resp)
-              return False
-          except:
-              logger.debug("Internal error")
-              return False
-          else:
-              self.screen_locked = False
-              self.__current_page = STATUS_PAGE
-              return True
-
-      def process_config(self):
-          self._create_blank_screen()
-          self._set_title()
-          self.gridform.add(Label("Applying Configuration"), 0, 0)
-          self.gridform.draw()
-          self.screen.refresh()
-          if self.__current_page == NETWORK_PAGE:
-              ret = self.process_network_config()
-          if self.__current_page == AUTHENTICATION_PAGE:
-              ret = self.process_authentication_config()
-          if self.__current_page == LOGGING_PAGE:
-              ret = self.process_logging_config()
-          if self.__current_page == NETWORK_DETAILS_PAGE:
-              ret = self.process_nic_config()
-          if self.__current_page == KDUMP_PAGE:
-              ret = self.process_kdump_config()
-          if self.__current_page == REMOTE_STORAGE_PAGE:
-              ret = self.process_remote_storage_config()
-          if self.__current_page == LOCKED_PAGE:
-              ret = self.process_locked_screen()
-          # plugin pages
-          plugin_page=FIRST_PLUGIN_PAGE
-          for p in self.plugins :
-              if self.__current_page == plugin_page:
-                  ret = p.action()
-                  break
-              plugin_page+=2
-              if plugin_page > LAST_PLUGIN_PAGE :
-                  # should not happen
-                  break
-          return
-
-      def process_kdump_config(self):
-          if self.kdump_nfs_type.value() == 1:
-              write_kdump_config(self.kdump_nfs_config.value())
-          if self.kdump_ssh_type.value() == 1:
-              write_kdump_config(self.kdump_ssh_config.value())
-              self.screen.popWindow()
-              self.screen.finish()
-              ret = os.system("clear;service kdump propagate")
-              if ret == 0:
-                  ovirt_store_config("/root/.ssh/kdump_id_rsa.pub")
-                  ovirt_store_config("/root/.ssh/kdump_id_rsa")
-                  ovirt_store_config("/root/.ssh/known_hosts")
-                  ovirt_store_config("/root/.ssh/config")
-          if self.kdump_restore_type.value() == 1:
-              restore_kdump_config()
-          ovirt_store_config("/etc/kdump.conf")
-          os.system("service kdump restart &> /dev/null")
-
-      def process_remote_storage_config(self):
-          set_iscsi_initiator(self.iscsi_initiator_config.value())
-
-      def start(self):
-            self.plugins = []
-            self.last_option = LAST_OPTION
-            for imp,mod,ispkg in pkgutil.iter_modules(ovirt_config_setup.__path__, "ovirt_config_setup."):
-                module = __import__(mod, fromlist="dummy")
-                self.plugins.append(module.get_plugin(self))
-                self.last_option+=2
-
-            active = True
-            # check for screenlock status
-            self.screen_locked = False
-            while active and (self.__finished == False):
-                logger.debug("Current Page: " + str(self.__current_page))
-                self._create_blank_screen()
-                screen = self.screen
-                # apply any colorsets that were provided.
-                self.set_console_colors()
-                screen.setColor(customColorset(1), "black", "magenta")
-                if self.__current_page == STATUS_PAGE:
-                    screen.pushHelpLine(" Use arrow keys to choose option, then press Enter to select it ")
-                else:
-                    screen.pushHelpLine(" ")
-                elements = self.get_elements_for_page(screen, self.__current_page)
-                gridform = GridForm(screen, "", 2, 1) # 5,2
-                self._set_title()
-                content = Grid(1, len(elements) + 3)
-                self.menuo = 1
-                self.menu_list = Listbox(16, width = 20, returnExit = 1, border = 0, showCursor = 0)
-                self.menu_list.append(" Status", 1)
-                self.menu_list.append("", 2)
-                self.menu_list.append(" Network", 3)
-                self.menu_list.append("", 4)
-                self.menu_list.append(" Security", 5)
-                self.menu_list.append("", 6)
-                self.menu_list.append(" Logging", 7)
-                self.menu_list.append("", 8)
-                self.menu_list.append(" Kernel Dump", 9)
-                self.menu_list.append("", 10)
-                self.menu_list.append(" Remote Storage", 11)
-                self.menu_list.append("", 12)
-                # plugin menu options
-                plugin_page=FIRST_PLUGIN_PAGE
-                for p in self.plugins :
-                    self.menu_list.append(" " + p.label(), plugin_page)
-                    self.menu_list.append("", plugin_page+1)
-                    plugin_page+=2
-                    if plugin_page > LAST_PLUGIN_PAGE :
-                        # should not happen
-                        raise "Too many plugins installed: max. %d are allowed." % ((LAST_PLUGIN_PAGE-FIRST_PLUGIN_PAGE)/2+1)
-                for filler in range(plugin_page, LAST_PLUGIN_PAGE):
-                    self.menu_list.append("", filler)
-                self.menu_list.setCallback(self.menuSpacing)
-                if self.__current_page != LOCKED_PAGE and self.__current_page != NETWORK_DETAILS_PAGE and self.__current_page != SUPPORT_PAGE:
-                    self.menu_list.setCurrent(self.__current_page)
-                if not self.screen_locked:
-                    if not self.__current_page == NETWORK_DETAILS_PAGE and not self.__current_page == SUPPORT_PAGE:
-                        gridform.add(self.menu_list, 0, 0, # was 1,0
-                                     anchorTop = 1, anchorLeft = 1,
-                                     growx = 0)
-                current_element = 0
-                for element in elements:
-                    content.setField(element, 0, current_element, anchorLeft = 1)
-                    current_element += 1
-                (fullwidth, fullheight) = _snack.size()
-                screen.height = fullheight
-                content.setField(Label(""), 0, current_element,
-                                 padding = ((fullwidth / 2) - 15, 0,
-                                            (fullwidth / 2) - 16, 0),
-                                 growx = 1)
-
-
-                current_element += 1
-                buttons = []
-                if self.__current_page == NETWORK_PAGE:
-                    buttons.append (["Flash Lights to Identify", IDENTIFY_BUTTON])
-                if self.__current_page != STATUS_PAGE and self.__current_page < 20 :
-                    buttons.append (["Apply", APPLY_BUTTON])
-                if self.__current_page == NETWORK_DETAILS_PAGE:
-                    buttons.append(["Back", BACK_BUTTON])
-                if self.__current_page == STATUS_PAGE:
-                    if not pwd_lock_check("admin"):
-                        buttons.append(["Lock", LOCK_BUTTON])
-                    buttons.append(["Log Off", LOG_OFF_BUTTON])
-                    buttons.append(["Restart", RESTART_BUTTON])
-                    buttons.append(["Power Off", POWER_OFF_BUTTON])
-                if self.__current_page == LOCKED_PAGE:
-                    buttons.append(["Unlock", UNLOCK_BUTTON])
-                if self.__current_page != STATUS_PAGE and self.__current_page < 20:
-                    buttons.append(["Reset", RESET_BUTTON])
-                if self.__current_page == SUPPORT_PAGE:
-                    buttons.append(["Back to Menu", MENU_BUTTON])
-                buttonbar = ButtonBar(screen, buttons, compact = 1)
-                if self.__current_page == LOCKED_PAGE:
-                    pad = 28
-                else:
-                    pad = 0
-                content.setField(buttonbar, 0, current_element, anchorLeft = 1, padding = (pad,0,0,0))
-                gridform.add(content, 1, 0, anchorTop = 1, padding = (2,0,0,0))
-                gridform.addHotKey("F2")
-                gridform.addHotKey("F8")
-                try:
-                    (top, left) = (1, 4)
-                    result = gridform.runOnce(top, left)
-                    menu_choice = self.menu_list.current()
-                    pressed = buttonbar.buttonPressed(result)
-                    self.menu_list.setCurrent(menu_choice)
-                    warn_message = ""
-                    try:
-                        conn = libvirt.openReadOnly(None)
-                        self.dom_count = conn.numOfDomains()
-                        conn.close()
-                    except:
-                        self.dom_count = "Failed to connect"
-                    if str(self.dom_count).isdigit():
-                        warn_message= "There are %s Virtual Machines running\n\n" % str(self.dom_count)
-                    else:
-                        warn_message= "Unable to verify any running vms\n\n"
-                    self.screen.setColor("BUTTON", "black", "red")
-                    self.screen.setColor("ACTBUTTON", "blue", "white")
-                    if pressed == IDENTIFY_BUTTON:
-                        os.system("ethtool -p " + self.nic_lb.current() + " 10")
-                    elif pressed == APPLY_BUTTON or pressed == UNLOCK_BUTTON:
-                        errors = []
-                        self.process_config()
-                    elif pressed == LOCK_BUTTON:
-                        self.__current_page = LOCKED_PAGE
-                    elif pressed == RESTART_BUTTON:
-                        self._create_warn_screen()
-                        warn = ButtonChoiceWindow(self.screen, "Confirm System Restart", warn_message + "This will restart the system, proceed?")
-                        if warn == "ok":
-                            screen.popWindow()
-                            screen.finish()
-                            os.system("reboot")
-                    elif pressed == POWER_OFF_BUTTON:
-                        self._create_warn_screen()
-                        warn = ButtonChoiceWindow(self.screen, "Confirm System Shutdown", warn_message + "This will shutdown the system, proceed?")
-                        if warn == "ok":
-                            screen.popWindow()
-                            screen.finish()
-                            os.system("/usr/bin/clear;shutdown -h now")
-                    elif pressed == LOG_OFF_BUTTON:
-                        # will exit and ovirt-admin-shell cleans up tty lockfile and drops to login
-                        sys.exit(2)
-                    if self.__current_page == LOCKED_PAGE:
-                        self.screen_locked = True
-                    elif result == "F8" and self.__current_page != LOCKED_PAGE:
-                        self.__current_page = SUPPORT_PAGE
-                    elif result == "F2" and self.__current_page != LOCKED_PAGE:
-                        self._create_warn_screen()
-                        warn = ButtonChoiceWindow(self.screen, "Support Shell", "This is for troubleshooting with support representatives. Do not use this option without guidance from support.")
-                        if warn == "ok":
-                            screen.popWindow()
-                            screen.finish()
-                            os.system("/usr/bin/clear;SHELL=/bin/bash /bin/bash")
-                    else:
-                        if self.__current_page == NETWORK_PAGE:
-                            if menu_choice == NETWORK_PAGE:
-                                if pressed == RESET_BUTTON:
-                                    self.__current_page = NETWORK_PAGE
-                                elif pressed == APPLY_BUTTON:
-                                    self.__current_page == NETWORK_PAGE
-                                else:
-                                    self.__current_page = NETWORK_DETAILS_PAGE
-                            else:
-                                self.__current_page = menu_choice
-                            if self.net_apply_config == 1:
-                                self.net_apply_config = 0
-                        elif self.__current_page == NETWORK_DETAILS_PAGE:
-                            if pressed == BACK_BUTTON:
-                                self.__current_page = NETWORK_PAGE
-                            elif self.net_apply_config == 1:
-                                self.__current_page = NETWORK_PAGE
-                            elif self.__nic_config_failed == 1:
-                                self.__current_page = NETWORK_DETAILS_PAGE
-                            elif is_managed():
-                                self.__current_page = NETWORK_PAGE
-                            else:
-                               self.__current_page = menu_choice
-                        elif self.__current_page == SUPPORT_PAGE:
-                           logger.debug("Pressed: " + str(pressed))
-                           if pressed == MENU_BUTTON:
-                               self.__current_page = STATUS_PAGE
-                           else:
-                               f = self.log_menu_list.current()
-                               screen.popWindow()
-                               screen.finish()
-                               os.system("/usr/bin/clear;SHELL=/bin/false /usr/bin/less -R " + f)
-                        else:
-                            self.__current_page = menu_choice
-                except Exception, error:
-                    self.screen.setColor("BUTTON", "black", "red")
-                    self.screen.setColor("ACTBUTTON", "blue", "white")
-                    os.remove(lockfile)
-                    ButtonChoiceWindow(screen,
-                                       "An Exception Has Occurred",
-                                       str(error) + "\n" + traceback.format_exc(),
-                                       buttons = ["OK"])
-                screen.popWindow()
-                screen.finish()
-                self.restore_console_colors()
-
-if __name__ == "__main__":
-    if is_rescue_mode():
-        print "Unable to run setup in rescue mode"
-        sys.exit(1)
-    elif is_booted_from_local_disk() or "--force" in sys.argv:
-        if manual_setup() and "--force" not in sys.argv:
-            print "Unable to run setup manually, Run \"exit\" to return to setup"
-        else:
-            tty = get_ttyname()
-            lockfile = "/tmp/ovirt-setup.%s" % tty
-            f = open(lockfile, "w").close()
-            screen = NodeConfigScreen()
-            screen.start()
-    else:
-        print "Setup must be run after installation and reboot"
-        sys.exit(1)
 
+++ /dev/null
-#!/bin/bash
-#
-# Configure snmpd
-. /usr/libexec/ovirt-functions
-
-trap '__st=$?; stop_log; exit $__st' 0
-trap 'exit $?' 1 2 13 15
-
-warn() { printf '%s\n' "$*" >&2; }
-
-if ! is_local_storage_configured; then
-    warn "Local storage must be configured prior to configuring SNMP."
-    exit 99
-fi
-
-enable_snmpd() {
-    local password=$1
-    local CONF=/var/lib/net-snmp/snmpd.conf
-    ovirt_store_config /etc/sysconfig/snmpd /var/lib/net-snmp/ >/dev/null
-
-    service snmpd stop
-    # reset snmpd options to defaults, image has "-v" to prevent snmpd start
-    sed -c -ie '/^OPTIONS/d' /etc/sysconfig/snmpd
-    if [ -e $CONF ]; then
-         sed -c -ie '/^createUser root/d' $CONF
-    fi
-    echo "createUser root SHA $password AES" >> $CONF
-    service snmpd start
-}
-
-disable_snmpd() {
-    service snmpd stop > /dev/null
-    while umount /etc/sysconfig/snmpd; do : ; done 2> /dev/null
-    remove_config /etc/sysconfig/snmpd > /dev/null
-}
-
-if [[ "$1" == "AUTO" ]]; then
-    if [ -n "${OVIRT_SNMP_PASSWORD}" ]; then
-        enable_snmpd $OVIRT_SNMP_PASSWORD
-    fi
-else
-    ask_yes_or_no "Enable SNMP agent ([Y]es/[N]o/[A]bort)?" true true
-    case $? in
-        0)
-            while true; do
-                printf "\n"
-                read -p "Enter password for SNMPv3 USM 'root' user: " -esr
-                password1="$REPLY"
-                printf "\n"
-                read -p "Confirm password: " -esr
-                password="$REPLY"
-                if [ "$password1" = "$password" ]; then break; fi
-            done
-            printf "\n"
-            enable_snmpd $password ;;
-        1) disable_snmpd ;;
-        2) ;;
-    esac
-    printf "\n"
-fi
 
+++ /dev/null
-#!/bin/bash
-#
-# To automate the partitioning, set OVIRT_VOL_* in /etc/default/ovirt and call
-# ovirt-config-storage AUTO
-#
-# All sizes are in megabytes
-#
-
-. /usr/libexec/ovirt-functions
-
-ME=$(basename "$0")
-warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
-die() { warn "$*"; exit 1; }
-
-trap '__st=$?; stop_log; exit $__st' 0
-trap 'exit $?' 1 2 13 15
-
-# check that we're not booted from local storage; if so then exit with an error
-if is_booted_from_local_disk; then
-    die "You cannot configure storage on a running system. Please boot from CD/USB to configure storage."
-fi
-
-default_overcommit=0.5
-default_boot_size=50
-default_root_size=256
-default_config_size=5
-default_logging_size=2048
-# -1 indicates data partition should use remaining disk
-default_data_size=-1
-default_swap2_size=0
-default_data2_size=0
-boot_min_size=50
-root_min_size=256
-config_min_size=5
-logging_min_size=5
-data_min_size=5
-swap_min_size=5
-default_efi_size=256
-
-# return sd name for given #:# identifier
-get_sd_name() {
-    local id="$1"
-    local device_sys=$(grep -H "^$id$" /sys/block/*/dev | cut -d: -f1)
-
-    if [ -n "$device_sys" ]; then
-        echo $(basename $(dirname "$device_sys"))
-        return 0
-    fi
-    return 1
-}
-
-# gets the dependent block devices for multipath devices
-get_multipath_deps() {
-    local mpath_device="$(basename "$1")"
-    local deplist_var="$2"
-    local deplist=""
-
-    if [[ ! "$1" =~ '/dev/mapper' ]]; then
-        evel $deplist_var=$(basename $1)
-        return
-    fi
-    #get dependencies for multipath device
-    local deps=$(dmsetup deps -u "mpath-$mpath_device" \
-    | sed -r 's/\(([0-9]+), ([0-9]+)\)/\1:\2/g' \
-    | sed 's/ /\n/g' | grep [0-9]:[0-9] )
-
-    for dep in $deps
-    do
-        local device="$(get_sd_name "$dep")"
-        if [ -n "$device" ]; then
-            if [ -z "$deplist" ]; then
-                deplist="$device"
-            else
-                deplist="$deplist $device"
-            fi
-        fi
-    done
-
-    eval $deplist_var='$deplist'
-}
-
-#get Multipath device for given /dev/sdX device
-#return sdX device if no multipath device
-translate_multipath_device() {
-    #trim so that only sdX is stored, but support passing /dev/sdX
-    local dev="$1"
-    local dm_dev
-
-    if [ -z "$dev" ]; then
-        return 1
-    fi
-    if [[ "$dev" =~ "/dev/mapper" ]]; then
-        echo "$dev"
-        return 0
-    elif [[ "$dev" =~ "/dev/cciss" ]]; then
-        #rename to cciss!device
-        dev2="cciss\!$(basename "$dev")"
-        dm_dev="/dev/$(basename $(ls -d /sys/block/$dev2/holders/dm* | head -n1))"
-        if [ -z "$dm_dev" ]; then
-            echo "$dev"
-            return
-        fi
-    else
-
-        if ! multipath -ll "$dev" 2>&1 >/dev/null; then
-            echo "$dev"
-            return
-        fi
-        dm_dev=/dev/$(multipath -ll "$dev" | egrep dm-[0-9]+ | sed -r 's/^.* (dm-[0-9]+) .*$/\1/')
-    fi
-
-    local mpath_device=$(get_dm_device "$dm_dev")
-
-    if [ -z "$mpath_device" ]; then
-        echo "$dev"
-    else
-        echo "$mpath_device"
-    fi
-}
-
-
-get_drive_size()
-{
-    local drive="$1"
-    local space_var="$2"
-
-    local size=$(sfdisk -s "$drive" 2>/dev/null)
-    size=$(echo "scale=0; $size / 1024" | bc -l)
-
-    echo "$drive ($size MB)"
-    if [ -n "$space_var" ]; then
-        eval $space_var="$size"
-    fi
-}
-
-check_partition_sizes()
-{
-    local disk_size need_size
-
-    local min_data_size="$DATA_SIZE"
-    if [ "$DATA_SIZE" = -1 ]; then
-        min_data_size=5
-    fi
-    local min_data2_size="$DATA2_SIZE"
-    if [ "$DATA2_SIZE" = -1 ]; then
-        min_data2_size=5
-    fi
-
-    printf "\n"
-    if [ "$OVIRT_ISCSI_ENABLED" = "y" ]; then
-        get_drive_size "$BOOTDRIVE" BOOTDRIVESPACE
-        drive_list="BOOT"
-        BOOT_NEED_SIZE="$BOOT_SIZE"
-    else
-        get_drive_size "$ROOTDRIVE" ROOTDRIVESPACE
-        oldIFS="$IFS"
-        IFS="$SEP"
-        for drv in $HOSTVGDRIVE; do
-            get_drive_size "$drv" DRIVESPACE
-            if [ -n "${HOSTVGDRIVESPACE}" ]; then
-                HOSTVGDRIVESPACE=$(echo "scale=0;" \
-                                 "$HOSTVGDRIVESPACE + $DRIVESPACE" | bc -l)
-            else
-                HOSTVGDRIVESPACE=$DRIVESPACE
-            fi
-        done
-        if [ -n "${APPVGDRIVE}" ]; then
-            for drv in $APPVGDRIVE; do
-                get_drive_size "$drv" DRIVESPACE
-                if [ -n "${APPVGDRIVESPACE}" ]; then
-                    APPVGDRIVESPACE=$(echo "scale=0;" \
-                                     "$APPVGDRIVESPACE + $DRIVESPACE" | bc -l)
-                else
-                    APPVGDRIVESPACE=$DRIVESPACE
-                fi
-            done
-            APPVG_NEED_SIZE=$(echo "scale=0; $SWAP2_SIZE + $min_data2_size" | bc -l)
-        fi
-        IFS="$oldIFS"
-        ROOT_NEED_SIZE=$(echo "scale=0; $ROOT_SIZE * 2 + $EFI_SIZE"| bc -l)
-        HOSTVG_NEED_SIZE=$(echo "scale=0;" \
-                         "$SWAP_SIZE + $CONFIG_SIZE + $LOGGING_SIZE + $min_data_size" | bc -l)
-
-        if [ "$ROOTDRIVE" = "$HOSTVGDRIVE" ]; then
-            drive_list="ROOT"
-            ROOT_NEED_SIZE=$(echo "scale=0; $ROOT_SIZE * 2 + $HOSTVG_NEED_SIZE"| bc -l)
-        else
-            drive_list="ROOT HOSTVG"
-            oldIFS="$IFS"
-            IFS="$SEP"
-            for drv in $HOSTVGDRIVE; do
-                # XXX first in hostvgdrive list is assumed to be rootdrive
-                if [ "$ROOTDRIVE" = "$drv" ]; then
-                    HOSTVGDRIVESPACE=$(echo "scale=0; $HOSTVGDRIVESPACE - $ROOT_NEED_SIZE"| bc -l)
-                fi
-                break
-            done
-            IFS="$oldIFS"
-        fi
-        if [ -n "${APPVGDRIVE}" ]; then
-            drive_list="${drive_list} APPVG"
-        fi
-    fi
-
-    for drive in $drive_list; do
-        drive_need_size=$(eval "echo \${$(echo ${drive}_NEED_SIZE)"})
-        drive_disk_size=$(eval "echo \${$(echo ${drive}DRIVESPACE)"})
-
-        if [ $drive_need_size -gt $drive_disk_size ]; then
-            local gap_size=$(echo "scale=0; $drive_need_size-$drive_disk_size;" | bc -l)
-            printf "\n"
-            printf "=============================================================\n"
-            printf "The target storage device is too small for the desired sizes:\n"
-            printf " Disk Target: $drive \n"
-            printf " Size of target storage device: $drive_disk_size MB\n"
-            printf " Total storage size to be used: $drive_need_size MB\n"
-            printf "\n"
-            printf "You need an additional $gap_size MB of storage.\n"
-            printf "\n"
-            return 1
-        else
-            printf "Required Space : $drive_need_size MB\n\n"
-        fi
-    done
-}
-
-manual_input()
-{
-    local manual_device
-    local return_var="$1"
-    while true; do
-        read -rp "Enter disk device path: " manual_device
-        if [ -z "$manual_device" ]; then
-            return 1
-        fi
-        manual_device="$(translate_multipath_device "$manual_device")"
-        if [ -n "$manual_device" ]; then
-            if [ -b "$(readlink -f "$manual_device")" ]; then
-                eval $return_var="$manual_device"
-                return 0
-            fi
-        else
-            return 1
-        fi
-    done
-}
-
-# Find a usable/selected storage device.
-# If there are none, give a diagnostic and return nonzero.
-# If there is just one, e.g., /dev/sda, treat it as selected (see below).
-# and return 0.  If there are two or more, make the user select one
-# or decline.  Upon decline, return nonzero. Otherwise, print the
-# selected name, then return 0.
-# Sample output: /dev/sda
-get_dev_name()
-{
-    local devices=""
-    # list separator
-    for d in $(ls -db /sys/block/[hsv]d*); do
-        devices="/dev/$(basename "$d")${LF}${devices}"
-    done
-
-    local byid_list=$(find /dev/disk/by-id -mindepth 1 -not -name '*-part*' 2>/dev/null)
-    for d in $byid_list; do
-        local devicename="$(readlink -f "$d")"
-        if udevadm info --name="$(basename "$devicename")" --query=property | grep -q ^ID_BUS; then
-            devices="${devicename}${LF}${devices}"
-        fi
-    done
-
-    # FIXME: workaround for detecting cciss devices
-    for d in $(ls /dev/cciss/ 2>/dev/null); do
-        if [[ ! "$d" =~ p[0-9]+\$ ]]; then
-            devices="/dev/cciss/$d${LF}${devices}"
-        fi
-    done
-
-    # include multipath devices
-    local devs_to_remove=""
-    oldIFS="$IFS"
-    IFS="$LF"
-    for d in $(dmsetup ls --target=multipath | cut -f1)
-    do
-        devices="/dev/mapper/$d${LF}${devices}"
-        local sd_devs=""
-        IFS="$oldIFS" get_multipath_deps "/dev/mapper/$d" sd_devs
-        local dm_dev=$(multipath -ll "$d" | grep "$d" | sed -r 's/^.*(dm-[0-9]+ ).*$/\1/' )
-        devs_to_remove="${devs_to_remove} ${sd_devs} ${dm_dev} "
-        #  example: ++ devs_to_remove=' sda dm-2 '
-    done
-    # Remove /dev/sd* devices that are part of a multipath device
-    local dev_list=""
-    for d in $devices
-    do
-        if [[ ! "$devs_to_remove" =~ "$(basename "$d") " ]]; then
-            dev_list="$d${LF}$dev_list"
-        fi
-    done
-    devices=$(echo "$dev_list" | sort -u | grep -v "^$")
-    local num_devices=$(echo "$devices" | wc -l)
-
-    # If there's only one device, use it.
-    case $num_devices in
-        0) warn "ERROR: found no usable block device"; IFS="$oldIFS"; return 1;;
-        1) echo "$devices"; IFS="$oldIFS"; return 0;;
-        *) ;; # found more than one
-    esac
-
-    # There are two or more; make the user choose.
-    # display description for each disk
-    for d in $devices; do
-        get_drive_size "$d" >&2
-    done
-    local rc=0
-    local choices="$devices${LF}Abort${LF}Manual Selection"
-    select device in $choices
-    do
-        test "$device" = Abort && rc=1
-        test "$device" = "Manual Selection" && manual_input device
-        test "$device" = "Manual Selection" && rc=1
-        test -z "$device" && continue
-        test $rc = 0 && echo "$device"
-        break
-    done
-    IFS="$oldIFS"
-    return $rc
-}
-
-do_configure()
-{
-    local name_and_size
-    if [ "$OVIRT_ISCSI_ENABLED" = "y" ]; then
-        printf "\n\nPlease select the disk to use for the Boot partition.\n\n"
-        BOOTDRIVE="$(get_dev_name)" || return 0
-        get_drive_size "$BOOTDRIVE" BOOTDRIVESPACE
-        echo "$BOOTDRIVE"
-        OVIRT_ISCSI_HOSTVG="y"
-        printf "\n\nPlease select the disk to use for the HostVG.\n\n"
-        HOSTVGDRIVE=$(get_dev_name) || return 0
-        get_drive_size "$HOSTVGDRIVE" HOSTVGDRIVESPACE
-        echo "$HOSTVGDRIVE"
-    else
-        printf "\n\nPlease select the disk to use for the Root.\n\n"
-        ROOTDRIVE=$(get_dev_name) || return 0
-        get_drive_size "$ROOTDRIVE" ROOTDRIVESPACE
-        if ask_yes_or_no "Will Root be shared with other nodes ([Y]es/[N]o)?"; then
-            OVIRT_SHARED_ROOT="y"
-            if ask_yes_or_no "Partition and install Root?"; then
-                OVIRT_ROOT_INSTALL="y"
-            else
-                OVIRT_ROOT_INSTALL="n"
-            fi
-        else
-            OVIRT_SHARED_ROOT="n"
-            OVIRT_ROOT_INSTALL="y"
-        fi
-
-    augtool <<EOF
-        set /files$OVIRT_DEFAULTS/OVIRT_SHARED_ROOT $OVIRT_SHARED_ROOT
-        set /files$OVIRT_DEFAULTS/OVIRT_ROOT_INSTALL $OVIRT_ROOT_INSTALL
-EOF
-
-        printf "\n\nPlease select the disk to use for the HostVG.\n\n"
-        while true; do
-            HOSTVGDRIVE=$(get_dev_name) || return 0
-            if [ "$OVIRT_SHARED_ROOT" = "y" ]; then
-                if [ "$ROOTDRIVE" = "$HOSTVGDRIVE" ]; then
-                    printf "\n\nRoot Drive and HostVG drive must be different when shared\n\n"
-                    return 1
-                else
-                    break;
-                fi
-            fi
-            break;
-        done
-
-        local skipped=false
-        if check_existing_hostvg "$HOSTVGDRIVE" devs; then
-            oldIFS="$IFS"
-            IFS="$SEP"
-            for dev in $devs
-            do
-                printf "Removing HostVG on $dev will erase the drive and cannot be undone\n"
-                if ask_yes_or_no "Do you want to remove HostVG from $dev (y/n)?"; then
-                    start_log
-                    if ! wipe_lvm_on_disk "$dev"; then
-                        stop_log
-                        IFS="$oldIFS"
-                        return 1
-                    fi
-                    stop_log
-                else
-                    skipped=true
-                fi
-            done
-            IFS="$oldIFS"
-        fi
-        $skipped  && printf "Installation cannot proceed with existing HostVG.\n" && return 0
-        get_drive_size "$HOSTVGDRIVE" HOSTVGDRIVESPACE
-        echo "$HOSTVGDRIVESPACE"
-    fi
-    printf "\n\nPlease configure storage partitions.\n\n"
-    printf "* Enter partition sizes in MB.\n"
-    printf "* A value of 0 indicates the partition should be disabled.\n"
-    printf "* If the partition is enabled, it will have a minimum valid size.\n"
-    printf "* Size remaining value is approximate due to cylinder rounding\n"
-    printf "  during partitioning.\n"
-    printf "* For the Data partition, a size of -1 indicates that the\n"
-    printf "  partition should use up the remaining space on the disk.\n\n"
-
-    if do_review; then
-        if ask_yes_or_no "Use these default values ([Y]es/[N]o)?"; then
-            return
-        fi
-    else
-        printf "Selected disk is too small for default storage configuration"
-    fi
-
-    local space_left=$HOSTVGDRIVESPACE
-    if [ "$OVIRT_ISCSI_ENABLED" = "y" -a "$OVIRT_ISCSI_HOSTVG" != "y" ]; then
-        partlist=""
-        local space_left=$BOOTDRIVESPACE
-    elif [ "$OVIRT_ISCSI_ENABLED" = "y" -a "$OVIRT_ISCSI_HOSTVG" = "y" ]; then
-        partlist="swap config logging data"
-        local space_left=$BOOTDRIVESPACE
-    elif [ "$OVIRT_ROOT_INSTALL" = "n" ]; then
-        partlist="swap config logging data"
-    else
-        partlist="swap config logging data"
-    fi
-    for part in $partlist ; do
-        part_regexp="^0$"
-        if [ "$part" = "data" ]; then
-            part_regexp="^\-1|0$"
-        fi
-        uc=$(echo $part|tr '[[:lower:]]' '[[:upper:]]')
-        size_var=${uc}_SIZE
-        eval "size=\$$size_var"
-        min_size_var=${part}_min_size
-        eval "min_size=\$$min_size_var"
-
-        while true; do
-            printf "\n"
-            read -ep "Change $part partition size. (Def. ${size}MB), Min. ${min_size}MB, Max. ~${space_left}MB? or Q to quit "
-            mb_input=$REPLY
-            test -z "$mb_input" && mb_input=$size
-            local size_used=0
-            if [ $mb_input = "q" -o $mb_input = "Q" ]; then
-                printf "Aborting"
-                return
-            elif [[ $mb_input =~ ^-*[0-9]+$ ]]; then
-                if [[ $mb_input -ge $min_size || $mb_input =~ $part_regexp ]] \
-                    && [[ $mb_input -le $space_left ]] ; then
-                    eval "$size_var=$mb_input"
-                    size_used=$mb_input
-                    break;
-                else
-                    printf "invalid $part size: $mb_input.  "
-                    printf "Does not fall into specified range.\n"
-                fi
-            else
-                printf "invalid $part size: '$mb_input'.\n"
-            fi
-        done
-        space_left=$(echo "scale=0;$space_left - $size_used" | bc -l)
-    done
-
-    if ! check_partition_sizes; then
-        printf "Please try partitioning again.\n"
-        ROOTDRIVE=
-        return 1
-    fi
-
-    # save input variables
-    augtool <<EOF
-set /files$OVIRT_DEFAULTS/OVIRT_VOL_BOOT_SIZE $BOOT_SIZE
-set /files$OVIRT_DEFAULTS/OVIRT_VOL_SWAP_SIZE $SWAP_SIZE
-set /files$OVIRT_DEFAULTS/OVIRT_VOL_ROOT_SIZE $ROOT_SIZE
-set /files$OVIRT_DEFAULTS/OVIRT_VOL_CONFIG_SIZE $CONFIG_SIZE
-set /files$OVIRT_DEFAULTS/OVIRT_VOL_LOGGING_SIZE $LOGGING_SIZE
-set /files$OVIRT_DEFAULTS/OVIRT_VOL_DATA_SIZE $DATA_SIZE
-EOF
-
-   if [ -n "$BOOTDRIVE" ]; then
-       augtool <<EOF
-set /files$OVIRT_DEFAULTS/OVIRT_INIT_BOOT "$BOOTDRIVE"
-EOF
-   else
-   augtool <<EOF
-set /files$OVIRT_DEFAULTS/OVIRT_INIT "$ROOTDRIVE"
-EOF
-   fi
-}
-
-do_review()
-{
-    if [[ -z "$ROOTDRIVE" && "$OVIRT_ISCSI_ENABLED" != "y" ]]; then
-        printf "\nNo Root storage device selected.\n"
-        return 1
-    fi
-
-    if [[ -z "$HOSTVGDRIVE" ]]; then
-        printf "\nNo HostVG storage device selected.\n"
-        return 1
-    fi
-    local is_negative=0
-
-    local data_size_display="$DATA_SIZE MB"
-    if [ "$DATA_SIZE" = -1 ]; then
-
-        if [ "$ROOTDRIVE" = "$HOSTVGDRIVE" ]; then
-            local remaining_mb=$(( $ROOTDRIVESPACE - $SWAP_SIZE \
-                    - $ROOT_SIZE * 2 - $CONFIG_SIZE - $LOGGING_SIZE ))
-            test $remaining_mb -lt 0 && is_negative=1
-        else
-            local remaining_mb=$(( $HOSTVGDRIVESPACE - $SWAP_SIZE - $CONFIG_SIZE - $LOGGING_SIZE ))
-            test $remaining_mb -lt 0 && is_negative=1
-        fi
-        data_size_display="$remaining_mb MB"
-    fi
-
-    if [ "$OVIRT_ISCSI_ENABLED" != "y" ]; then
-        cat <<EOF
-
-The selected disk will be repartitioned as follows:
-================================================
-                   Root Drive: $(get_drive_size "$ROOTDRIVE")
-                 HostVG Drive: $(get_drive_size "$HOSTVGDRIVE")
-          Swap partition size: $SWAP_SIZE MB
-  Installation partition size: $ROOT_SIZE * 2 MB
- Configuration partition size: $CONFIG_SIZE MB
-       Logging partition size: $LOGGING_SIZE MB
-          Data partition size: $data_size_display
-
-EOF
-    else
-        cat <<EOF
-
-The selected disk will be repartitioned as follows:
-================================================
-                   Boot Drive: $(get_drive_size "$BOOTDRIVE")
-          Boot partition size: $BOOT_SIZE
-
-EOF
-
-    fi
-        if [ "$OVIRT_ISCSI_HOSTVG" = "y" ]; then
-            cat <<EOF
-                HostVG Drive: $(get_drive_size "$HOSTVGDRIVE")
-          Swap partition size: $SWAP_SIZE MB
-  Installation partition size: $ROOT_SIZE * 2 MB
- Configuration partition size: $CONFIG_SIZE MB
-       Logging partition size: $LOGGING_SIZE MB
-          Data partition size: $data_size_display
-EOF
-        fi
-    return ${is_negative-0}
-
-}
-
-#Check for an existing VG on any device on the system.
-# Return 0 if there is a VG found, unless only one found is on $1
-# Return 1 if no VG found or only found on $1
-check_existing_hostvg()
-{
-    local install_dev=
-    local dev=
-    oldIFS="$IFS"
-    IFS="$SEP"
-    for dev in $1; do
-        if [ -n "${install_dev}" ]; then
-            install_dev="${install_dev}+|${dev}"
-            # XXX +| => wrong match e.g. sdaa vs sda ?
-        else
-            install_dev="${dev}"
-        fi
-    done
-    IFS="$oldIFS"
-    local devices_var=$2
-    local vgname=
-    if [ -n "$3" ]; then
-        vgname="$3"
-    else
-        vgname="HostVG"
-    fi
-
-    if [ -z "$install_dev" ]; then
-        devices="$(pvs --separator="${TAB}" -o pv_name,vg_name --noheadings | \
-            grep "${vgname}" | cut -f1)"
-    else
-        devices="$(pvs --separator="${TAB}" -o pv_name,vg_name --noheadings | \
-            egrep -v "${install_dev}" | grep "${vgname}" | cut -f1)"
-    fi
-    rc=1
-    if [ -n "$devices" ]; then
-        printf "\n"
-        printf "There appears to already be an installation on another device:\n"
-        oldIFS="$IFS"
-        IFS="$LF"
-        for device in $devices; do
-            printf "\t$device\n"
-        done
-        IFS="$oldIFS"
-        printf "The installation cannot proceed until the device is removed\n"
-        printf "from the system of the HostVG volume group is removed.\n"
-        rc=0
-    fi
-
-    test -n "$devices_var" && eval "$devices_var"="\"$devices\""
-
-    return $rc
-}
-
-# cleanup lvms on selected disk
-# - remove mounted filesystems
-# - remove LVM volumes and groups
-wipe_lvm_on_disk()
-{
-    local devs=${1-"$HOSTVGDRIVE"}
-    local query1=
-    local query2=
-    unmount_logging
-    unmount_config /etc/default/ovirt
-#    local part_delim="p"
-#    if [[ "$dev" =~ /dev/[hsv]d ]]; then
-#        part_delim=""
-#    fi
-    oldIFS="$IFS"
-    IFS="$SEP"
-    for d in $devs; do
-        local part_delim="p"
-        if [[ "$d" =~ "/dev/sd" ]]; then
-            part_delim=""
-        fi
-        if [ -n "${query1}" ]; then
-           query1="${query1} ${d} ${d}${part_delim}[0-9]*"
-        else
-           query1="${d} ${d}${part_delim}[0-9]*"
-        fi
-        if [ -n "${query2}" ]; then
-           query2="${query2}+|${d}${part_delim}[0-9]+|${d}"
-        else
-           query2="${d}${part_delim}[0-9]+|${d}"
-        fi
-    done
-    IFS="$oldIFS"
-    for vg in $(pvs -o vg_uuid --noheadings "$query1" 2>/dev/null|sort -u); do
-
-#    for vg in $(pvs -o vg_uuid --noheadings $dev $dev${part_delim}[0-9]* \
-#        --config " devices { filter = [ \"a/.*/\" ] } "  \
-#        2>/dev/null|sort -u); do
-        if pvs -o pv_name,vg_uuid --noheadings \
-            --config " devices { filter = [ \"a/.*/\" ] } " | \
-            grep "$vg" | egrep -v -q "${query2} " 2>/dev/null; then
-
-#            grep "$vg" | egrep -v -q "${dev}${part_delim}[0-9]+|${dev} " 2>/dev/null; then
-            log "The volume group \"$vg\" spans multiple disks."
-            log "This operation cannot complete.  Please manually"
-            log "cleanup the storage using standard linux tools."
-            return 1
-        fi
-        vg_name=$(vgs -o vg_name,vg_uuid --noheadings \
-            --config " devices { filter = [ \"a|$dev|\", \"r/.*/\" ] } " \
-            2>/dev/null | grep -w "$vg" | awk '{print $1}')
-        wipe_volume_group "${vg_name}" "$dev"
-    done
-    return 0
-}
-
-reread_partitions()
-{
-    local drive="$1"
-    udevadm settle 2> /dev/null
-
-    if [[ "$drive" =~ "/dev/mapper" ]]; then
-        # kpartx -a -p p "$drive"
-        # XXX fails with spaces in device names (TBI)
-        # ioctl(3, DM_TABLE_LOAD, 0x966980) = -1 EINVAL (Invalid argument)
-        # create/reload failed on 0QEMU    QEMU HARDDISK   drive-scsi0-0-0p1
-
-        # flush to sync DM and blockdev, workaround from rhbz#623846#c14
-        echo 3 > /proc/sys/vm/drop_caches
-        set +e
-        until partprobe "$drive"; do
-            log "retrying partprobe"
-            sleep 1
-        done
-        set -e
-    else
-        # ioctl 0x0000125F   BLKRRPART    void
-        set +e
-        until blockdev --rereadpt "$drive"; do
-            log "retrying blockdev"
-            sleep 1
-        done
-        set -e
-    fi
-}
-
-create_hostvg()
-{
-    log "Creating LVM partition(s) for HostVG"
-    local drv
-    local parted_cmd
-    oldIFS="$IFS"
-    IFS="$SEP"
-    local physical_vols=
-    for drv in $HOSTVGDRIVE; do
-        if [ "$ROOTDRIVE" = "$drv" ]; then
-            parted_cmd="mkpart primary ext2 ${RootBackup_end}M -1"
-            hostvgpart="4"
-        elif [ "$BOOTDRIVE" = "$drv" ]; then
-            parted_cmd="mkpart primary ext2 ${boot_size_si} -1"
-            hostvgpart="2"
-            # FIXME : set for gtpsync/parted compat for now
-            ROOTDRIVE=$BOOTDRIVE
-        else
-            parted_cmd="mkpart primary ext2 2048s -1"
-            hostvgpart="1"
-        fi
-        while true; do
-            set +e
-            parted -s "$drv" "$parted_cmd"
-            parted -s "$drv" "set $hostvgpart lvm on"
-            set -e
-            reread_partitions "$drv"
-            if [ -e "${drv}${hostvgpart}" -o "${drv}p${hostvgpart}" ]; then
-                break
-            fi
-        done
-
-        # sync GPT to the legacy MBR partitions
-        if [ "${OVIRT_INSTALL_ROOT}" = "y" ]; then
-            if [ "gpt" = "$LABEL_TYPE" ]; then
-                log "Running gptsync to create legacy mbr"
-                gptsync "$ROOTDRIVE"
-            fi
-        fi
-
-        partpv="${drv}${hostvgpart}"
-        if [ ! -e "$partpv" ]; then
-            # e.g. /dev/cciss/c0d0p2 or /dev/mapper/<wwid>p3
-            partpv="${drv}p${hostvgpart}"
-        fi
-        log "Creating physical volume"
-        for count in $(seq 1 10); do
-            if [ ! -e "$partpv" ]; then
-                sleep 1
-                if [[ "$count" == "10" && ! -e "$partpv" ]]; then
-                    log "$partpv is not available!"
-                    exit 1
-                fi
-            fi
-        done
-        dd if=/dev/zero of="${partpv}" bs=1024k count=1
-        pvcreate -ff -y "${partpv}"
-        physical_vols="${physical_vols}${SEP}${partpv}"
-    done
-
-    log "Creating volume group HostVG"
-    local is_first=1
-    for drv in $physical_vols; do
-        if [ -z "$drv" ]; then
-            continue
-        fi
-        if [ "$is_first" ]; then
-            vgcreate HostVG "$drv"
-            is_first=
-        else
-            vgextend HostVG "$drv"
-        fi
-    done
-    IFS="$oldIFS"
-
-    if [ "$SWAP_SIZE" -gt 0 ]; then
-        log "Creating swap partition"
-        lvcreate --name Swap --size ${SWAP_SIZE}M /dev/HostVG
-        if [ -n "${OVIRT_CRYPT_SWAP}" ]; then
-            echo "SWAP /dev/HostVG/Swap /dev/mapper/ovirt-crypt-swap ${OVIRT_CRYPT_SWAP}" >> /etc/ovirt-crypttab
-        else
-            mkswap -L "SWAP" /dev/HostVG/Swap
-            echo "/dev/HostVG/Swap swap swap defaults 0 0" >> /etc/fstab
-        fi
-    fi
-    if [ "$CONFIG_SIZE" -gt 0 ]; then
-        log "Creating config partition"
-        lvcreate --name Config --size ${CONFIG_SIZE}M /dev/HostVG
-        mke2fs -j -t ext4 /dev/HostVG/Config -L "CONFIG"
-        tune2fs -c 0 -i 0 /dev/HostVG/Config
-    fi
-    if [ "$LOGGING_SIZE" -gt 0 ]; then
-        log "Creating log partition"
-        lvcreate --name Logging --size ${LOGGING_SIZE}M /dev/HostVG
-        mke2fs -j -t ext4 /dev/HostVG/Logging -L "LOGGING"
-        tune2fs -c 0 -i 0 /dev/HostVG/Logging
-        echo "/dev/HostVG/Logging /var/log ext4 defaults,noatime 0 0" >> /etc/fstab
-    fi
-
-    local use_data=1
-    if [ "$DATA_SIZE" -eq -1 ]; then
-        log "Creating data partition with remaining free space"
-        lvcreate --name Data -l 100%FREE /dev/HostVG
-        use_data=0
-    elif [ "$DATA_SIZE" -gt 0 ]; then
-        log "Creating data partition"
-        lvcreate --name Data --size ${DATA_SIZE}M /dev/HostVG
-        use_data=0
-    fi
-
-    if [ "$use_data" = 0 ]; then
-        mke2fs -j -t ext4 /dev/HostVG/Data -L "DATA"
-        tune2fs -c 0 -i 0 /dev/HostVG/Data
-        echo "/dev/HostVG/Data /data ext4 defaults,noatime 0 0" >> /etc/fstab
-        echo "/data/images /var/lib/libvirt/images bind bind 0 0" >> /etc/fstab
-        echo "/data/core /var/log/core bind bind 0 0" >> /etc/fstab
-    fi
-
-    # end critical section
-    set +x
-    set +e
-
-    log "Mounting config partition"
-    if mount_config; then
-        ovirt_store_config /etc/fstab
-    fi
-
-    mount_logging
-    if [ "$use_data" = 0 ]; then
-        log "Mounting data partition"
-        mount_data
-    fi
-    log "Completed HostVG!"
-
-}
-
-create_appvg()
-{
-    log "Creating LVM partition(s) for AppVG"
-    local drv
-    local physical_vols=
-    oldIFS="$IFS"
-    IFS="$SEP"
-    for drv in $APPVGDRIVE; do
-        wipe_partitions "$drv"
-        reread_partitions "$drv"
-        log "Labeling Drive: $drv"
-        appvgpart="1"
-        while true; do
-            set +e
-            parted -s "$drv" "mklabel ${LABEL_TYPE} mkpart primary ext2 2048s -1 set $appvgpart lvm on print"
-            set -e
-            reread_partitions "$drv"
-            if [ -e "${drv}${appvgpart}" -o "${drv}p${appvgpart}" ]; then
-                break
-            fi
-        done
-
-        partpv="${drv}${appvgpart}"
-        if [ ! -e "$partpv" ]; then
-            # e.g. /dev/cciss/c0d0p2
-            partpv="${drv}p${appvgpart}"
-        fi
-        log "Creating physical volume"
-        if [ ! -e "$partpv" ]; then
-            log "$partpv is not available!"
-            exit 1
-        fi
-        dd if=/dev/zero of="${partpv}" bs=1024k count=1
-        pvcreate -ff -y "${partpv}"
-        physical_vols="${physical_vols}${SEP}${partpv}"
-    done
-
-    log "Creating volume group AppVG"
-    local is_first=1
-    for drv in $physical_vols; do
-        if [ -z "$drv" ]; then
-            continue
-        fi
-        if [ "$is_first" ]; then
-            vgcreate AppVG "$drv"
-            is_first=
-        else
-            vgextend AppVG "$drv"
-        fi
-    done
-    IFS="$oldIFS"
-
-    if [ "$SWAP2_SIZE" -gt 0 ]; then
-        log "Creating swap2 partition"
-        lvcreate --name Swap2 --size ${SWAP2_SIZE}M /dev/AppVG
-        if [ -n "${OVIRT_CRYPT_SWAP2}" ]; then
-            echo "SWAP2 /dev/AppVG/Swap2 /dev/mapper/ovirt-crypt-swap2 ${OVIRT_CRYPT_SWAP2}" >> /etc/ovirt-crypttab
-        else
-            mkswap -L "SWAP2" /dev/AppVG/Swap2
-            echo "/dev/AppVG/Swap2 swap swap defaults 0 0" >> /etc/fstab
-        fi
-    fi
-
-    local use_data=1
-    if [ "$DATA2_SIZE" -eq -1 ]; then
-        log "Creating data2 partition with remaining free space"
-        lvcreate --name Data2 -l 100%FREE /dev/AppVG
-        use_data=0
-    elif [ "$DATA2_SIZE" -gt 0 ]; then
-        log "Creating data2 partition"
-        lvcreate --name Data2 --size ${DATA2_SIZE}M /dev/AppVG
-        use_data=0
-    fi
-
-    if [ "$use_data" = 0 ]; then
-        mke2fs -j -t ext4 /dev/AppVG/Data2 -L "DATA"
-        tune2fs -c 0 -i 0 /dev/AppVG/Data2
-        echo "/dev/AppVG/Data2 /data2 ext4 defaults,noatime 0 0" >> /etc/fstab
-    fi
-
-    if [ "$use_data" = 0 ]; then
-        log "Mounting data2 partition"
-        mount_data2
-    fi
-    log "Completed AppVG!"
-
-}
-
-perform_partitioning()
-{
-    if [ -z "$HOSTVGDRIVE" -a "$OVIRT_ISCSI_ENABLED" != "y" ]; then
-        printf "\nNo storage device selected.\n"
-        return
-    fi
-
-    if [ -z "$BOOTDRIVE" -a "$OVIRT_ISCSI_ENABLED" = "y" ]; then
-        printf "\nNo storage device selected.\n"
-        return
-    fi
-    start_log
-
-    log "Saving parameters"
-    unmount_config /etc/default/ovirt
-
-    log "Removing old LVM partitions"
-    wipe_volume_group HostVG
-    wipe_volume_group AppVG
-    wipe_lvm_on_disk "$HOSTVGDRIVE"
-    [ -n "${APPVGDRIVE}" ] && wipe_lvm_on_disk "$APPVGDRIVE"
-    wipe_lvm_on_disk "$ROOTDRIVE"
-
-    # begin critical section
-    set -e
-    set -x
-
-    MEM_SIZE_MB=$(echo "scale=0; $MEM_SIZE_MB / 1024;" | bc -l)
-    boot_size_si=$(echo "scale=0; $BOOT_SIZE * (1024 * 1024) / (1000 * 1000)" | bc -l)
-
-    if [ "$OVIRT_ISCSI_ENABLED" = "y" ]; then
-        log "iSCSI enabled, partitioning boot drive: $BOOTDRIVE"
-        wipe_partitions "$BOOTDRIVE"
-        reread_partitions "$BOOTDRIVE"
-        log "Creating boot partition"
-        while true; do
-            set +e
-            parted -s "$BOOTDRIVE" "mklabel ${LABEL_TYPE} mkpart primary ext2 2048s ${boot_size_si}M"
-            set -e
-            reread_partitions "$BOOTDRIVE"
-            if [ -e "${BOOTDRIVE}1" -o "${BOOTDRIVE}p1" ]; then
-                break
-            fi
-        done
-        partboot="${BOOTDRIVE}1"
-        if [ ! -e "$partboot" ]; then
-            partboot="${BOOTDRIVE}p1"
-        fi
-        # sleep to ensure filesystems are created before continuing
-        sleep 10
-        mke2fs "${partboot}" -L Boot
-        tune2fs -c 0 -i 0 "${partboot}"
-        if [ "$OVIRT_ISCSI_HOSTVG" = "y" ]; then
-            # XXX Can iscsi hostvg span multiple drives?
-            # for drv in $HOSTVGDRIVE
-            log "Partitioning root drive: $HOSTVGDRIVE"
-            wipe_partitions "$HOSTVGDRIVE"
-            reread_partitions "$HOSTVGDRIVE"
-            log "Labeling Drive: $HOSTVGDRIVE"
-            set +e
-            until parted -s "$HOSTVGDRIVE" "mklabel ${LABEL_TYPE}"; do
-                log "retrying iscsi-hostvg:mklabel"
-                sleep 1
-            done
-            set -e
-            create_hostvg
-        fi
-        log "Completed!"
-        return
-    fi
-
-    if [ "$OVIRT_ROOT_INSTALL" = "y" ]; then
-        log "Partitioning root drive: $ROOTDRIVE"
-        wipe_partitions "$ROOTDRIVE"
-        reread_partitions "$ROOTDRIVE"
-        log "Creating Root and RootBackup Partitions"
-        let RootBackup_end=${ROOT_SIZE}*2+${EFI_SIZE}
-        let Root_end=${ROOT_SIZE}+${EFI_SIZE}
-        while true; do
-            set +e
-            parted -s "$ROOTDRIVE" "mklabel ${LABEL_TYPE} mkpart primary fat32 2048s ${EFI_SIZE}M mkpart primary ext2 ${EFI_SIZE} ${Root_end}M mkpart primary ext2 ${Root_end}M ${RootBackup_end}M"
-            set -e
-            reread_partitions "$ROOTDRIVE"
-            if [ -e "${ROOTDRIVE}3" -o -e "${ROOTDRIVE}p3" ]; then
-                break
-            fi
-        done
-        partefi="${ROOTDRIVE}1"
-        partroot="${ROOTDRIVE}2"
-        partrootbackup="${ROOTDRIVE}3"
-        if [ ! -e "$partroot" ]; then
-            partefi="${ROOTDRIVE}p1"
-            partroot="${ROOTDRIVE}p2"
-            partrootbackup="${ROOTDRIVE}p3"
-        fi
-        ln -snf "${partefi}" /dev/disk/by-label/EFI
-        mkfs.vfat "${partefi}" -n EFI
-        ln -snf "${partroot}" /dev/disk/by-label/Root
-        mke2fs -t ext2 "${partroot}" -L Root
-        tune2fs -c 0 -i 0 "${partroot}"
-        ln -snf "${partrootbackup}" /dev/disk/by-label/RootBackup
-        mke2fs -t ext2 "${partrootbackup}" -L RootBackup
-        tune2fs -c 0 -i 0 "${partrootbackup}"
-    fi
-
-    oldIFS="$IFS"
-    IFS="$SEP"
-    for drv in $HOSTVGDRIVE; do
-        if [ "$ROOTDRIVE" != "$drv" ]; then
-            wipe_partitions "$drv"
-            reread_partitions "$drv"
-            log "Labeling Drive: $drv"
-            set +e
-            until parted -s "$drv" "mklabel ${LABEL_TYPE}"; do
-                log "retrying hostvg:mklabel"
-                sleep 1
-            done
-            set -e
-        fi
-    done
-    IFS="$oldIFS"
-
-    create_hostvg
-    [ -n "${APPVGDRIVE}" ] && create_appvg
-    if [ -n "${OVIRT_CRYPT_SWAP2}" -o -n "${OVIRT_CRYPT_SWAP}" ]; then
-        ovirt_store_config /etc/ovirt-crypttab
-    fi
-    stop_log
-}
-
-do_confirm()
-{
-
-    if [[ -z "$ROOTDRIVE" && "$OVIRT_ISCSI_ENABLED" != "y" ]]; then
-        printf "\nNo Root storage device selected.\n"
-        return
-    fi
-
-    if [[ -z "$HOSTVGDRIVE" ]]; then
-        printf "\nNo HostVG storage device selected.\n"
-        return
-    fi
-
-    while true; do
-        sp='                                                    '
-        w='!!WARNING'
-        wb="$w"'!!'
-        w8="$w$w$w$w$w$w$w$w"
-        printf '%s!!\n' \
-          "$w8" \
-          "$w8" \
-          "$wb$sp$w" \
-          "$wb$sp$w" \
-          "$wb    If you proceed, all data on your selected storage  $w" \
-          "$wb    device will be destroyed and your hard disk        $w" \
-          "$wb    will be irreversably reconfigured                  $w" \
-          "$wb$sp$w" \
-          "$wb$sp$w" \
-        "$w8" \
-        "$w8"
-
-        if ask_yes_or_no "Do you wish to proceed ([Y]es/[N]o)?"; then
-            if check_partition_sizes; then
-                perform_partitioning
-                exit 0
-            fi
-        else
-            return
-        fi
-        # store networking config since it was created before storage was established for iscsi targets
-        if [ "$OVIRT_ISCSI_NETWORKING" = "y" ]; then
-            ovirt_store_config \
-        /etc/sysconfig/network-scripts/ifcfg* \
-        /etc/ntp.conf
-        fi
-    done
-}
-
-do_iscsi_target()
-{
-if ! network_up ; then
-    printf "Networking must be configured prior to configuring an iscsi target.\n\n"
-    # allow network config without setting up storage first
-    augtool <<EOF
-set /files/etc/default/ovirt/OVIRT_ISCSI_NETWORK_CONFIG y
-EOF
-    exit 99
-fi
-
-while true; do
-    OPTIONS="\"Target IP\" \"Target Port\"" #\"CHAP Username\" \"CHAP Password\""
-    printf "\nPress Enter to leave option blank or Q to quit (default Target Port is 3260)\n"
-    eval set $OPTIONS
-    PS3="Choose an option: "
-    for OPTION in "$@"; do
-        while true; do
-            read -ep "Enter $OPTION: "
-            if [ "$REPLY" = "q" -o "$REPLY" = "Q" ]; then
-                return
-            fi
-
-        if [ "$OPTION" = "Target IP" ]; then
-            if is_valid_ipv4 $REPLY; then
-                OVIRT_ISCSI_TARGET_IP="$REPLY"
-                break;
-            else
-                printf "\nThe address $REPLY is not a valid IPv4 address.\n"
-        fi
-
-            elif [ "$OPTION" = "Target Port" ]; then
-                OVIRT_ISCSI_TARGET_PORT="$REPLY"
-                if [ -z "$REPLY" ]; then
-                    OVIRT_ISCSI_TARGET_PORT="3260"
-                    break;
-                else
-                    break;
-                fi
-
-            elif [ "$OPTION" = "CHAP Username" ]; then
-                OVIRT_ISCSI_CHAP_USERNAME="$REPLY"
-                break
-
-            elif [ "$OPTION" = "CHAP Password" ]; then
-                OVIRT_ISCSI_CHAP_PASSWORD="$REPLY"
-                break;
-            fi
-        done
-    done
-
-    cat <<EOF
-
-The iSCSI target be configured as follows:
-================================================
-    Target IP:   $OVIRT_ISCSI_TARGET_IP
-  Target Port:   $OVIRT_ISCSI_TARGET_PORT
-
-EOF
-#     Username:   $OVIRT_ISCSI_CHAP_USERNAME
-#     Password:   $OVIRT_ISCSI_CHAP_PASSWORD
-#EOF
-
-if ask_yes_or_no "Is this correct ([Y]es/[N]o)?" true true; then
-
-    OVIRT_ISCSI_ENABLED="y"
-    augtool <<EOF
-set /files/etc/default/ovirt/OVIRT_ISCSI_ENABLED y
-set /files/etc/default/ovirt/OVIRT_ISCSI_TARGET_IP $OVIRT_ISCSI_TARGET_IP
-set /files/etc/default/ovirt/OVIRT_ISCSI_TARGET_PORT $OVIRT_ISCSI_TARGET_PORT
-EOF
-
-    if [[ -n "$OVIRT_ISCSI_CHAP_USERNAME" && -n "$OVIRT_ISCSI_CHAP_PASSWORD" ]]; then
-        log "setting iscsid.conf username/password"
-        augtool <<EOF
-set /files/etc/iscsi/iscsid.conf/node.session.auth.authmethod CHAP
-set /files/etc/iscsi/iscsid.conf/node.session.auth.username $OVIRT_ISCSI_CHAP_USERNAME
-set /files/etc/iscsi/iscsid.conf/node.session.auth.password $OVIRT_ISCSI_CHAP_PASSWORD
-set /files/etc/default/ovirt/OVIRT_ISCSI_CHAP_USERNAME $OVIRT_ISCSI_CHAP_USERNAME
-set /files/etc/default/ovirt/OVIRT_ISCSI_CHAP_PASSWORD $OVIRT_ISCSI_CHAP_PASSWORD
-EOF
-    fi
-
-    iscsiadm -p "$OVIRT_ISCSI_TARGET_IP:$OVIRT_ISCSI_TARGET_PORT" -m discovery -t sendtargets
-    log "Restarting iscsi service"
-    service iscsi restart
-
-ISCSI_NODE_NAMES="$(iscsiadm -m discovery -p $OVIRT_ISCSI_TARGET_IP:$OVIRT_ISCSI_TARGET_PORT -t sendtargets|awk {'print $2'})"
-
-printf "\n\n Select iSCSI target node\n\n" >&2
-select OVIRT_ISCSI_NODE_NAME in $ISCSI_NODE_NAMES ; do
-log " Selected Node Name: $OVIRT_ISCSI_NODE_NAME"
-break;
-done
-
-augtool <<EOF
-set /files/etc/default/ovirt/OVIRT_ISCSI_ENABLED y
-set /files/etc/default/ovirt/OVIRT_ISCSI_TARGET_IP $OVIRT_ISCSI_TARGET_IP
-set /files/etc/default/ovirt/OVIRT_ISCSI_TARGET_PORT $OVIRT_ISCSI_TARGET_PORT
-set /files/etc/default/ovirt/OVIRT_ISCSI_NODE_NAME $OVIRT_ISCSI_NODE_NAME
-EOF
-break;
-fi
-done
-
-if mount_iscsi_liveos; then
-    if ! [ -d /liveos/lib/modules/$(uname -r) ]; then
-        printf "Running kernel version does not match version installed to iscsi root file system, aborting\n\n"
-        exit 99
-    fi
-fi
-}
-
-cross_check_host_app()
-{
-oldIFS="$IFS"
-IFS="$SEP"
-for hdrv in $HOSTVGDRIVE; do
-    for adrv in $APPVGDRIVE; do
-        if [ "${hdrv}" = "${adrv}" ]; then
-            # Skip disk partitioning, AppVG overlaps with HostVG
-            IFS="$oldIFS"
-            return 1
-        fi
-    done
-done
-IFS="$oldIFS"
-return 0
-}
-
-MEM_SIZE_MB=$(awk '/MemTotal:/ { print $2 }' /proc/meminfo)
-case $MEM_SIZE_MB in
-    ''|*[^0-9]*) die failed to get system memory size;;
-esac
-MEM_SIZE_MB=$(echo "scale=0; $MEM_SIZE_MB / 1024;" | bc -l)
-
-overcommit=${OVIRT_OVERCOMMIT:-$default_overcommit}
-# we multiply the overcommit coefficient by 10 then divide the
-# product by 10 to avoid decimals in the result
-OVERCOMMIT_SWAP_SIZE=$(echo "scale=0; (${MEM_SIZE_MB} * (${overcommit} * 10))/10;" | bc -l)
-
-# add to the swap the amounts from http://kbase.redhat.com/faq/docs/DOC-15252
-MEM_SIZE_GB=$(echo "scale=0; $MEM_SIZE_MB/1024;" | bc -l)
-if [ $MEM_SIZE_GB -le 4 ]; then
-    BASE_SWAP_SIZE=2048
-elif [ $MEM_SIZE_GB -le 16 ]; then
-    BASE_SWAP_SIZE=4096
-elif [ $MEM_SIZE_GB -le 64 ]; then
-    BASE_SWAP_SIZE=8192
-else
-    BASE_SWAP_SIZE=16384
-fi
-
-CALC_SWAP_SIZE=$(echo "scale=0; ${BASE_SWAP_SIZE} + ${OVERCOMMIT_SWAP_SIZE};" | bc -l)
-
-BOOT_SIZE=$default_boot_size
-SWAP_SIZE=${OVIRT_VOL_SWAP_SIZE:-$CALC_SWAP_SIZE}
-ROOT_SIZE=$default_root_size
-CONFIG_SIZE=${OVIRT_VOL_CONFIG_SIZE:-$default_config_size}
-LOGGING_SIZE=${OVIRT_VOL_LOGGING_SIZE:-$default_logging_size}
-DATA_SIZE=${OVIRT_VOL_DATA_SIZE:-$default_data_size}
-SWAP2_SIZE=${OVIRT_VOL_SWAP2_SIZE:-$default_swap2_size}
-DATA2_SIZE=${OVIRT_VOL_DATA2_SIZE:-$default_data2_size}
-EFI_SIZE=${default_efi_size}
-
-if [ -n "$OVIRT_INIT" ]; then
-    # if present, use drive(s) selected with 'ovirt_init' boot parameter
-    ROOTDRIVE=
-    HOSTVGDRIVE=
-    oldIFS="$IFS"
-    IFS="$SEP"
-    for drv in $OVIRT_INIT; do
-        DRIVE="$(translate_multipath_device "$drv")"
-        if [ -z "$ROOTDRIVE" ]; then
-            # XXX assumes first is ROOTDRIVE
-            ROOTDRIVE="$DRIVE"
-        fi
-        if [ -n "$HOSTVGDRIVE" ]; then
-            HOSTVGDRIVE="$HOSTVGDRIVE${SEP}$DRIVE"
-        else
-            HOSTVGDRIVE="$DRIVE"
-        fi
-    done
-    IFS="$oldIFS"
-
-    OVIRT_ROOT_INSTALL="y"
-    get_drive_size "$ROOTDRIVE" ROOTDRIVESPACE
-fi
-
-if [ -n "$OVIRT_INIT_APP" ]; then
-    if [ ${SWAP2_SIZE} -ne 0 -o ${DATA2_SIZE} -ne 0 ]; then
-        APPVGDRIVE=
-        oldIFS="$IFS"
-        IFS="$SEP"
-        for drv in $OVIRT_INIT_APP; do
-            DRIVE="$(translate_multipath_device "$drv")"
-            if [ -n "$APPVGDRIVE" ]; then
-                APPVGDRIVE="$APPVGDRIVE${SEP}$DRIVE"
-            else
-                APPVGDRIVE="$DRIVE"
-            fi
-        done
-        IFS="$oldIFS"
-        cross_check_host_app || {
-            log "Skip disk partitioning, AppVG overlaps with HostVG"
-            exit 1
-        }
-    fi
-else
-    { [ ${SWAP2_SIZE} -ne 0 ] || [ $DATA2_SIZE -ne 0 ]; } && {
-        log "Missing device parameter for AppVG: unable to partition any disk"
-        exit 2
-    }
-fi
-
-# if the node is Fedora then use GPT, otherwise use MBR
-if [ -f /etc/fedora-release ]; then
-    LABEL_TYPE="gpt"
-else
-    LABEL_TYPE="msdos"
-fi
-
-if [ "$1" = "AUTO" ]; then
-    log "Beginning automatic disk partitioning."
-    if [ -n "$OVIRT_INIT" ]; then
-        # Logic for automatic partitioning
-        # If HostVG/AppVG exists on a disk other than $DRIVE, fail
-        # If HostVG/AppVG exists on $DRIVE, then partition only if
-        # firstboot is specified
-        # Else, partition
-        if check_existing_hostvg >/dev/null 2>&1 \
-            || check_existing_hostvg "" "" AppVG ; then
-            if check_existing_hostvg "$HOSTVGDRIVE"; then
-                log "HostVG exists on a separate disk"
-                log "Manual Intervention required"
-                exit 1
-            elif [ -n "$APPVGDRIVE" ] \
-              && check_existing_hostvg "$APPVGDRIVE"; then
-                log "AppVG exists on a separate disk"
-                log "Manual Intervention required"
-                exit 1
-            else
-                if is_firstboot; then
-                    if check_partition_sizes; then
-                        log "Partitioning hard disk..."
-                        perform_partitioning
-                        exit $?
-                    else
-                        log "storage_vol parameter can be used to reduce the size of partitions"
-                        log "e.g. storage_vol=:SWAP_SIZE_IN_MB"
-                        log "WARNING: you might have issues because you don't have enough swap"
-                        log "to meet suggested minimum swap size."
-                        exit 1
-                    fi
-                else
-                    echo "Disk is already partitioned and firstboot not specified, Skipping partitioning"
-                    exit 0
-                fi
-            fi
-        else
-            if check_partition_sizes; then
-                log "Partitioning hard disk..."
-                perform_partitioning
-                exit $?
-            else
-                log "storage_vol parameter can be used to reduce the size of partitions"
-                log "e.g. storage_vol=:SWAP_SIZE_IN_MB"
-                log "WARNING: you might have issues because you don't have enough swap"
-                log "to meet suggested minimum swap size."
-            fi
-        fi
-    else
-        log "Missing device parameter: unable to partition any disk"
-        exit 2
-    fi
-else
-    OPTIONS="\"Enable iSCSI Target\" \"Configure Storage\" \"Review\" \"Commit Changes And Quit\" \"Return To Menu\""
-    eval set $OPTIONS
-    PS3="Choose an option: "
-
-    while true; do
-        printf "\n\n Storage Configuration\n\n" >&2
-
-        select OPTION in "$@"
-        do
-            case "$OPTION" in
-                "Enable iSCSI Target") do_iscsi_target; break ;;
-                "Configure Storage") do_configure ; break ;;
-                "Review")    do_review    ; break ;;
-                "Commit Changes And Quit") do_confirm   ; break ;;
-                "Return To Menu")      printf "\nExiting.\n"; exit ;;
-            esac
-        done
-    done
-fi
 
+++ /dev/null
-#!/bin/bash
-#
-# ovirt-config-uninstall - destroys an installed copy of the oVirt node
-
-# SYNOPSIS
-# Destroys the HostVG volume group and logical volumes.
-#
-
-. /usr/libexec/ovirt-functions
-
-ME=$(basename "$0")
-warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
-die() { warn "$*"; exit 1; }
-
-trap '__st=$?; stop_log; exit $__st' 0
-trap 'exit $?' 1 2 13 15
-
-cat <<EOF
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!!                                                                           !!
-!! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !! WARNING !!
-!!                                                                           !!
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-   If you proceed, you will DESTROY any existing data relating to the oVirt
-   installation on this machine.
-
-EOF
-
-if ask_yes_or_no "Do you wish to continue and uninstall this node ([Y]es/[N]o)?"; then
-    if vgs --noheadings HostVG -o vg_name >/dev/null 2>&1; then
-        log "Uninstalling node"
-        log "Detaching logging"
-        start_log
-        # multipathd holds all mounts under /var in a private namespace
-        service multipathd stop 6>&- 7>&-
-        rm -f /var/lib/multipath/bindings
-        unmount_logging
-        unmount_config /etc/default/ovirt
-        # remove rootfs labels
-        for label in Root RootBackup RootUpdate RootNew; do
-            root="$(findfs LABEL=$label 2>/dev/null)"
-            if [ "$root" ]; then
-                e2label "$root" ""
-            fi
-            rm -f /dev/disk/by-label/$label
-        done
-        log "Removing volume groups"
-        wipe_volume_group HostVG
-        wipe_volume_group AppVG
-        #log "Removing partitions"
-        #wipe_partitions "$pv_dev"
-        #wipe_partitions "$root_dev"
-        #wipe_partitions "$root2_dev"
-
-        #restart multipath
-        multipath -F
-        multipath -v3
-        service multipathd start 6>&- 7>&-
-        log "Finished uninstalling node."
-        stop_log
-    else
-        log "There is no installed node instance to remove."
-        log "Aborting"
-        exit 1
-    fi
-else
-    log "Aborted"
-fi
 
+++ /dev/null
-#!/bin/bash
-#
-
-. /usr/libexec/ovirt-functions
-
-ME=$(basename "$0")
-warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
-die() { warn "$*"; exit 1; }
-
-trap '__st=$?; stop_log; exit $__st' 0
-trap 'exit $?' 1 2 13 15
-
-RETURN_TO_MENU="Return To Menu"
-
-OPTIONS[${#OPTIONS[*]}]="/var/log/ovirt.log"
-OPTIONS[${#OPTIONS[*]}]="/var/log/messages"
-OPTIONS[${#OPTIONS[*]}]="/var/log/secure"
-OPTIONS[${#OPTIONS[*]}]="$RETURN_TO_MENU"
-
-while true; do
-    printf "\nPlease select a log file to view.\n\n"
-    PS3="Please select a log to view: "
-    select OPTION in "${OPTIONS[@]}"
-    do
-        case $OPTION in
-            "$RETURN_TO_MENU") exit 0;;
-            "") break;;
-            *)
-                if [ -s "$OPTION" ]; then
-                    clear
-                    less -R "$OPTION"
-                    printf "\n\n"
-                else
-                    printf "$OPTION is empty\n\n"
-                fi
-                ;;
-        esac
-    done
-done
 
+++ /dev/null
-#!/bin/bash
-#
-# ovirt-early Start early ovirt services
-#
-# chkconfig: 23 01 99
-#
-### BEGIN INIT INFO
-# Provides: ovirt-early
-# Default-Start: 2 3 4 5
-# Dewscription: Managed node early configuration service
-### END INIT INFO
-
-# Source functions library
-. /etc/init.d/functions
-. /usr/libexec/ovirt-functions
-. /usr/libexec/ovirt-boot-functions
-
-prog=ovirt-early
-VAR_SUBSYS_OVIRT_EARLY=/var/lock/subsys/$prog
-
-BONDING_MODCONF_FILE=/etc/modprobe.d/bonding
-AUGTOOL_CONFIG=/var/tmp/augtool-config
-EARLY_DIR=/etc/ovirt-early.d
-
-get_mac_addresses() {
-    local DEVICE=$1
-
-    macs=""
-    devices=$(ls -b /sys/class/net/)
-    for device in $devices; do
-        if [ "$device" != "$DEVICE" ]; then
-            mac=$(cat /sys/class/net/$device/address 2>/dev/null)
-            if [ -n "$mac" -a "$mac" != "00:00:00:00:00:00" ]; then
-                macs="${macs}${mac}=${device},"
-            fi
-        fi
-    done
-}
-
-configure_ovirt_management_nic() {
-    DEVICE=$1
-
-    if [ -n "$DEVICE" ]; then
-        log "Configuring network"
-        if ! network_up ; then
-            log "Using interface $DEVICE"
-            # setup temporary interface to retrieve configuration
-            /sbin/dhclient -1 $1 \
-             && [ -f /var/run/dhclient.pid ] \
-             && kill $(cat /var/run/dhclient.pid)
-        fi
-        if [ $? -eq 0 ]; then
-            # from network-scripts/ifup-post
-            IPADDR=$(LC_ALL=C ip -o -4 addr ls dev ${DEVICE} | awk '{ print $4 ; exit }')
-            log "Interface brought up with $IPADDR"
-            eval $(ipcalc --silent --hostname ${IPADDR} ; echo "status=$?")
-            if [ "$status" = "0" ]; then
-                hostname $HOSTNAME
-                log "Hostname resolved to $HOSTNAME"
-                # retrieve remote config
-                find_srv ovirt tcp
-                if [ -n "$SRV_HOST" -a -n "$SRV_PORT" ]; then
-                    log "oVirt Server found at: $SRV_HOST:$SRV_PORT"
-                    cfgdb=$(mktemp)
-                    get_mac_addresses $DEVICE
-                    log "MACs to use: $macs"
-                    wget -O $cfgdb --no-check-certificate \
-                      "http://$SRV_HOST:$SRV_PORT/ovirt/managed_node/config?host=$(hostname)&macs=$macs"
-                    if [ $? -eq 0 ]; then
-                        log "Remote configuration bundle retrieved to $cfgdb"
-                        /usr/libexec/ovirt-process-config $cfgdb $BONDING_MODCONF_FILE $AUGTOOL_CONFIG
-                        if [ $? -eq 0 ]; then
-                            log "Remote configuration retrieved and applied"
-                            rm $cfgdb
-                        else
-                            log "Failure to retrieve or apply remote configuration"
-                        fi
-                    else
-                        log "Failed to retrieve configuration bundle"
-                    fi
-                fi
-            fi
-        fi
-    else
-        # for non-PXE boot when BOOTIF parameter is not specified
-        # otherwise default network config is invalid
-        DEVICE=eth0
-    fi
-    # default oVirt network configuration:
-    # bridge each ethernet device in the system
-    BRIDGE=br$DEVICE
-    local ifcfg=/etc/sysconfig/network-scripts/ifcfg-$BRIDGE
-
-    # only write a default file if one does not exist
-    if [ ! -f $ifcfg ]; then
-        log "Applying default configuration to $DEVICE and $BRIDGE"
-        printf '%s\n' "DEVICE=$DEVICE" ONBOOT=yes "BRIDGE=$BRIDGE" \
-            > /etc/sysconfig/network-scripts/ifcfg-$DEVICE
-        printf '%s\n' "DEVICE=$BRIDGE" "BOOTPROTO=dhcp" \
-            ONBOOT=yes TYPE=Bridge PEERNTP=yes DELAY=0 \
-            > /etc/sysconfig/network-scripts/ifcfg-$BRIDGE
-        log "Default config applied"
-    fi
-
-    service network restart
-
-}
-
-configure_management_interface() {
-    log "Configuring the manangement interface."
-    case $OVIRT_RUNTIME_MODE in
-        "ovirt")
-            configure_ovirt_management_nic $bootif
-            if [ -n "$init" ]; then
-                /usr/libexec/ovirt-config-storage AUTO
-                # initial configuration storage, after /config creation
-                ovirt_store_config \
-                    /etc/sysconfig/network-scripts/ifcfg-* \
-                    $BONDING_MODCONF_FILE
-                if [ $upgrade = 1 ]; then
-                    # local disk installation for managed mode
-                    mount_live
-                    /usr/libexec/ovirt-config-boot /live "$bootparams"
-                fi
-            fi
-            ;;
-        "managed")
-            if [ -x $MANAGEMENT_SCRIPTS_DIR/configure-management-interface ]; then
-                log "Executing $MANAGEMENT_SCRIPTS_DIR/configure-management-interface"
-                $MANAGEMENT_SCRIPTS_DIR/configure-management-interface
-            else
-                echo "No script to configure management interface found."
-            fi
-            ;;
-        "none")
-            log "Unmanaged node: no management interface to configure."
-    esac
-}
-
-start_ovirt_early () {
-    touch $VAR_SUBSYS_OVIRT_EARLY
-    # oVirt boot parameters
-    #   BOOTIF=link|eth*|<MAC> (appended by pxelinux)
-    #   storage_init=[usb|scsi[:serial#]|/dev/...]
-    #   storage_vol=BOOT_MB:SWAP_MB:ROOT_MB:CONFIG_MB:LOGGING_MB:DATA_MB
-    #   mem_overcommit=<overcommit_ratio>
-    #   upgrade
-    #   standalone
-    #   firstboot
-    #   ovirt_runtime_mode
-    #   rescue
-    #   pxelinux format: ip=<client-ip>:<boot-server-ip>:<gw-ip>:<netmask>
-    #   anaconda format: ip=<client-ip> netmask=<netmask> gateway=<gw-ip>
-    #   or               ip=dhcp|off
-    #   ipv6=dhcp|auto
-    #   dns=server[,server]
-    #   ntp=server[,server]
-    #   vlan=id
-    #   ssh_pwauth=[0|1]
-    #   syslog=server[:port]
-    #   collectd=server[:port]
-    #   hostname=fqdn
-    #   TBD logrotate maxsize
-    #   rhn_type=[classic|sam]
-    #   rhn_url=SATELLITE_URL
-    #   rhn_CA_CERT=CA_CERT_URL
-    #   rhn_username=RHN-USERNAME
-    #   rhn_password=RHN-PASSWORD
-    #   rhn_profile=RHNPROFILE
-    #   rhn_activationkey=ACTIVATIONKEY
-    # RHN registration, activation key takes precedence
-    #   rhn_proxy=PROXY-HOST:PORT
-    #   rhn_proxyuser=PROXY-USERNAME
-    #   rhn_proxypassword=PROXY-PASSWORD
-    #   snmp_password=<authpassphrase>
-
-    #   BOOTIF=link|eth*|<MAC> (appended by pxelinux)
-    # network boot interface is assumed to be on management network where
-    # management server is reachable
-    # BOOTIF=<MAC> e.g. BOOTIF=01-00-16-3e-12-34-57
-    # PXELINUX option IPAPPEND 2 in pxelinux.cfg appends MAC address
-    # of the booting node
-    # BOOTIF=link - take first eth for which ethtool reports link
-    # BOOTIF=eth* e.g. BOOTIF=eth0 - use given interface
-    bootif=
-
-    #   ovirt_init=HOSTVGDISK1[,HOSTVGDISK2...][;APPVGDISK1[,APPVGDISK2...]]
-    #   where DISK=[ata|cciss|scsi|usb[:serial#]|/dev/...]
-    # local installation target disks
-    # Allow specification of multiple disks per VG
-    # usb|scsi - select disk type, as reported by udev ID_BUS
-    # serial# - select exact disk using serial number, as reported by
-    #           udev ID_SERIAL
-    # e.g. ovirt_init=usb:Generic_STORAGE_DEVICE_0000145418-0:0
-    # /dev/... - use specified disk device
-    #            (for cases when HAL doesn't handle it)
-    # w/o value - grab the first disk (/dev/?da)
-    init=
-    init_app=
-
-    #   storage_vol=:SWAP_MB::CONFIG_MB:LOGGING_MB:DATA_MB:SWAP2_MB:DATA2_MB
-    #   or
-    #   storage_vol=size[,{Swap|Data|Config|Logging|Data2|Swap2}][:size...]
-    # local partition sizes in MB
-    # LVs ending in 2 go to AppVG, all the others fall into HostVG
-    vol_boot_size=
-    vol_swap_size=
-    vol_root_size=
-    vol_config_size=
-    vol_logging_size=
-    # data size can be set to 0 to disable data partition, -1 to use
-    # remaining free space after the other above partitions are defined
-    # or a specific positive number in MB
-    vol_data_size=
-
-    # swap2 and data2 will be placed into AppVG, 0 disables, data2
-    # can be -1 or a positive number in MB for each
-    vol_swap2_size=
-    vol_data2_size=
-
-    #   swap_encrypt={Swap|Swap2},cypher1[:cypher2...][;{Swap|Swap2}...]
-    # request swap encryption
-    # the default cypher is set to aes-cbc-essiv:sha256
-    crypt_swap=
-    crypt_swap2=
-
-    #   upgrade
-    # install/update oVirt Node image on the local installation target disk
-    upgrade=
-
-    #   mem_overcommit=<overcommit_ratio>
-    # set the swap size coefficient
-    overcommit=
-
-    #   standalone
-    # force oVirt Node standalone mode
-    standalone=1
-
-    #   firstboot
-    # force firstboot configuration even if it has already been run
-    # in auto-install mode, overwrite the disk chosen by storage_init parameter
-    firstboot=
-
-    #   ovirt_runtime_mode
-    # overrides the runtime mode defined in /etc/sysconfig/node-config
-    runtime_mode=
-
-    #   rescue
-    # enter emergency shell for fixing configuration issues
-    rescue=
-
-    #   rootpw=<encrypted_password>
-    # sets a temporary root password, change is forced on first login
-    # password is crypted, same as Kickstart option rootpw --iscrypted
-    # WARNING: use for debugging only, this is not secure!
-    rootpw=
-
-    #   adminpw=<encrypted_password>
-    # sets a temporary password for admin, change is forced on first login
-    # password is crypted, same as Kickstart option rootpw --iscrypted
-    # WARNING: use for debugging only, this is not secure!
-    adminpw=
-
-    #   snmp_password=<authpassphrase>
-    # enable snmpd and set password for "root" SNMPv3 USM user
-    snmp_password=
-
-    #   pxelinux format: ip=<client-ip>:<boot-server-ip>:<gw-ip>:<netmask>
-    #   anaconda format: ip=<client-ip> netmask=<netmask> gateway=<gw-ip>
-    #   or               ip=dhcp|off
-    #   ipv6=dhcp|auto
-    #   dns=server[,server]
-    #   ntp=server[,server]
-    #   vlan=id
-    #   ssh_pwauth=[0|1]
-    # static network configuration
-    ip_address=
-    ip_gateway=
-    ip_netmask=
-    vlan=
-    netmask=
-    gateway=
-    ipv6=
-    dns=
-    ntp=
-    ssh_pwauth=
-    uninstall=
-
-    # hostname=fqdn
-    # hostname
-    hostname=
-
-    #   syslog=server[:port]
-    # default syslog server
-    syslog_server=
-    syslog_port=
-
-    #   collectd=server[:port]
-    # default collectd server
-    collectd_server=
-    collectd_port=
-
-    #   rhn_type=[classic|sam]
-    #           default is classic
-    #   rhn_url=SATELLITE_URL
-    #   rhn_CA_CERT=CA_CERT_URL
-    #   rhn_username=RHN-USERNAME
-    #   rhn_password=RHN-PASSWORD
-    #   rhn_profile=RHNPROFILE
-    #   rhn_activationkey=ACTIVATIONKEY
-    # RHN registration, activation key takes precedence
-    #   rhn_proxy=PROXY-HOST:PORT
-    #   rhn_proxyuser=PROXY-USERNAME
-    #   rhn_proxypassword=PROXY-PASSWORD
-    rhn_type=classic
-    rhn_url=
-    rhn_ca_cert=
-    rhn_username=
-    rhn_password=
-    rhn_profile=
-    rhn_activationkey=
-    rhn_proxy=
-    rhn_proxyuser=
-    rhn_proxypassword=
-
-    # save boot parameters like console= for local disk boot menu
-    bootparams=
-    cat /etc/system-release >> $OVIRT_LOGFILE
-
-    for i in $(cat /proc/cmdline); do
-        case $i in
-            uninstall*)
-                uninstall='yes'
-                ;;
-            BOOTIF=*)
-            i=${i#BOOTIF=}
-            case "$i" in
-                eth*)
-                bootif=$i
-                ;;
-                link)
-                for eth in $(cd /sys/class/net; echo eth*); do
-                    if ethtool $eth 2>/dev/null|grep -q "Link detected: yes"
-                    then
-                        bootif=$eth
-                        break
-                    fi
-                done
-                ;;
-                ??-??-??-??-??-??-??)
-                i=${i#??-}
-                bootif=$(grep -il $(echo $i|sed 's/-/:/g') /sys/class/net/eth*/address|rev|cut -d/ -f2|rev)
-                ;;
-            esac
-            ;;
-            storage_init* | ovirt_init*)
-            i=${i#ovirt_init}
-            i=${i#storage_init}
-            if [ -z "$i" ]; then
-                # 'storage_init' without value: grab first disk
-                init=$(ls -1 /dev/?da /dev/cciss/c?d? 2>/dev/null |head -n1)
-            else
-                i=${i#=}
-                eval $(printf $i|awk -F\; '{ print "hostvgdisks="$1; print "appvgdisks="$2; }')
-                # Look into HostVG disks
-                if [ -n "$hostvgdisks" ]; then
-                    oldIFS="$IFS"
-                    IFS=,
-                    init=
-                    for d in $hostvgdisks; do
-                        did="$(IFS="$oldIFS" parse_disk_id "$d")"
-                        if [ -z "$did" ]; then
-                            autoinstall_failed
-                        fi
-                        if [ -n "$init" ]; then
-                            init="$init${SEP}$did"
-                        else
-                            init="$did"
-                        fi
-                    done
-                    IFS="$oldIFS"
-                fi
-                # Look into AppVG disks
-                if [ -n "$appvgdisks" ]; then
-                    oldIFS="$IFS"
-                    IFS=,
-                    init_app=
-                    for d in $appvgdisks; do
-                        did="$(IFS="$oldIFS" parse_disk_id "$d")"
-                        if [ -z "$did" ]; then
-                            autoinstall_failed
-                        fi
-                        if [ -n "$init_app" ]; then
-                            init_app="$init_app${SEP}$did"
-                        else
-                            init_app="$did"
-                        fi
-                    done
-                    IFS="$oldIFS"
-                fi
-            fi
-            if [ -z "$init" ]; then
-                log "Selected disk $i is not valid."
-            fi
-            ;;
-            storage_vol* | ovirt_vol=*)
-            i=${i#ovirt_vol=}
-            i=${i#storage_vol=}
-            eval $(printf $i|awk -F: '{ print "lv1="$1; print "lv2="$2; print "lv3="$3; print "lv4="$4; print "lv5="$5; print "lv6="$6; print "lv7="$7; print "lv8="$8; }')
-            # Reads each provided LV size and assign them
-            # NOTE: Boot and Root size are ignored by o-c-storage
-            for p in $(seq 1 8); do
-                var=lv$p
-                size=
-                lv=
-                if [ -n "${!var}" ]; then
-                    eval $(printf '${!var}'|awk -F, '{ print "size="$1; print "lv="$2; }')
-                    if [ -n "${size}" ]; then
-                        case "${lv}" in
-                            Boot)
-                            vol_boot_size=$size
-                            ;;
-                            Swap)
-                            vol_swap_size=$size
-                            ;;
-                            Root)
-                            vol_root_size=$size
-                            ;;
-                            Config)
-                            vol_config_size=$size
-                            ;;
-                            Logging)
-                            vol_logging_size=$size
-                            ;;
-                            Data)
-                            vol_data_size=$size
-                            ;;
-                            Swap2)
-                            vol_swap2_size=$size
-                            ;;
-                            Data2)
-                            vol_data2_size=$size
-                            ;;
-                            *)
-                            ## This is here to preserve old styled syntax (in order)
-                            ## BOOT_MB:SWAP_MB:ROOT_MB:CONFIG_MB:LOGGING_MB:DATA_MB:SWAP2_MB:DATA2_MB
-                            case "$p" in
-                                1)
-                                vol_boot_size=$size
-                                ;;
-                                2)
-                                vol_swap_size=$size
-                                ;;
-                                3)
-                                vol_root_size=$size
-                                ;;
-                                4)
-                                vol_config_size=$size
-                                ;;
-                                5)
-                                vol_logging_size=$size
-                                ;;
-                                6)
-                                vol_data_size=$size
-                                ;;
-                                7)
-                                vol_swap2_size=$size
-                                ;;
-                                8)
-                                vol_data2_size=$size
-                                ;;
-                            esac
-                            ;;
-                        esac
-                    fi
-                fi
-            done
-            ;;
-            upgrade* | ovirt_upgrade* | local_boot | local_boot=* | ovirt_local_boot*)
-            upgrade=1
-            if ! grep -q admin /etc/passwd; then
-                unmount_config /etc/passwd /etc/shadow
-                useradd -g admin -s /usr/libexec/ovirt-admin-shell admin
-                [ ! grep -q ^%wheel /etc/sudoers ] && echo "%wheel     ALL=(ALL)       NOPASSWD: ALL" >> /etc/sudoers
-                /usr/sbin/usermod -p $(grep ^root /etc/shadow | sed 's/:/ /g' | awk '{print $2}') admin
-                persist /etc/shadow /etc/passwd
-            fi
-            ;;
-            standalone=no | standalone=0 | ovirt_standalone=no | ovirt_standalone=0)
-            standalone=0
-            bootparams="$bootparams $i"
-            ;;
-            standalone* | ovirt_standalone*)
-            standalone=1
-            bootparams="$bootparams $i"
-            ;;
-            firstboot=no | firstboot=0 | ovirt_firstboot=no | ovirt_firstboot=0 | reinstall=0 | reinstall=no)
-            firstboot=0
-            ;;
-            firstboot* | ovirt_firstboot* | reinstall)
-            firstboot=1
-            ;;
-            install*)
-            install=1
-            ;;
-            runtime_mode*)
-            runtime_mode=${i#runtime_mode=}
-            ;;
-            rescue)
-            rescue=1
-            ;;
-            adminpw=*)
-            adminpw=${i#adminpw=}
-            ;;
-            rootpw=*)
-            rootpw=${i#rootpw=}
-            if [ -z "$adminpw" ]; then
-                adminpw=$rootpw
-            fi
-            ;;
-            snmp_password=*)
-            snmp_password=${i#snmp_password=}
-            ;;
-
-            mem_overcommit* | ovirt_overcommit*)
-            i=${i#mem_overcommit=}
-            i=${i#ovirt_overcommit=}
-            eval $(printf $i|awk -F: '{print "overcommit="$1;}')
-            ;;
-
-            ip=*)
-            i=${i#ip=}
-            if [ "$i" = "dhcp" ]; then
-                ip_address=
-            else
-                eval $(printf $i|awk -F: '{print "ip_address="$1; print "ip_gateway="$3; print "ip_netmask="$4}')
-            fi
-            ;;
-            netmask=*)
-            netmask=${i#netmask=}
-            ;;
-            gateway=*)
-            gateway=${i#gateway=}
-            ;;
-            ipv6=*)
-            ipv6=${i#ipv6=}
-            ;;
-            dns=*)
-            dns=${i#dns=}
-            ;;
-            ntp=*)
-            ntp=${i#ntp=}
-            ;;
-            hostname=*)
-            hostname=${i#hostname=}
-            ;;
-            vlan=*)
-            vlan=${i#vlan=}
-            ;;
-            ssh_pwauth=1 | ssh_pwauth=true)
-            ssh_pwauth=yes
-            ;;
-            ssh_pwauth=0 | ssh_pwauth=false)
-            ssh_pwauth=no
-            ;;
-            syslog=*)
-            i=${i#syslog=}
-            eval $(printf $i|awk -F: '{print "syslog_server="$1; print "syslog_port="$2;}')
-            ;;
-            netconsole=*)
-            i=${i#netconsole=}
-            eval $(printf $i|awk -F: '{print "netconsole_server="$1; print "netconsole_port="$2;}')
-            ;;
-            collectd=*)
-            i=${i#collectd=}
-            eval $(printf $i|awk -F: '{print "collectd_server="$1; print "collectd_port="$2;}')
-            ;;
-            rhn_type=*)
-            rhn_type=${i#rhn_type=}
-            ;;
-            rhn_url=*)
-            rhn_url=${i#rhn_url=}
-            ;;
-            rhn_ca_cert=*)
-            rhn_ca_cert=${i#rhn_ca_cert=}
-            ;;
-            rhn_username=*)
-            rhn_username=${i#rhn_username=}
-            ;;
-            rhn_password=*)
-            rhn_password=${i#rhn_password=}
-            ;;
-            rhn_profile=*)
-            rhn_profile=${i#rhn_profile=}
-            ;;
-            rhn_activationkey=*)
-            rhn_activationkey=${i#rhn_activationkey=}
-            ;;
-            rhn_proxy=*)
-            rhn_proxy=${i#rhn_proxy=}
-            ;;
-            rhn_proxyuser=*)
-            rhn_proxyuser=${i#rhn_proxyuser=}
-            ;;
-            rhn_proxypassword=*)
-            rhn_proxypassword=${i#rhn_proxypassword=}
-            ;;
-            ovirt_early=*)
-            bootparams="$bootparams $i"
-            i=${i#ovirt_early=}
-            ovirt_early=$(echo $i|tr ",:;" " ")
-            ;;
-            # Don't store these parameters in /etc/default/ovirt
-            BOOT_IMAGE=* | initrd=* | check | linux | liveimg | \
-            root=* | rootfstype=* | rootflags=* | ro | single | install)
-            ;;
-            crashkernel=*)
-            bootparams="$bootparams $i"
-            ;;
-            kdump_nfs=*)
-            kdump_nfs=${i#kdump_nfs=}
-            ;;
-            iscsi_name=*)
-            iscsi_name=${i#iscsi_name=}
-            ;;
-            swap_encrypt=* | ovirt_swap_encrypt=* )
-            i=${i#ovirt_swap_encrypt=}
-            i=${i#swap_encrypt=}
-            eval $(printf $i|awk -F\; '{ print "swap1="$1; print "swap2="$2; }')
-            for p in 1 2; do
-                var=swap$p
-                swapdev=
-                swapcyph=
-                local default_cypher="aes-cbc-essiv:sha256"
-                if [ -n "${!var}" ]; then
-                    eval $(printf ${!var} |awk -F, '{ print "swapdev="$1; print "swapcyph="$2; }')
-                    if [ "${swapdev}" = "Swap" ]; then
-                        if [ -n "${swapcyph}" ]; then
-                            crypt_swap=${swapcyph}
-                        else
-                            crypt_swap=${default_cypher}
-                        fi
-                    elif [ "${swapdev}" = "Swap2" ]; then
-                        if [ -n "${swapcyph}" ]; then
-                            crypt_swap2=${swapcyph}
-                        else
-                            crypt_swap2=${default_cypher}
-                        fi
-                    fi
-                fi
-            done
-            ;;
-            *)
-            # check the params to be ignored before adding to bootparams
-            varname=${i%=*}
-            if ! grep -qw $varname /etc/ovirt-commandline.d/* 2>/dev/null; then
-                bootparams="$bootparams $i"
-            fi
-            ;;
-        esac
-    done
-
-    for hook in $ovirt_early; do
-        pre="$EARLY_DIR/pre-$hook"
-        if [ -e "$pre" ]; then
-            . "$pre"
-        fi
-    done
-
-    if [ -z "$ip_netmask" ]; then
-        ip_netmask=$netmask
-    fi
-    if [ -z "$ip_gateway" ]; then
-        ip_gateway=$gateway
-    fi
-    # Handle uninstall arg
-    # need to wipe mbr if passed
-    if [ "$uninstall" = "yes" ]; then
-        oldIFS=$IFS
-        log "Found uninstall arg, wiping mbr from init disks"
-        IFS=$SEP
-        for init_disk in $init $init_app $(get_boot_device); do
-            echo "Wiping $init_disk"
-            wipe_mbr "$init_disk"
-        done
-        IFS=$oldIFS
-        log "Uninstall complete, rebooting"
-        /sbin/reboot
-    fi
-
-
-    # save boot parameters as defaults for ovirt-config-*
-
-    params="bootif init init_app vol_boot_size vol_swap_size vol_root_size vol_config_size vol_logging_size vol_data_size vol_swap2_size vol_data2_size crypt_swap crypt_swap2 upgrade standalone overcommit ip_address ip_netmask ip_gateway ipv6 dns ntp vlan ssh_pwauth syslog_server syslog_port collectd_server collectd_port bootparams hostname firstboot rhn_type rhn_url rhn_ca_cert rhn_username rhn_password rhn_profile rhn_activationkey rhn_proxy rhn_proxyuser rhn_proxypassword runtime_mode kdump_nfs iscsi_name snmp_password install netconsole_server netconsole_port"
-    # mount /config unless firstboot is forced
-    if [ "$firstboot" != "1" ]; then
-        mount_config
-    fi
-    log "Updating $OVIRT_DEFAULTS"
-    tmpaug=$(mktemp)
-    for p in $params; do
-        PARAM=$(uc $p)
-        value=$(ptr $p)
-        if [ -n "$value" -o $p = 'init' -o $p = 'bootif' -o $p = 'upgrade' -o $p = 'install' ]; then
-            log "Updating OVIRT_$PARAM to '$value'"
-            echo "set /files$OVIRT_DEFAULTS/OVIRT_$PARAM '\"$value\"'" \
-                >> $tmpaug
-        fi
-    done
-    augtool $tmpaug
-    . $OVIRT_DEFAULTS
-    if [ "$firstboot" != "1" -a -f /etc/ovirt-crypttab ]; then
-        mount_crypt_swap
-    fi
-    if [ -f /etc/sysconfig/network ]; then
-        . /etc/sysconfig/network
-        if [ -n "$HOSTNAME" ]; then
-            hostname $HOSTNAME
-        fi
-    fi
-
-    if [ -n "$adminpw" ]; then
-        log "Setting temporary admin password: $adminpw"
-        unmount_config /etc/passwd /etc/shadow
-        /usr/sbin/usermod -p "$adminpw" admin
-        chage -d 0 admin
-    fi
-    if [ -n "$rootpw" ]; then
-        log "Setting temporary root password: $rootpw"
-        unmount_config /etc/passwd /etc/shadow
-        /usr/sbin/usermod -p "$rootpw" root
-        chage -d 0 root
-    fi
-    # check if root or admin password is expired, this might be upon reboot
-    # in case of automated installed with rootpw or adminpw parameter!
-    if LC_ALL=C chage -l root | grep  -q "password must be changed" \
-        || LC_ALL=c chage -l admin | grep -q "password must be changed"; then
-        unmount_config /etc/passwd /etc/shadow
-        # PAM will force password change at first login
-        # so make sure we persist it after a successful login
-        cat >> /etc/profile << EOF
-# added by ovirt-early
-sudo persist /etc/passwd /etc/shadow
-if LC_ALL=C sudo chage -l root | grep  -q "password must be changed" \
-    || LC_ALL=C sudo chage -l admin | grep -q "password must be changed"; then
-    sudo /usr/libexec/ovirt-functions unmount_config /etc/passwd /etc/shadow
-fi
-EOF
-    fi
-
-    if [ "$rescue" = 1 ]; then
-        log "Rescue mode requested, starting emergency shell"
-        stop_log
-        plymouth --hide-splash
-        bash < /dev/console > /dev/console 2> /dev/console
-        plymouth --show-splash
-        start_log
-    fi
-
-    # link to the kernel image for kdump
-    chcon -t boot_t /boot-kdump
-    if is_booted_from_local_disk; then
-        mount_boot
-        if [ -f /dev/.initramfs/live/backup-vmlinuz ]; then
-            # try backup image
-            cp -p /dev/.initramfs/live/backup-vmlinuz0 /boot-kdump/vmlinuz-$(uname -r)
-        else
-            cp -p /dev/.initramfs/live/vmlinuz0 /boot-kdump/vmlinuz-$(uname -r)
-        fi
-    else
-        # try source image
-        mount_live
-        if [ -e /live/*linux/vmlinuz0 ]; then
-            cp -p /live/*linux/vmlinuz0 /boot-kdump/vmlinuz-$(uname -r)
-        fi
-    fi
-
-    if [ "$standalone" = 1 ]; then
-        log "Skip runtime mode configuration."
-    else
-        configure_management_interface
-    fi
-
-    rm -f $VAR_SUBSYS_OVIRT_EARLY
-
-    for hook in $ovirt_early; do
-        post="$EARLY_DIR/post-$hook"
-        if [ -e "$post" ]; then
-            . "$post"
-        fi
-    done
-
-    return 0
-}
-
-stop_ovirt_early () {
-    echo -n "Stopping ovirt-early: "
-    success
-}
-
-reload_ovirt_early () {
-    stop_ovirt_early
-    start_ovirt_early
-}
-
-case "$1" in
-    start)
-        [ -f "$VAR_SUBSYS_NODE_CONFIG" ] && exit 0
-        echo -n "Starting ovirt-early: "
-        {
-            log "Starting ovirt-early"
-            start_ovirt_early
-            # TEMP fix broken libvirtd.conf
-            sed -c -i '/^log_filters=/d' /etc/libvirt/libvirtd.conf
-            log "Completed ovirt-early"
-            RETVAL=$?
-        } >> $OVIRT_LOGFILE 2>&1
-        test $RETVAL == 0 && success || failure
-        ;;
-    status)
-        status $prog
-        ;;
-    reload)
-        reload_ovirt_early
-        ;;
-    stop)
-        stop_ovirt_early
-        ;;
-    *)
-        echo "Usage: ovirt-early {start}"
-        RETVAL=2
-esac
-
-exit $RETVAL
 
+++ /dev/null
-#!/bin/bash
-#
-# ovirt-firstboot Puts the node into configuration mode.
-#
-# chkconfig: 2345 99 01
-# description: ovirt-firstboot node configuration script
-#
-# Copyright (C) 2008 Red Hat, Inc.
-# Written by Darryl L. Pierce <
[email protected]>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-## Source functions library
-. /etc/init.d/functions
-. /usr/libexec/ovirt-functions
-
-prog=ovirt-firstboot
-VAR_SUBSYS_OVIRT_FIRSTBOOT=/var/lock/subsys/$prog
-
-trap '__st=$?; stop_log; exit $__st' 0
-trap 'exit $?' 1 2 13 15
-
-check_version(){
-    if [ -e "/dev/HostVG/Root" ]; then
-    log "                                          "
-    log "   Major version upgrades are not allowed."
-    log "   Please uninstall existing version and reinstall."
-    log "   Press Enter to drop to emergency shell."
-    read < /dev/console
-    bash < /dev/console
-    fi
-}
-
-start_ovirt_firstboot ()
-{
-
-    if ! is_firstboot && ! is_auto_install && ! is_upgrade && ! is_install; then
-        return
-    fi
-
-    touch $VAR_SUBSYS_OVIRT_FIRSTBOOT
-    /sbin/restorecon -e /var/lib/stateless/writable -e /data -e /config -e /proc -e /sys -rv / >> $OVIRT_TMP_LOGFILE 2>&1
-
-    # Hide kernel messages on the console
-    dmesg -n 1
-
-    is_auto_install
-    auto_install=$?
-    if [ "$auto_install" = "0" ]; then
-        /usr/libexec/ovirt-auto-install
-        rc=$?
-        # Handle Log file
-        if [ -f $OVIRT_TMP_LOGFILE ]; then
-            cat $OVIRT_TMP_LOGFILE >> $OVIRT_LOGFILE
-            rm -f $OVIRT_TMP_LOGFILE
-        fi
-        if [ $rc -ne 0 ]; then
-            autoinstall_failed
-        fi
-    elif [ "$auto_install" = "2" ]; then
-        echo "Device specified in storage_init does not exist"
-        autoinstall_failed
-    fi
-
-    if is_upgrade; then
-        plymouth --hide-splash
-        mount_live
-        check_version
-        # auto install covers this already
-        if ! is_auto_install; then
-            /usr/libexec/ovirt-config-boot /live "$OVIRT_BOOTPARAMS" no
-        fi
-        if [ $? -ne 0 ]; then
-            autoinstall_failed
-        fi
-        disable_firstboot
-        ovirt_store_firstboot_config || autoinstall_failed
-        reboot
-        if [ $? -ne 0 ]; then
-            autoinstall_failed
-        fi
-        return 1
-    fi
-
-    if is_firstboot || is_install ; then
-        plymouth --hide-splash
-
-        export LVM_SUPPRESS_FD_WARNINGS=0
-        /usr/libexec/ovirt-config-installer -x < /dev/console
-
-        plymouth --show-splash
-    fi
-    disable_firstboot
-
-    ovirt_store_firstboot_config >> $OVIRT_LOGFILE 2>&1
-
-    rm -f $VAR_SUBSYS_OVIRT_FIRSTBOOT
-}
-
-stop_ovirt_firstboot () {
-    echo -n "Stopping ovirt-firstboot: "
-    success
-}
-
-reload_ovirt_firstboot () {
-    stop_ovirt_firstboot
-    start_ovirt_firstboot
-}
-
-case "$1" in
-    start)
-        if is_managed; then
-            exit 0
-        fi
-
-        printf "Starting ovirt-firstboot: "
-
-        start_ovirt_firstboot
-
-        test $? == 0 && success || failure
-        echo
-        ;;
-    status)
-        status $prog
-        ;;
-    reload)
-        reload_ovirt_firstboot
-        ;;
-    stop)
-        stop_ovirt_firstboot
-        ;;
-    *)
-        echo "Usage: ovirt-firstboot {start}"
-        exit 2
-esac
 
+++ /dev/null
-# -*-Shell-script-*-
-
-OVIRT_LOGFILE=/var/log/ovirt.log
-OVIRT_TMP_LOGFILE=/tmp/ovirt.log
-touch $OVIRT_TMP_LOGFILE
-chcon -t var_log_t $OVIRT_TMP_LOGFILE
-_log_status=1
-
-# label of the oVirt partition
-OVIRT_LABEL=OVIRT
-# configuration values are loaded in the following order:
-# 1. /etc/sysconfig/node-config sets the default values
-# 2. /etc/default/ovirt is loaded to override defaults with karg values
-NODE_SYSCONFIG=/etc/sysconfig/node-config
-OVIRT_DEFAULTS=/etc/default/ovirt
-
-if [ -f "$NODE_SYSCONFIG" ]; then . "$NODE_SYSCONFIG"; fi
-if [ -f $OVIRT_DEFAULTS ];   then . $OVIRT_DEFAULTS; fi
-
-# fallback when default is empty
-OVIRT_STANDALONE=${OVIRT_STANDALONE:-0}
-
-OVIRT_BACKUP_DIR=/var/lib/ovirt-backup
-
-MANAGEMENT_SCRIPTS_DIR=/etc/node.d
-
-OVIRT_CONFIG_FILES="\
- /etc/rsyslog.conf                              \
- /etc/libvirt/libvirtd.conf                     \
- /etc/libvirt/passwd.db                         \
- /etc/passwd                                    \
- /etc/shadow                                    \
- /etc/ssh/ssh_host*_key*                        \
- /etc/default/ovirt                             \
- /etc/sysconfig/network                         \
- /etc/collectd.conf                             \
- /etc/logrotate.d/ovirt-node
-"
-
-. /usr/libexec/ovirt-boot-functions
-LF=$'\n'
-SEP=','
-TAB=$'\t'
-
-# Save stdout to fd 6 and stderr to fd 7.  Redirect normal stdout/stderr
-# to log file
-start_log() {
-    if [ "$_log_status" = 1 ]; then
-        exec 6>&1
-        exec 7>&2
-        exec 1>>$OVIRT_TMP_LOGFILE
-        exec 2>&1
-        _log_status=0
-    fi
-}
-
-# Restore stdout/stderr from fd 6 and 7, respectively.  Close fd 6 and 7
-stop_log() {
-    if [ "$_log_status" != 1 ]; then
-        exec 1>&6 6>&-
-        exec 2>&7 7>&-
-        _log_status=1
-    fi
-}
-
-log() {
-    printf "$(date +'%b %d %H:%M:%S') "
-
-    if [ "$_log_status" = 1 ]; then
-        echo "$@"
-    else
-        echo "$@" >&6
-    fi
-}
-
-log_error() {
-    if [ "$_log_status" = 1 ]; then
-        echo "$@" >&2
-    else
-        printf "%s " "$(date +'%b %d %H:%M:%S')" "$@"
-        echo "$@" >&7
-    fi
-}
-
-ovirt_store_firstboot_config() {
-    # persist config for standalone
-    ovirt_store_config $OVIRT_CONFIG_FILES
-}
-
-# return 1 if oVirt Node is running in standalone mode
-# return 0 if oVirt Node is managed by the oVirt Server
-is_managed() {
-    return $OVIRT_STANDALONE
-}
-
-# oVirt Node in standalone mode does not try to contact the oVirt Server
-is_standalone() {
-    if is_managed; then return 1; else return 0; fi
-}
-
-# return 0 if local storage is configured
-# return 1 if local storage is not configured
-is_local_storage_configured () {
-    if lvs HostVG/Config >/dev/null >&1; then
-        return 0
-    fi
-
-    return 1
-}
-
-# perform automatic local disk installation
-# when at least following boot parameters are present:
-# for networking - OVIRT_BOOTIF, management NIC
-#       if other ip bootparams are not specified, IPv4 DHCP is assumed
-# for storage - OVIRT_INIT, local disk to use
-#       if ovirt_vol is not specified, default volume sizes are set
-is_auto_install() {
-    if [ -n "$OVIRT_BOOTIF" ]; then
-        if [ -n "$OVIRT_INIT" ] ; then
-            return 0
-        elif egrep -q "storage_init|ovirt_init" /proc/cmdline ; then
-            return 2
-        else
-            return 1
-        fi
-    else
-        return 1
-    fi
-}
-
-# return 0 if this is an upgrade
-# return 1 otherwise
-is_upgrade() {
-    if [ "$OVIRT_UPGRADE" = "1" ]; then
-        return 0
-    else
-        return 1
-    fi
-}
-
-# return 0 if booted from local disk
-# return 1 if booted from other media
-is_booted_from_local_disk() {
-    grep -q LABEL=Root /proc/cmdline
-}
-
-# was firstboot menu already shown?
-# state is stored in persistent config partition
-is_firstboot() {
-    if [ -z "$OVIRT_FIRSTBOOT" -o "$OVIRT_FIRSTBOOT" = "1" ]; then
-        return 0
-    else
-        return 1
-    fi
-}
-
-# is install option passed?
-is_install() {
-    if [ -z "$OVIRT_INSTALL" -o "$OVIRT_INSTALL" = "0" ]; then
-        return 1
-    else
-        return 0
-    fi
-}
-
-disable_firstboot() {
-    if mount_config; then
-        augtool <<EOF
-set /files$OVIRT_DEFAULTS/OVIRT_FIRSTBOOT 0
-set /files$OVIRT_DEFAULTS/OVIRT_INIT '""'
-set /files$OVIRT_DEFAULTS/OVIRT_UPGRADE 0
-EOF
-    fi
-}
-
-# Destroys a particular volume group and its logical volumes.
-#
-wipe_volume_group()
-{
-    vg="$1"
-    local pv_dev=$2
-
-    for d in $(grep $vg /proc/mounts|awk '{print $2}'|sort -r); do
-        log "Unmounting $d"
-        umount $d
-    done
-    for d in $(grep $vg /proc/swaps|awk '{print $1}'); do
-        log "Turning off $d"
-        swapoff "$d"
-    done
-    log "Removing $vg"
-    if [ -z "$pv_dev" ]; then
-        LVM2_VG_NAME=""
-        LVM2_PV_NAME=""
-        pv_filter=""
-        pv_list=""
-        oldIFS="$IFS"
-        LF=$'\n'
-        IFS="$LF"
-        for vars in $(pvs --nameprefixes --noheadings -o pv_name,vg_name); do
-            eval  $vars
-            if [ "$LVM2_VG_NAME" = "HostVG" ]; then
-                if [ -n "${pv_list}" ]; then
-                    pv_list="${pv_list}${LF}${LVM2_PV_NAME}"
-                    #pv_filter="${pv_filter}, \"a|^${LVM2_PV_NAME}\$|\""
-                else
-                    pv_list="${LVM2_PV_NAME}"
-                    #pv_filter="${LVM2_PV_NAME}"
-                fi
-            fi
-        done
-        yes | vgremove -f $vg
-        for pv in $pv_list; do
-            yes | pvremove -ff "$pv"
-        done
-        IFS="$oldIFS"
-    else
-        # XXX isn't filter is useless w/o "r|.*|" ?
-        yes | vgremove -f $vg --config " devices { filter = [ \"a|$pv_dev|\" ] } "
-        yes | pvremove -ff "$pv_dev" --config " devices { filter = [ \"a|$pv_dev|\" ] } "
-    fi
-}
-
-# find_srv SERVICE PROTO
-#
-# reads DNS SRV record
-# sets SRV_HOST and SRV_PORT if DNS SRV record found, clears them if not
-# Example usage:
-# find_srv ovirt tcp
-# if [ -n "$SRV_HOST" -a -n "$SRV_PORT" ]; then
-#   echo "oVirt Server found"
-# else
-#   echo "no oVirt Server available, running standalone"
-# fi
-find_srv()
-{
-    local dnsreply
-    local domain=$(dnsdomainname 2>/dev/null)
-    if [ "$domain" = "localdomain" ]; then
-        domain=""
-    fi
-    # FIXME dig +search does not seem to work with -t srv
-    # dnsreply=$(dig +short +search -t srv _$1._$2)
-    # This is workaround:
-    local search=$(grep search /etc/resolv.conf)
-    search=${search#search }
-    for d in $domain $search; do
-        dnsreply=$(dig +short -t srv _$1._$2.$d)
-        rc=$?
-        if [ $rc -eq 0 ]; then
-            set _ $dnsreply; shift
-            SRV_HOST=$4; SRV_PORT=$3
-            return 0
-        fi
-    done
-    SRV_HOST=; SRV_PORT=
-    return 1
-}
-
-die()
-{
-    echo "$@" 1>&2; failure; echo 1>&2; exit 1
-}
-
-ovirt_setup_libvirtd() {
-    # just to get a boot warning to shut up
-    touch /etc/resolv.conf
-
-    # make libvirtd listen on the external interfaces
-    sed -i -e 's/^#\(LIBVIRTD_ARGS="--listen"\).*/\1/' \
-       /etc/sysconfig/libvirtd
-
-    # set up qemu daemon to allow outside VNC connections
-    sed -i -e 's/^[[:space:]]*#[[:space:]]*\(vnc_listen = "0.0.0.0"\).*/\1/' \
-       /etc/libvirt/qemu.conf
-    # set up libvirtd to listen on TCP (for kerberos)
-    sed -i -e "s/^[[:space:]]*#[[:space:]]*\(listen_tcp\)\>.*/\1 = 1/" \
-       -e "s/^[[:space:]]*#[[:space:]]*\(listen_tls\)\>.*/\1 = 0/" \
-       /etc/libvirt/libvirtd.conf
-}
-
-ovirt_setup_anyterm() {
-   # configure anyterm
-   cat >> /etc/sysconfig/anyterm << EOF
-ANYTERM_CMD="sudo /usr/bin/virsh console %p"
-ANYTERM_LOCAL_ONLY=false
-EOF
-
-   # permit it to run the virsh console
-   echo "anyterm ALL=NOPASSWD: /usr/bin/virsh console *" >> /etc/sudoers
-}
-
-md5() {
-  md5sum $1 2>/dev/null | (read MD5 filename; echo $MD5)
-}
-
-# return uppercase value
-uc() {
-    echo $(echo $1|tr '[[:lower:]]' '[[:upper:]]')
-}
-
-# return indirect value
-# non-bashism for ${!var}
-ptr() {
-    local v=$1
-    eval "v=\$$v"
-    echo $v
-}
-
-# mount livecd media
-# e.g. CD /dev/sr0, USB /dev/sda1,
-# PXE /dev/loop0 (loopback ISO)
-# not available when booted from local disk installation
-mount_live() {
-    if grep -q " /live " /etc/mtab; then
-        return 0
-    fi
-    local live_dev=/dev/live
-    if [ ! -e $live_dev ]; then
-        if losetup /dev/loop0|grep -q '\.iso'; then
-            # PXE boot
-            live_dev=/dev/loop0
-        else
-            return 1
-        fi
-    fi
-    mkdir -p /live
-    mount -r $live_dev /live || mount $live_dev /live
-}
-
-# mount root partition
-# boot loader + kernel + initrd + LiveOS
-mount_liveos() {
-    if grep -q " /liveos " /etc/mtab; then
-        return 0
-    fi
-    mkdir -p /liveos
-    mount LABEL=Root /liveos || mount -r LABEL=Root /liveos
-}
-
-mount_iscsi_liveos() {
-    if grep -q " /liveos " /etc/mtab; then
-        return 0
-    fi
-    mount LABEL=ovirt-node-root /liveos || mount -r LABEL=ovirt-node-root /liveos
-}
-# mount config partition
-# /config for persistance
-mount_config() {
-    # Only try to mount /config if the persistent storage exists
-    if [ -e /dev/HostVG/Config ] ; then
-        mkdir -p /config
-        if ! grep -q " /config ext[234] " /proc/mounts; then
-            mount /dev/HostVG/Config /config || return 1
-        fi
-
-        # optional config embedded in the livecd image
-        if [ -e /live/config ]; then
-            cp -rv --update /live/config/* /config
-        fi
-        # bind mount all persisted configs to rootfs
-        for f in $(find /config -type f); do
-            target=${f#/config}
-            if grep -q " $target ext[234]" /proc/mounts ; then
-                # skip if already bind-mounted
-                true
-            else
-                mkdir -p "$(dirname $target)"
-                touch "$target"
-                mount -n --bind $f "$target"
-            fi
-        done
-
-        return 0
-    else
-        # /config is not available
-        return 1
-    fi
-}
-
-mount_boot() {
-
-    if grep -q " /boot " /etc/mtab; then
-       return 0
-    fi
-    mkdir -p /boot
-    mount LABEL=Boot /boot
-}
-# stop any service which keeps /var/log busy
-# keep the list of services
-unmount_logging_services() {
-    # mapping command->service is lame, but works for most initscripts
-    services=
-    cd /etc/init.d
-    # fixup for vdsm-reg intscript
-    if ! grep  "processname: vdsm-reg-setup" /etc/init.d/vdsm-reg; then
-        echo "# processname: vdsm-reg-setup" >> /etc/init.d/vdsm-reg
-    fi
-    for prg in $(lsof -Fc +D /var/log|grep ^c|sort -u); do
-        prog=${prg#c}
-        srv=$(grep -l "processname: .*$prog"$ *)
-        if [ -z "$srv" ]; then
-            # for scripts without chkconfig init header
-            srv=$(grep -l '^prog=["]*'$prog'["]*$' *)
-        fi
-        if [ -z "$srv" ]; then
-            # fallback for scripts without correct prog=
-            srv=$(grep -l '^DAEMON=["]*'$prog'["]*$' *)
-        fi
-        if [ -z "$srv" ]; then
-            # fallback for scripts with more than 1 daemon
-            srv=$(grep -l "daemon $prog$" *)
-        fi
-        if [ -n "$srv" ]; then
-            service $srv stop 6>&- 7>&-
-            services="$services $srv"
-        else
-            # failed to map process to initscript
-            killall "$prog"
-        fi
-    done
-    # debugging help
-    lsof +D /var/log
-    # unmount all under /var/log/
-    for d in $(grep /var/log/ /proc/mounts|awk '{print $2}'); do
-        log "Unmounting $d"
-        umount $d
-    done
-}
-
-# mount logging partition
-# this only gets executed when disk is re-partitioned, HostVG/Logging is empty
-mount_logging() {
-    if grep -q " /var/log ext[234]" /proc/mounts; then
-        return 0
-    fi
-
-    if [ -e /dev/HostVG/Logging ] ; then
-        log "Mounting log partition"
-
-        # temporary mount-point
-        log2=$(mktemp -d)
-        mkdir -p $log2
-        mount /dev/HostVG/Logging $log2
-        unmount_logging_services
-        # save logs from tmpfs
-        cp -av /var/log/* $log2
-        # save temporary log
-        if [ -e /tmp/ovirt.log ]; then
-            cp /tmp/ovirt.log $log2/ovirt.log-tmp
-        fi
-        mount --move $log2 /var/log
-        rmdir $log2
-        restorecon -rv /var/log
-        for srv in $services; do
-            service $srv start 6>&- 7>&-
-        done
-
-        return 0
-    else
-        # /var/log is not available
-        printf "\nThe logging partion has not been created. Please create it at the main menu.\n"
-        return 1
-    fi
-}
-
-unmount_logging() {
-    if ! grep -q " /var/log ext[234]" /proc/mounts; then
-        return 0
-    fi
-
-    log "Unmounting log partition"
-    # plymouthd keeps /var/log/boot.log
-    if plymouth --ping ; then
-        plymouth --quit
-    fi
-    unmount_logging_services
-
-    umount /var/log
-    rc=$?
-    if [ $rc -ne 0 ]; then
-        return $rc
-    fi
-    for srv in $services; do
-        service $srv start 6>&- 7>&-
-    done
-
-    return 0
-}
-
-# mount data partition
-mount_data() {
-    udevadm settle
-    if [ -e /dev/HostVG/Data ] ; then
-        mkdir -p /data
-        if ! grep -q " /data ext[234]" /proc/mounts; then
-            mount /data
-        fi
-
-        mkdir -p /data/images
-        mkdir -p /data/images/rhev
-        chown 36:36 /data/images/rhev
-        mkdir -p /var/lib/libvirt/images
-        if ! grep -q "/var/lib/libvirt/images ext[234]" /proc/mounts; then
-            mount /var/lib/libvirt/images
-        fi
-        restorecon -rv /var/lib/libvirt/images
-
-        mkdir -p /data/core
-        mkdir -p /var/log/core
-        if ! grep -q "/var/log/core ext[234]" /proc/mounts; then
-            mount /var/log/core
-        fi
-        restorecon -rv /var/log/core
-        chmod 1777 /var/log/core
-        # configure kdump
-        cat > /etc/kdump.conf <<\EOF
-default reboot
-ext4 /dev/HostVG/Data
-path /core
-EOF
-        ovirt_store_config /etc/kdump.conf
-        service kdump restart
-        return 0
-    else
-        # /data is not available
-        printf "\nThe data partition has not been created. Create a Data partition with the \"Configure storage partitions\" menu.\n"
-        return 1
-    fi
-}
-
-mount_data2() {
-    if grep -q " /data2 ext3" /proc/mounts; then
-        return 0
-    fi
-
-    if [ -e /dev/AppVG/Data2 ] ; then
-        mkdir -p /data2
-        mount /data2
-
-        return 0
-    else
-        # /data2 is not available
-        printf "\nThe data2 partion has not been created. Please create it at the main menu.\n"
-        return 1
-    fi
-}
-
-mount_crypt_swap() {
-    crypttab="/etc/ovirt-crypttab"
-    if [ ! -s "${crypttab}" ]; then
-        return 1
-    fi
-    rc=0
-
-    while read label dev mapp cyph; do
-        if [ -n ${label} -a -n ${dev} -a -n ${mapp} -a -n ${cyph} ]; then
-            if grep -q "${dev}" /proc/swaps; then
-                swapoff ${dev} >/dev/null 2>&1
-                rc=$?
-                [ ${rc} -ne 0 ] && {
-                    log "swapoff failed for Un-encrypted ${dev}";
-                    continue;
-                }
-            fi
-            if [ ! -b ${mapp} ]; then
-                /sbin/cryptsetup -d /dev/urandom -c ${cyph} create $(basename ${mapp}) ${dev} > /dev/null 2>&1
-                rc=$?
-                [ ${rc} -ne 0 ] && {
-                    log "Creation of encrypted swap for ${dev} failed";
-                    continue;
-                }
-            fi
-            mkswap -L ${label} ${mapp} >/dev/null 2>&1
-            rc=$?
-            [ ${rc} -ne 0 ] && {
-                log "Creation of swap for ${mapp} failed";
-                continue;
-            }
-            swapon ${mapp} > /dev/null 2>&1
-            [ ${rc} -ne 0 ] && {
-                log "Activation of swap for ${mapp} failed";
-                continue;
-            }
-        else
-            continue
-        fi
-    done < ${crypttab}
-
-    return ${rc}
-}
-
-# augtool wrapper
-#   workaround for bind-mounted files
-#   see https://fedorahosted.org/augeas/ticket/32
-# augtool [tmpaugscript]
-# script MUST NOT include save, it is added by the wrapper
-# with copy_if_rename_fails flag set
-# 'tmpaugscript' is removed after successfull execution
-# without a parameter, augtool commands are expected on standard input
-augtool() {
-    local tmpaug=$1
-    if [ -z "$1" ]; then
-        # read from stdin
-        tmpaug=$(mktemp)
-        cat > $tmpaug
-    fi
-    cat >> $tmpaug <<EOF
-clear /augeas/save/copy_if_rename_fails
-save
-EOF
-    /usr/bin/augtool < $tmpaug > /dev/null
-    rc=$?
-    if [ $rc -eq 0 ]; then
-        rm $tmpaug
-    fi
-    return $rc
-}
-
-# persist configuration to /config
-#   ovirt_store_config /etc/config /etc/config2 ...
-#   copy to /config and bind-mount back
-ovirt_store_config() {
-    rc=0
-    if grep -q " /config ext[234]" /proc/mounts; then
-        for p in "$@"; do
-            local filename=$(readlink -f $p)
-            local persist_it=true
-            if [[ "$filename" =~ ^/[^/]*$ ]]; then
-                # persisting top-level folder makes trouble rhbz#611617
-                printf "Cannot persist system folder: ${filename}\n"
-                persist_it=false
-            elif [ -d $filename ]; then
-                if [ -d /config$filename ]; then
-                    printf "Directory already persisted: ${filename}\n"
-                    printf "You need to unpersist its child directories and/or files and try again.\n"
-                    persist_it=false
-                fi
-            elif [ -f $filename ]; then
-                if [ -f /config$filename ]; then
-                    local md5root=$(md5 $filename)
-                    local md5stored=$(md5 /config$filename)
-                    if [ "$md5root" = "$md5stored" ]; then
-                        printf "File already persisted: ${filename}\n"
-                        persist_it=false
-                    else
-                        # persistent copy needs refresh
-                        umount -n $filename 2> /dev/null || :
-                        rm -f /config$filename
-                    fi
-                fi
-            else
-                printf "Cannot persist: ${filename}\n"
-                persist_it=false
-            fi
-
-            if $persist_it; then
-                # skip if file does not exist
-                if [ ! -e "${filename}" ]; then
-                    printf " Skipping, file '${filename}' does not exist\n"
-                    continue
-                fi
-                # skip if already bind-mounted
-                if ! grep -q " $filename ext[234]" /proc/mounts ; then
-                    mkdir -p /config$(dirname $filename)
-                    cp -a $filename /config$filename \
-                        && mount -n --bind /config$filename $filename
-                    if [ $? -ne 0 ]; then
-                        printf " Failed to persist\n"
-                        rc=1
-                    else
-                        printf " File persisted\n"
-                    fi
-                fi
-                # register in /config/files used by rc.sysinit
-                if ! grep -q "^${filename}$" /config/files 2> /dev/null ; then
-                    printf "${filename}\n" >> /config/files
-                fi
-                printf "\nSuccessfully persisted ${filename}\n"
-            fi
-        done
-        echo
-    else
-        printf "WARNING: persistent config storage not available\n"
-        rc=2
-    fi
-    return $rc
-}
-
-# check if stored config exists
-#       is_persisted /etc/config
-is_persisted() {
-    local abspath=$(readlink -e "$1")
-    test -f "/config$abspath"
-}
-
-# unmount bindmounted config files
-#       unmount_config /etc/config /etc/config2 ...
-#
-# Use before running commands which fail on bindmounted files.
-# After the file is replaced, call ovirt_store_config /etc/config ...
-# to bindmount the config file again.
-#
-unmount_config() {
-    if grep -q " /config ext[234]" /proc/mounts; then
-        for p in "$@"; do
-            f=$(readlink -f $p)
-            if grep -q " $f ext[234]" /proc/mounts ; then
-                if umount -n $f; then
-                    if [ -f /config$f ]; then
-                        # refresh the file in rootfs if it was mounted over
-                        cp -a /config$f $f
-                    fi
-                fi
-            fi
-        done
-    fi
-}
-
-# remove persistent config files
-#       remove_config /etc/config /etc/config2 ...
-#
-remove_config() {
-    # if there are no persisted files then just exit
-    if [ ! -s /config/files ]; then
-        printf "There are currently no persisted files.\n"
-        exit 1
-    fi
-
-    if grep -q " /config ext[234]" /proc/mounts; then
-        for p in "$@"; do
-            local filename=$(readlink -f $p)
-            if grep "^${filename}\$" /config/files > /dev/null 2>&1; then
-                if grep -q " $filename ext[234]" /proc/mounts ; then
-                    if umount -n $filename; then
-                        if [ -d $filename ]; then
-                            cp -ar /config/$filename/* $filename
-                            if [ $? -ne 0 ]; then
-                                printf " Failed to unpersist ${filename}\n"
-                                exit 1
-                            else
-                                printf " ${filename} successully unpersisted\n"
-                            fi
-                        else
-                            if [ -f /config$filename ]; then
-                                # refresh the file in rootfs if it was mounted over
-                                cp -a /config$filename $filename
-                                if [ $? -ne 0 ]; then
-                                    printf " Failed to unpersist ${filename}\n"
-                                    exit 1
-                                else
-                                    printf " ${filename} successully unpersisted\n"
-                                fi
-                            fi
-                        fi
-                    fi
-                else
-                    printf "$filename is not a persisted file.\n"
-                fi
-                # unregister in /config/files used by rc.sysinit
-                sed --copy -i "\|^${filename}$|d" /config/files
-            else
-                printf "File not explicitly persisted: ${filename}\n"
-            fi
-            # clean up the persistent store
-            rm -Rf /config$filename
-        done
-    fi
-}
-
-# ovirt_safe_delete_config
-#       ovirt_safe_delete_config /etc/config /etc/config2 ...
-#
-# Use to *permanently* remove persisted configuration file.
-# WARNING: file is shredded and removed
-#
-ovirt_safe_delete_config() {
-    local target
-
-    for target in "$@"; do
-        if grep -q " $target ext[234]" /proc/mounts; then
-            umount -n $target
-        fi
-
-        sed --copy -i "\|$target$|d" /config/files
-
-        if [ -d $target ]; then
-            for child in $(ls -d $target/*); do
-                ovirt_safe_delete_config $child
-            done
-            rm -rf /config$target
-            rm -rf $target
-        else
-            shred -u /config$target
-            shred -u $target
-        fi
-    done
-}
-
-
-backup_file() {
-    dir=$(dirname "$1")
-    case $dir in /*);; *) die "unexpected non-absolute dir: $dir";; esac
-    mkdir -p "$OVIRT_BACKUP_DIR/${dir:1}"
-    test -f "$1" && cp -pf "$1" "$OVIRT_BACKUP_DIR/${dir:1}"
-}
-
-add_if_not_exist() {
-    string="$1"
-    file="$2"
-
-    grep -qE "^[[:space:]]*$string($|#|[[:space:]])" "$file" \
-        || echo "$string" >> "$file"
-}
-
-# $1 - the string to be trimmed
-trim_whitespace () {
-    local text=${1}
-
-    printf "$text" | awk '{gsub(/^[ ]*/,"",$0); gsub(/[ ]*$/,"",$0) ; print }'
-}
-
-is_numeric() {
-    printf "$1" | grep -q -E '^[0-9]+$'
-}
-
-# LVM2 tools wrapper
-# to avoid warnings like:
-# File descriptor 6 (pipe:[20637]) leaked on lvrename invocation.
-# File descriptor 7 (pipe:[20637]) leaked on lvrename invocation.
-lvrename() {
-    /sbin/lvrename "$@" 6>&- 7>&-
-}
-
-pvs() {
-    /sbin/pvs "$@" 6>&- 7>&-
-}
-
-pvcreate() {
-    /sbin/pvcreate "$@" 6>&- 7>&-
-}
-
-pvremove() {
-    /sbin/pvremove "$@" 6>&- 7>&-
-}
-
-vgcreate() {
-    /sbin/vgcreate "$@" 6>&- 7>&-
-}
-
-vgremove() {
-    /sbin/vgremove "$@" 6>&- 7>&-
-}
-
-lvcreate() {
-    /sbin/lvcreate "$@" 6>&- 7>&-
-}
-
-lvremove() {
-    /sbin/lvremove "$@" 6>&- 7>&-
-}
-
-findfs() {
-    partprobe /dev/mapper/* 2>/dev/null
-    udevadm settle
-    /sbin/blkid -c /dev/null -l -o device -t "$@"
-}
-
-# reboot wrapper
-#   cleanup before reboot
-reboot() {
-    cd /
-    rc=0
-    if [ "$OVIRT_ISCSI_ENABLED" != "y" ]; then
-        # setup new Root if update is prepared
-        root_update_dev="$(findfs LABEL=RootUpdate 2>/dev/null)"
-        if [ -n "$root_update_dev" ]; then
-            set -x
-            root_dev="$(findfs LABEL=Root 2>/dev/null)"
-            e2label "$root_dev" RootBackup || rc=1
-            e2label "$root_update_dev" Root || rc=1
-            set +x
-        fi
-    fi
-    if [ $rc -ne 0 ]; then
-        log "Relabeling failed, please check logs"
-        return 1
-    fi
-    # run post-install hooks
-    # e.g. to avoid reboot loops using Cobbler PXE only once
-    # Cobbler XMLRPC post-install trigger (XXX is there cobbler SRV record?):
-    # wget "http://192.168.50.2/cblr/svc/op/trig/mode/post/system/$(hostname)"
-    #   -O /dev/null
-    for hook in $(ls /etc/ovirt-config-boot.d/* 2>/dev/null); do
-        $hook
-        rc=$?
-        if [ $? -ne 0 ]; then
-            log "Hook \"$hook\" failed."
-        fi
-    done
-    /sbin/reboot
-}
-
-# chkconfig_persist <servicename>
-#   since symlinks cannot be persisted, replace symlinks with hardlinks and persist
-chkconfig_persist() {
-    local service=$1
-    if [ -z "$service" ]; then
-        return 1
-    fi
-    cd /etc/rc.d
-    local to_persist=""
-    for f in rc*.d/[S,K]??$service ; do
-        local dir=$(dirname $f)
-        local name=$(basename $f)
-        cd $dir
-        link=$(readlink $name)
-        if [ -e "$link" ]; then
-            rm -f $name
-            ln $link $name
-            to_persist="$to_persist /etc/rc.d/$f"
-        fi
-        cd ..
-    done
-    ovirt_store_config $to_persist
-}
-
-# Asks a yes or no question. Accepts Y/N/A so users can abort.
-# RC=0 - Y/y entered
-# RC=1 - N/n entered
-# RC=2 - A/a entered
-# $1 - the prompt to use
-# $2 - require a response (def. true)
-# $3 - allow aborting (def. false)
-ask_yes_or_no () {
-    local prompt=${1}
-    local required=${2-true}
-    local allow_abort=${3-false}
-
-    while true; do
-        read -ep "${prompt} "
-        case $REPLY in
-            Y|y) return 0;;
-            N|n) return 1;;
-            A|a) if $allow_abort; then return 2; fi ;;
-            *)
-                if [ $required == false ]; then
-                    return 99
-                fi
-                ;;
-        esac
-    done
-}
-
-# Verifies the address entered is a valid IPv4 address.
-is_valid_ipv4 () {
-    local address=${1}
-    local result=1
-
-    if [[ "$address" =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
-        oldIFS="$IFS"
-        IFS='.'
-        ip=($address)
-        IFS="$oldIFS"
-        [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \
-            && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
-        result=$?
-    fi
-
-    return $result
-}
-
-# Check if networking is already up
-network_up () {
-    ip addr show | grep -q "inet.*scope global"
-}
-
-# wipe mbr from disks
-wipe_mbr () {
-    local drive="$1"
-    log "Wiping old boot sector"
-    dd if=/dev/zero of="$drive" bs=1024K count=1
-    # zero out the GPT secondary header
-    log "Wiping secondary gpt header"
-    local disk_kb_count=$(sfdisk -s "$drive" 2>/dev/null)
-    dd if=/dev/zero of="$drive" bs=1024 seek=$(($disk_kb_count - 1)) count=1
-    kpartx -d "$drive"
-}
-
-# Cleans partition tables
-wipe_partitions() {
-    local drive="$1"
-    wipe_mbr "$drive"
-    # disable HostVG/Swap before removing from dmtable
-    if [ -L /dev/mapper/HostVG-Swap ]; then
-        swapoff -a
-    fi
-    # remove remaining HostVG entries from dmtable
-    for lv in $(find /dev/mapper/HostVG*); do
-        dmsetup remove $lv
-    done
-}
-
-test_ntp_configuration () {
-    # stop ntpd service for testing
-    service ntpd stop > /dev/null 2>&1
-    SERVERS=$(echo $NTPSERVERS | awk 'BEGIN{FS=":"}{for (i=1; i<=NF; i++) print $i}')
-        for server in $SERVERS; do
-            ntpdate $server > /dev/null 2>&1
-            result=$?
-            if [ $result -ne 0 ]; then
-                printf "\n Unable to verify NTP server: $server \n"
-            else
-                printf "\n Verified NTP server: $server \n"
-            fi
-        done
-    service ntpd start
-
-}
-
-get_dm_device ()
-{
-    local device="$1"
-    major=$(stat -c '%t' "$(readlink -f "$device")")
-    minor=$(stat -c '%T' "$(readlink -f "$device")")
-    local dm_device=
-    local rc=1
-    oldIFS="$IFS"
-    IFS=$'\n'
-    for dm in /dev/mapper/*; do
-        if [ $major = $(stat -c '%t' "$(readlink -f "$dm")") -a \
-            $minor = $(stat -c '%T' "$(readlink -f "$dm")") ]; then
-            dm_device="$dm"
-            rc=0
-            break
-        fi
-    done
-    IFS="$oldIFS"
-    echo "$dm_device"
-
-    return $rc
-}
-
-#Function to determine partition and device names
-get_part_info() {
-    local drive_in="$1"
-    local dev_var=$2
-    local part_var=$3
-    local grub_dev=$4
-    local devname_1 devname2 part_number
-    local rc=0
-
-    if [ -z "$grub_dev" ]; then
-        eval "$(readlink -f "$drive_in" | awk '{
-            print "devname_1=\"" substr($0,1,length($0)-1) "\"";
-            print "devname_2=\"" substr($0,1,length($0)-2) "\"";
-            part_number=substr($0,length($0),1);
-            print "part_number=" part_number;
-        }')"
-    else
-        eval "$(readlink -f "$drive_in" | awk '{
-            print "devname_1=\"" substr($0,1,length($0)-1) "\"";
-            print "devname_2=\"" substr($0,1,length($0)-2) "\"";
-            part_number=substr($0,length($0),1); part_number--;
-            print "part_number=" part_number;
-        }')"
-    fi
-    rc=$?
-
-    if [ "$part_number" -lt 1 -a "$grub_dev" != "y" ]; then
-        log "Partition number was invalid"
-        return 2
-    fi
-
-    if [ -e "$devname_1" ]; then
-        eval "$dev_var=\"$devname_1\""
-    elif [ -e "$devname_2" ]; then
-        eval "$dev_var=\"$devname_2\""
-    else
-        return 1
-    fi
-    eval "$part_var=$part_number"
-    return $rc
-}
-
-log_only() {
-    echo "$@" >> $OVIRT_TMP_LOGFILE
-}
-
-autoinstall_failed(){
-    plymouth --hide-splash
-    log "Automatic installation failed. Please review console messages."
-    log "Press Enter to drop to emergency shell."
-    read < /dev/console
-    bash < /dev/console > /dev/console 2> /dev/console
-    plymouth --show-splash
-}
-
-get_base_device() {
-    dev=$1
-    if [ -e "${dev%?}" ]; then
-        echo "${dev%?}"
-        return 0
-    elif [ -e "${dev%p?}" ]; then
-        echo "${dev%p?}"
-        return 0
-    else
-        return 1
-    fi
-}
-
-get_boot_device() {
-    ROOT=$(get_base_device $(findfs LABEL=Root))
-    ROOTBACKUP=$(get_base_device $(findfs LABEL=RootBackup))
-    if [ "$ROOT" = "$ROOTBACKUP" ]; then
-        echo "$ROOT"
-        return 0
-    else
-        return 1
-    fi
-}
-
-# execute a function if called as a script, e.g.
-#   ovirt-functions ovirt_store_config /etc/hosts
-
-if [ "$(basename -- "$0")" = "ovirt-functions" ]; then
-    "$@"
-fi
 
+++ /dev/null
-#!/bin/bash
-#
-# ovirt Start ovirt services
-#
-### BEGIN INIT INFO
-# Provides: ovirt-post
-# Required-Start: ovirt libvirtd
-# Default-Start: 2 3 4 5
-# Description: Performs managed node post configuration setup.
-### END INIT INFO
-
-# Source functions library
-. /etc/init.d/functions
-. /usr/libexec/ovirt-functions
-
-prog=ovirt-post
-VAR_SUBSYS_OVIRT_POST=/var/lock/subsys/$prog
-
-start_ovirt_post() {
-    # wait for libvirt to finish initializing
-    local count=0
-    while true; do
-        if virsh connect qemu:///system --readonly >/dev/null 2>&1; then
-            break
-        elif [ "$count" == "100" ]; then
-            log "Libvirt did not initialize in time..."
-            return 1
-        else
-            log "Waiting for libvirt to finish initializing..."
-            count=$(expr $count + 1)
-            sleep 1
-        fi
-
-        touch $VAR_SUBSYS_OVIRT_POST
-
-    done
-    BACKUP=$(mktemp)
-    ISSUE=/etc/issue
-    ISSUE_NET=/etc/issue.net
-    egrep -v "[Vv]irtualization hardware" $ISSUE > $BACKUP
-    cp -f $BACKUP $ISSUE
-    rm $BACKUP
-    hwvirt=$(virsh --readonly capabilities)
-    if [[ $hwvirt =~ kvm ]]; then
-        log "Hardware virtualization detected"
-    else
-        log "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
-        log "!!! Hardware Virtualization Is Unavailable !!!"
-        log "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
-
-        echo "Virtualization hardware is unavailable." >> $ISSUE
-
-        flags=$(cat /proc/cpuinfo | grep "^flags")
-        if [[ $flags =~ vmx ]] || [[ $flags =~ svm ]]; then
-            echo "(Virtualization hardware was detected but is disabled)" >> $ISSUE
-        else
-            echo "(No virtualization hardware was detected on this system)" >> $ISSUE
-        fi
-    fi
-    if is_local_storage_configured; then
-        echo "" >> $ISSUE
-        echo "Please login as 'admin' to configure the node" >> $ISSUE
-    fi
-    cp -f $ISSUE $ISSUE_NET
-
-    if is_standalone; then
-        return 0
-    fi
-
-    # persist selected configuration files
-    ovirt_store_config \
-        /etc/krb5.conf \
-        /etc/node.d \
-        /etc/sysconfig/node-config
-        /etc/libvirt/krb5.tab \
-        /etc/ssh/ssh_host*_key*
-
-    . /usr/libexec/ovirt-functions
-
-    # successfull boot from /dev/HostVG/Root
-    if grep -q -w root=live:LABEL=Root /proc/cmdline; then
-        # set first boot entry as permanent default
-        ln -snf /dev/.initramfs/live/grub /boot/grub
-        mount -o rw,remount LABEL=Root /dev/.initramfs/live > /tmp/grub-savedefault.log 2>&1
-        echo "savedefault --default=0" | grub >> /tmp/grub-savedefault.log 2>&1
-        mount -o ro,remount LABEL=Root /dev/.initramfs/live >> /tmp/grub-savedefault.log 2>&1
-    fi
-
-    # perform any post startup operations
-    case $OVIRT_RUNTIME_MODE in
-    esac
-
-    rm -f $VAR_SUBSYS_OVIRT_POST
-}
-
-stop_ovirt_post () {
-    echo -n "Stopping ovirt-post: "
-    success
-}
-
-reload_ovirt_post () {
-    stop_ovirt_post
-    start_ovirt_post
-}
-
-case "$1" in
-    start)
-        [ -f "$VAR_SUBSYS_OVIRT_POST" ] && exit 0
-        echo -n "Starting ovirt-post: "
-
-        {
-            log "Starting ovirt-post"
-            start_ovirt_post
-            log "Completed ovirt-post"
-        } >> $OVIRT_LOGFILE 2>&1
-
-        test $? == 0 && success || failure
-        echo
-        ;;
-    status)
-        status $prog
-        ;;
-    reload)
-        reload_ovirt_post
-        ;;
-    stop)
-        stop_ovirt_post
-        ;;
-    *)
-        echo "Usage: ovirt-post {start}"
-        exit 2
-esac
 
+++ /dev/null
-#!/bin/bash
-#
-# Takes as input a reference to an encoded configuration file
-# and produces from that a kernel module file and a network
-# configuration file. It then restarts the networking service
-# and saves the configuration files.
-
-. /usr/libexec/ovirt-functions
-
-ME=$(basename "$0")
-warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
-die() { warn "$*"; exit 1; }
-
-try_h() { printf "Try \`$ME -h' for more information.\n" >&2; exit 1;}
-try_help() { printf "Usage: \`$ME [config] [module output] [config output]\n" >&2; exit 1;}
-
-case $# in
-  0|1|2) warn "too few arguments"; try_help;;
-  3) ;;
-  *) warn "too many arguments"; try_help;;
-esac
-
-CONFIG=$1
-OVIRT_KERNEL_MODULE_FILE=$2
-OVIRT_CONFIG_OUTPUT_FILE=$3
-
-modconf=$(awk '/^[ \t]*bonding=.+/ {
-        match($0, "^[ \t]*bonding=(.+)", data)
-        printf "data[2] = %s\n", data[2]
-
-        if (match("[^[:alnum:]=_@-]", data[2]) >= 0) {
-            printf "invalid bonding alias: \"%s\"\n", data[2];
-            exit 1;
-        }
-
-        alias=data[2]
-
-        printf("install %s bonding", alias)
-    }' $CONFIG)
-
-echo "$modconf" > $OVIRT_KERNEL_MODULE_FILE
-
-networking=$(awk '/^[ \t]*ifcfg=/ {
-    match($0, "^[ \t]*ifcfg=(.*)", data)
-    split(data[1], ifcfg, "|")
-
-    mac = ifcfg[1]
-    iface = ifcfg[2]
-    ifcfg_dir = "/files/etc/sysconfig/network-scripts"
-
-    printf("rm %s/ifcfg-%s\n", ifcfg_dir, iface)
-    printf("set %s/ifcfg-%s/DEVICE %s\n", ifcfg_dir, iface, iface)
-
-    for (line in ifcfg) {
-        if(line > 2) {
-            match(ifcfg[line], "(^[^=]+)=(.*)", values)
-            field=values[1]
-            value=values[2]
-
-            if(length(field) == 0) {
-                print "Missing field name."
-                exit 1
-            }
-
-            if(length(value) == 0) {
-                print "Missing field value."
-                exit 2
-           }
-
-            printf("set %s/ifcfg-%s/%s %s\n", ifcfg_dir, iface, field, value)
-        }
-    }
-
-}' $CONFIG)
-
-SUCCESS=$?
-
-if [ $SUCCESS != 0 ]; then
-    case $SUCCESS in
-        1) error="missing field name";;
-        2) error="missing field value";;
-    esac
-
-    die "Bad data received: ${error}"
-fi
-
-echo "$networking" > $OVIRT_CONFIG_OUTPUT_FILE
-
-if [ -f $OVIRT_CONFIG_OUTPUT_FILE ]; then
-    augtool $OVIRT_CONFIG_OUTPUT_FILE \
-        && RESULT=0 || RESULT=1
-    # FIXME do not store ifcfg-lo
-    if ls /etc/sysconfig/network-scripts/ifcfg* >/dev/null 2>/dev/null; then
-        ovirt_store_config /etc/sysconfig/network-scripts/ifcfg*
-    fi
-fi
-
-exit $RESULT
 
+++ /dev/null
-#!/bin/bash
-#
-# rpm query replacement for the Node image without rpmdb
-#   list of RPMs is stored during the image creatation in /rpm-qa.txt
-#   only rpm -q is available, any other option returns error
-
-PROG=$(basename $0)
-# rpmdb snapshot created during image creation:
-# rpm -qa --qf '%{NAME}\t%{VERSION}\t%{RELEASE}\t%{BUILDTIME}\n'
-RPMDB="/rpm-qa.txt"
-if [ ! -e $RPMDB ]; then
-    echo "$PROG: $RPMDB not found"
-    exit 2
-fi
-
-OPTS=$(getopt -n $PROG -o qav --long query,all,quiet,verbose,qf:,queryformat: -- "$@")
-eval set -- $OPTS
-
-query=
-all=
-qf=
-quiet=
-verbose=
-while [ "$#" -gt 0 ]; do
-  case "$1" in
-    -q|--query)            query=1;;
-    -a|--all)              all=1;;
-    --qf|--queryformat)    qf="$2"; shift;;
-    --quiet)               quiet=1;;
-    -v|--verbose)          verbose=1;;
-    --)                    shift; break;;
-    *)                     echo "$PROG: invalid option, only --query is available"
-                           exit 2;;
-  esac
-  shift
-done
-
-function print_pkg() {
-    local pkg="$1"
-    local regex
-    if [ "$pkg" ]; then
-        regex="^$pkg"$'\t'
-    else
-        regex=""
-    fi
-
-    rc=0
-    if [ "$quiet" ]; then
-        grep -E -q "$regex" $RPMDB || rc=1
-    elif [ "$qf" ]; then
-        # actual queryformat is ignored
-        if ! grep -E "$regex" $RPMDB; then
-            echo "package $pkg is not installed"
-            rc=1
-        fi
-    else
-        awk -v p="$regex" '
-            BEGIN { rc=1 }
-            match($0,p) { print $1"-"$2"-"$3; rc=0 } END { exit rc }
-        ' $RPMDB || rc=1
-    fi
-    return $rc
-}
-
-
-if [ "$query" ]; then
-    if [ "$#" -eq 0 ]; then
-        if [ "$all" ]; then
-            print_pkg ""
-            exit
-        else
-            echo "$PROG: no arguments given for query"
-            exit 1
-        fi
-    fi
-    rc=0
-    for pkg in "$@"; do
-        print_pkg "$pkg" || rc=1
-    done
-else
-    echo "$PROG: invalid option, only --query is available"
-    rc=1
-fi
-
-exit $rc
 
+++ /dev/null
-#!/usr/bin/python
-# ovirtfunctions.py - Copyright (C) 2010 Red Hat, Inc.
-# Written by Joey Boggs <
[email protected]>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-import subprocess
-from subprocess import Popen, PIPE, STDOUT
-import os
-import tempfile
-import string
-import sys
-import augeas
-import socket
-import fcntl
-import struct
-import hashlib
-import shutil
-import re
-import gudev
-import cracklib
-import libvirt
-import logging
-
-OVIRT_LOGFILE="/var/log/ovirt.log"
-OVIRT_TMP_LOGFILE="/tmp/ovirt.log"
-
-# label of the oVirt partition
-OVIRT_LABEL="OVIRT"
-# configuration values are loaded in the following order:
-# 1. /etc/sysconfig/node-config sets the default values
-# 2. /etc/default/ovirt is loaded to override defaults with karg values
-NODE_SYSCONFIG="/etc/sysconfig/node-config"
-OVIRT_DEFAULTS="/etc/default/ovirt"
-aug = augeas.Augeas()
-#   workaround for bind-mounted files
-#   see https://fedorahosted.org/augeas/ticket/32
-aug.set("/augeas/save/copy_if_rename_fails", "")
-
-# read product / version info
-PRODUCT_SHORT = aug.get("/files/etc/default/version/PRODUCT_SHORT")
-if PRODUCT_SHORT == None:
-    PRODUCT_SHORT = "oVirt"
-else:
-    PRODUCT_SHORT = PRODUCT_SHORT.strip("'\"")
-PRODUCT_VERSION = aug.get("/files/etc/default/version/VERSION")
-PRODUCT_RELEASE = aug.get("/files/etc/default/version/RELEASE")
-
-OVIRT_VARS = {}
-# Parse all OVIRT_* variables
-
-def parse_defaults():
-    global OVIRT_VARS
-    if os.path.exists(NODE_SYSCONFIG):
-        try:
-            f = open(NODE_SYSCONFIG, 'r')
-            for line in f:
-                try:
-                    line = line.strip()
-                    key, value = line.split("\"", 1)
-                    key = key.strip("=")
-                    key = key.strip()
-                    value = value.strip("\"")
-                    OVIRT_VARS[key] = value
-                except:
-                    pass
-            f.close()
-        except:
-            pass
-
-    f = open(OVIRT_DEFAULTS, 'r')
-    for line in f:
-        try:
-            line = line.strip()
-            key, value = line.split("=", 1)
-            key = key.strip("=")
-            value = value.strip("\"")
-            OVIRT_VARS[key] = value
-        except:
-            pass
-    f.close()
-    return OVIRT_VARS
-
-
-# fallback when default is empty
-#OVIRT_STANDALONE=${OVIRT_STANDALONE:-0}
-
-OVIRT_BACKUP_DIR="/var/lib/ovirt-backup"
-
-MANAGEMENT_SCRIPTS_DIR="/etc/node.d"
-
-def log(log_entry):
-    if is_firstboot():
-        log_file = open(OVIRT_TMP_LOGFILE, "a")
-    else:
-        log_file = open(OVIRT_LOGFILE, "a")
-    try: 
-        log_file.write(log_entry +"\n")
-    except:
-        log_file.write(str(log_entry))
-    log_file.close()
-
-def augtool(oper, key, value):
-    if oper == "set":
-        aug.set(key, value)
-        aug.save()
-        return
-    elif oper == "rm":
-        aug.remove(key)
-        aug.save()
-        return
-    elif oper == "get":
-        value = aug.get(key)
-        return value
-
-def augtool_get(key):
-    value = aug.get(key)
-    return value
-# return 1 if oVirt Node is running in standalone mode
-# return 0 if oVirt Node is managed by the oVirt Server
-def is_managed():
-    if "ovirt_standalone" in OVIRT_VARS["OVIRT_BOOTPARAMS"]:
-        return False
-    else:
-        return True
-
-# oVirt Node in standalone mode does not try to contact the oVirt Server
-def is_standalone(self):
-    if is_managed:
-        return False
-    else:
-        return True
-
-# return 0 if local storage is configured
-# return 1 if local storage is not configured
-def is_local_storage_configured():
-    ret = os.system("lvs HostVG/Config &>/dev/null")
-    if ret > 0:
-        return False
-    return True
-
-# perform automatic local disk installation
-# when at least following boot parameters are present:
-# for networking - OVIRT_BOOTIF, management NIC
-#       if other ip bootparams are not specified, IPv4 DHCP is assumed
-# for storage - OVIRT_INIT, local disk to use
-#       if ovirt_vol is not specified, default volume sizes are set
-def is_auto_install(self):
-    if self.OVIRT_VARS.has_key("OVIRT_BOOTIF") and self.OVIRT_VARS.has_key("OVIRT_INIT"):
-        return True
-    else:
-        return False
-
-# return 0 if this is an upgrade
-# return 1 otherwise
-def is_upgrade(self):
-    if self.OVIRT_VARS.has_key("OVIRT_UPGRADE") and self.OVIRT_VARS["OVIRT_UPGRADE"] == 1:
-        return True
-    else:
-        return False
-
-# return 0 if booted from local disk
-# return 1 if booted from other media
-def is_booted_from_local_disk():
-    ret = os.system("grep -q LABEL=Root /proc/cmdline")
-    if ret == 0:
-        return True
-    else:
-        return False
-
-def is_rescue_mode():
-    ret = os.system("grep -q rescue /proc/cmdline")
-    if ret == 0:
-        return True
-    # check for runlevel 1/single
-    else:
-        ret = os.system("runlevel|grep -q '1\|S'")
-        if ret == 0:
-            return True
-        return False
-
-def get_ttyname():
-    for f in sys.stdin, sys.stdout, sys.stderr:
-        if f.isatty():
-            tty = os.ttyname(f.fileno()).replace("/dev/","")
-            if "pts" in tty:
-                tty = tty.replace("/","")
-            return tty
-    return None
-
-def manual_setup():
-    logger.info("Checking For Setup Lockfile")
-    tty = get_ttyname()
-    if os.path.exists("/tmp/ovirt-setup.%s" % tty):
-        return True
-    else:
-        return False
-# was firstboot menu already shown?
-# state is stored in persistent config partition
-def is_firstboot():
-    # check if theres a key first
-    if OVIRT_VARS.has_key("OVIRT_FIRSTBOOT"):
-        if OVIRT_VARS["OVIRT_FIRSTBOOT"] == "1":
-            return True
-        elif OVIRT_VARS["OVIRT_FIRSTBOOT"] == "0":
-            return False
-    # in case there's no key, default to True unless booted from disk
-    if is_booted_from_local_disk():
-        return False
-    else:
-        return True
-
-def disable_firstboot():
-    if os.path.ismount("/config"):
-        aug.set("/files/etc/default/ovirt/OVIRT_FIRSTBOOT", "0")
-        aug.set("/files/etc/default/ovirt/OVIRT_INIT", '""')
-        aug.set("/files/etc/default/ovirt/OVIRT_UPGRADE", "0")
-        aug.save()
-        ovirt_store_config("/etc/default/ovirt")
-
-# Destroys a particular volume group and its logical volumes.
-# The input (vg) is accepted as either the vg_name or vg_uuid
-def wipe_volume_group(vg):
-    vg_name_cmd = "vgs -o vg_name,vg_uuid --noheadings 2>/dev/null | grep -w \"" + vg + "\" | awk '{print $1}'"
-    vg_name = subprocess.Popen(vg_name_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-    vg = vg_name.stdout.read().strip()
-    files_cmd = "grep '%s' /proc/mounts|awk '{print $2}'|sort -r" % vg
-    files = subprocess.Popen(files_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-    files_output = files.stdout.read()
-    for file in files_output.split():
-        os.system("umount %s &>/dev/null" % file)
-    swap_cmd = "grep '%s' /proc/swaps|awk '{print $1}'" % vg
-    swap = subprocess.Popen(swap_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-    swap_output = swap.stdout.read().strip()
-    for d in swap_output.split():
-        os.system("swapoff %s &>/dev/null" % d)
-    system("vgchange -an %s" % vg)
-    vgremove_cmd = "vgremove -ff %s &>> %s" % (vg, OVIRT_TMP_LOGFILE)
-    ret = os.system(vgremove_cmd)
-    if ret != 0:
-        #retry one more time before failing
-        os.system(vgremove_cmd)
-
-# find_srv SERVICE PROTO
-#
-# reads DNS SRV record
-# sets SRV_HOST and SRV_PORT if DNS SRV record found, clears them if not
-# Example usage:
-# find_srv ovirt tcp
-def find_srv(srv, proto):
-    domain = subprocess.Popen("dnsdomainname 2>/dev/null", shell=True, stdout=PIPE, stderr=STDOUT)
-    domain_output = domain.stdout.read()
-    if domain_output == "localdomain":
-        domain=""
-    # FIXME dig +search does not seem to work with -t srv
-    # dnsreply=$(dig +short +search -t srv _$1._$2)
-    # This is workaround:
-    search = subprocess.Popen("grep search /etc/resolv.conf", shell=True, stdout=PIPE, stderr=STDOUT)
-    search_output = search.stdout.read()
-    search = search_output.replace("search ","")
-    domain_search = domain_output + search_output
-    for d in domain_search.split():
-        dig_cmd = "dig +short -t srv _%s._%s.%s" % (srv, proto,search)
-        dig = subprocess.Popen(dig_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-        dig_output = dig.stdout.read()
-        dig.poll()
-        dig_rc = dig.returncode
-        if dig_rc == 0:
-            try:
-                a,b,port,host = dig_output.split("=", 4)
-                return (port, host)
-            except:
-                logger.error("Unable to find srv records")
-        return False
-
-def ovirt_setup_libvirtd(self):
-    # just to get a boot warning to shut up
-    os.system("touch /etc/resolv.conf")
-
-    # make libvirtd listen on the external interfaces
-    os.system("sed -i -e 's/^#\(LIBVIRTD_ARGS=\"--listen\"\).*/\1/' /etc/sysconfig/libvirtd")
-
-    # set up qemu daemon to allow outside VNC connections
-    os.system("sed -i -e 's/^[[:space:]]*#[[:space:]]*\(vnc_listen = \"0.0.0.0\"\).*/\1/' /etc/libvirt/qemu.conf")
-    # set up libvirtd to listen on TCP (for kerberos)
-    os.system('sed -i -e "s/^[[:space:]]*#[[:space:]]*\(listen_tcp\)\>.*/\1 = 1/" \
-       -e "s/^[[:space:]]*#[[:space:]]*\(listen_tls\)\>.*/\1 = 0/" \
-       /etc/libvirt/libvirtd.conf')
-
-def ovirt_setup_anyterm():
-   # configure anyterm
-   anyterm_conf = open("/etc/sysconfig/anyterm", "w")
-   anyterm_conf.write("ANYTERM_CMD='sudo /usr/bin/virsh console %p'")
-   anyterm_conf.write("ANYTERM_LOCAL_ONLY=false")
-   anyterm_conf.close()
-   # permit it to run the virsh console
-   os.system("echo 'anyterm ALL=NOPASSWD: /usr/bin/virsh console *' >> /etc/sudoers")
-
-# mount livecd media
-# e.g. CD /dev/sr0, USB /dev/sda1,
-# PXE /dev/loop0 (loopback ISO)
-# not available when booted from local disk installation
-def mount_live():
-    ret = os.system('cat /proc/mounts|grep -q "none /live"')
-    if ret == 0:
-        os.system("umount /live")
-    live_dev="/dev/live"
-    if not os.path.exists(live_dev):
-        ret = os.system("losetup /dev/loop0|grep -q '\.iso'")
-        if ret == 0:
-            # PXE boot
-            live_dev="/dev/loop0"
-        else:
-            # /dev/live if not exist alternative
-            client = gudev.Client(['block'])
-            version = open("/etc/default/version")
-            for line in version.readlines():
-                if "PACKAGE" in line:
-                    pkg, pkg_name = line.split("=")
-            for device in client.query_by_subsystem("block"):
-                if device.has_property("ID_CDROM"):
-                    dev = device.get_property("DEVNAME")
-                    blkid_cmd = "blkid '%s'|grep -q '%s'" % (dev, pkg_name)
-                    ret = os.system(blkid_cmd)
-                    if ret == 0:
-                        live_dev = dev
-    os.system("mkdir -p /live")
-    os.system("mount -r " + live_dev + " /live &>/dev/null")
-    if os.path.ismount("/live"):
-        return True
-    else:
-        return False
-
-# mount root partition
-# boot loader + kernel + initrd + LiveOS
-def mount_liveos():
-    if os.path.ismount("/liveos"):
-        return True
-    else:
-        os.system("mkdir -p /liveos")
-        if not system("mount LABEL=Root /liveos"):
-            # just in case /dev/disk/by-label is not using devmapper and fails
-            for dev in os.listdir("/dev/mapper"):
-                if system("e2label \"/dev/mapper/" + dev + "\" 2>/dev/null|grep Root|grep -v Backup"):
-                    system("rm -rf /dev/disk/by-label/Root")
-                    system("ln -s \"/dev/mapper/" + dev + "\" /dev/disk/by-label/Root")
-                    if system("mount LABEL=Root /liveos"):
-                        return True
-        else:
-            return True
-
-# mount config partition
-# /config for persistance
-def mount_config():
-    # Only try to mount /config if the persistent storage exists
-    if os.path.exists("/dev/HostVG/Config"):
-        os.system("mkdir -p /config")
-        if not os.path.ismount("/config"):
-            ret = os.system("mount /dev/HostVG/Config /config")
-            if ret > 0:
-                return False
-
-        # optional config embedded in the livecd image
-        if os.path.exists("/live/config"):
-            os.system("cp -rv --update /live/config/* /config")
-
-        # bind mount all persisted configs to rootfs
-        filelist_cmd = "find /config -type f"
-        filelist = subprocess.Popen(filelist_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-        filelist = filelist.stdout.read()
-        for f in filelist.split():
-            logger.debug("Bind Mounting: " + f)
-            if os.path.isfile(f) and f != "/config/files":
-                target = string.replace(f, "/config", "")
-                mounted_cmd = "grep -q " + target + " /proc/mounts"
-                mounted = os.system(mounted_cmd)
-                if mounted == 0:
-                    # skip if already bind-mounted
-                    pass
-                else:
-                    dirname = os.path.dirname(target)
-                    os.system("mkdir -p '%s'" % dirname)
-                    os.system("touch '%s'" % target)
-                    os.system("mount -n --bind '%s' '%s'" % (f,target))
-        return True
-    else:
-        # /config is not available
-        return False
-
-def mount_boot(self):
-    if os.path.ismount("/boot"):
-       return
-    else:
-        os.system("mkdir -p /boot")
-        os.system("mount LABEL=Boot /boot")
-
-# stop any service which keeps /var/log busy
-# keep the list of services
-def unmount_logging_services():
-    # mapping command->service is lame, but works for most initscripts
-    logging_services= []
-    prgs_cmd = "cd /etc/init.d|lsof -Fc +D /var/log|grep ^c|sort -u"
-    prgs = subprocess.Popen(prgs_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-    prgs_output = prgs.stdout.read()
-    for prg in prgs_output.split():
-        svc = prg = prg[1:]
-        ret = os.system("service " + svc +" stop &>/dev/null")
-        if ret != 0:
-            os.system("pkill " + svc)
-        logging_services.append(svc)
-    return logging_services
-    # debugging help
-    #os.system("lsof +D /var/log")
-
-# mount logging partition
-# this only gets executed when disk is re-partitioned, HostVG/Logging is empty
-def mount_logging():
-    if os.path.ismount("/var/log"):
-        return True
-    if os.path.exists("/dev/HostVG/Logging"):
-        logger.info("Mounting log partition")
-        # temporary mount-point
-        log2 = tempfile.mkdtemp()
-        os.system("mount /dev/HostVG/Logging " + log2)
-        logging_services = unmount_logging_services()
-        # save logs from tmpfs
-        os.system("cp -av /var/log/* " + log2 + " &>/dev/null")
-        # save temporary log
-        if os.path.exists("/tmp/ovirt.log"):
-            os.system("cp /tmp/ovirt.log " + log2 +"/ovirt.log-tmp &>> /tmp/ovirt.log")
-        os.system("mount --move " + log2 + " /var/log")
-        shutil.rmtree(log2)
-        os.system("restorecon -rv /var/log &>/dev/null")
-        for srv in logging_services:
-            os.system("service " + srv + " start &>/dev/null")
-        # make sure rsyslog restarts
-        os.system("service rsyslog start &>/dev/null")
-        return
-    else:
-        # /var/log is not available
-        logger.error("The logging partion has not been created. Please create it at the main menu.")
-        return False
-
-def unmount_logging():
-    if not os.path.ismount("/var/log"):
-        return True
-    logger.info("Unmounting log partition")
-    # plymouthd keeps /var/log/boot.log
-    ret = os.system("plymouth --ping")
-    if ret == 0:
-        os.system("plymouth --quit")
-    logging_services = unmount_logging_services()
-
-    ret = os.system("umount /var/log &>/dev/null")
-    if ret > 0:
-        return ret
-    for srv in logging_services:
-        os.system("service " + srv + " start &> /dev/null")
-    return
-
-# mount data partition
-def mount_data():
-    if os.path.ismount("/data"):
-        return
-
-    if os.path.exists("/dev/HostVG/Data"):
-        os.system("mkdir -p /data")
-        os.system("mount /data")
-        os.system("mkdir -p /data/images")
-        os.system("mkdir -p /data/images/rhev")
-        os.system("chown 36:36 /data/images/rhev")
-        os.system("mkdir -p /var/lib/libvirt/images")
-        os.system("mount /var/lib/libvirt/images")
-        os.system("restorecon -rv /var/lib/libvirt/images &>/dev/null")
-        os.system("mkdir -p /data/core")
-        os.system("mkdir -p /var/log/core")
-        os.system("mount /var/log/core")
-        os.system("restorecon -rv /var/log/core &>/dev/null")
-        return
-    else:
-        # /data is not available
-        logger.error("The data partion has not been created. Please create it at the main menu.")
-        return False
-
-def mount_data2():
-    if os.path.ismount("/data2"):
-        return True
-
-    if os.path.exists("/dev/AppVG/Data2"):
-        system("mkdir -p /data2")
-        system("mount /data2")
-
-    if os.path.ismount("/data2"):
-        return True
-    else:
-        # /data2 is not available
-        logger.error("The data2 volume can not be mounted")
-        return False
-
-def md5sum(filename):
-    m = hashlib.md5()
-    with open(filename) as f:
-        data = f.read(4096)
-        while data:
-            m.update(data)
-            data = f.read(4096)
-        return m.hexdigest()
-
-
-STRING_TYPE=(str,unicode)
-# persist configuration to /config
-#   ovirt_store_config /etc/config /etc/config2 ...
-#   copy to /config and bind-mount back
-
-def ovirt_store_config(files):
-  if not os.path.ismount("/config"):
-    logger.error("/config is not mounted")
-    return False
-  if isinstance(files,STRING_TYPE):
-    files_list = []
-    files_list.append(files)
-  else:
-    files_list=files
-  for f in files_list:
-    filename = os.path.abspath(f)
-    persist_it=True
-    # ensure that, if this is a directory
-    # that it's not already persisted
-    if os.path.isdir(filename):
-        if os.path.isdir("/config/" + filename):
-            logger.warn("Directory already persisted: " + filename)
-            logger.warn("You need to unpersist its child directories and/or files and try again.")
-            persist_it=False
-            rc = 0
-
-    # if it's a file then make sure it's not already persisted
-    if os.path.isfile(filename):
-        if os.path.isfile("/config/" + filename):
-            md5root=md5sum(filename)
-            md5stored=md5sum("/config" + filename)
-            if md5root == md5stored:
-                logger.warn("File already persisted: " + filename)
-                persist_it=False
-                rc = 0
-            else:
-                # persistent copy needs refresh
-                if system("umount -n " + filename + " 2> /dev/null"):
-                    system("rm -f /config"+ filename)
-    if persist_it:
-        # skip if file does not exist
-        if not os.path.exists(filename):
-            logger.warn("Skipping, file: " + filename + " does not exist")
-        # skip if already bind-mounted
-        if not check_bind_mount(filename):
-            dirname = os.path.dirname(filename)
-            system("mkdir -p /config/" + dirname)
-            if system("cp -a " + filename + " /config"+filename):
-                if not system("mount -n --bind /config"+filename+ " "+filename):
-                    logger.error("Failed to persist: " + filename)
-                    rc = 1
-                else:
-                    logger.info("File: " + filename + " persisted")
-                    rc = True
-        # register in /config/files used by rc.sysinit
-        ret = os.system("grep -q \"^$" + filename +"$\" /config/files 2> /dev/null")
-        if ret > 0:
-            os.system("echo "+filename+" >> /config/files")
-            logger.info("Successfully persisted: " + filename)
-            rc = 0
-    else:
-        logger.warn(filename + " Already persisted")
-        rc = 0
-    if rc == 0:
-        return True
-
-def is_persisted(filename):
-    abspath = os.path.abspath(filename)
-    if os.path.exists("/config" + abspath):
-        return True
-    else:
-        return False
-
-# unmount bindmounted config files
-#       unmount_config /etc/config /etc/config2 ...
-#
-# Use before running commands which fail on bindmounted files.
-# After the file is replaced, call ovirt_store_config /etc/config ...
-# to bindmount the config file again.
-#
-
-def check_bind_mount(config_file):
-    bind_mount_cmd = 'grep -q "%s ext4" /proc/mounts' % config_file
-    if os.system(bind_mount_cmd) == 0:
-        return True
-    else:
-        return False
-
-def unmount_config(files):
-    if os.path.ismount("/config"):
-      if isinstance(files,STRING_TYPE):
-        files_list = []
-        files_list.append(files)
-      else:
-        files_list=files
-      for f in files_list:
-        filename = os.path.abspath(f)
-        if check_bind_mount(filename):
-            ret = os.system('umount -n "%s" &>/dev/null' % filename)
-            if ret == 0:
-                if os.path.exists('/config%s' % filename):
-                    # refresh the file in rootfs if it was mounted over
-                    if os.system('cp -a /config"%s" "%s" &> /dev/null' % (filename,filename)):
-                        return True
-
-# remove persistent config files
-#       remove_config /etc/config /etc/config2 ...
-#
-def remove_config(files):
-    # if there are no persisted files then just exit
-    if os.path.exists("/config/files"):
-        if os.path.getsize('/config/files') == 0:
-            print "There are currently no persisted files."
-            return True
-    if os.path.ismount("/config"):
-      if isinstance(files,STRING_TYPE):
-        files_list = []
-        files_list.append(files)
-      else:
-        files_list=files
-      for f in files_list:
-            filename = os.path.abspath(f)
-            ret = os.system('grep "^%s$" /config/files > /dev/null 2>&1' % filename)
-            if ret == 0:
-                if check_bind_mount(filename):
-                    ret = os.system('umount -n "%s" &>/dev/null' % filename)
-                    if ret == 0:
-                        if os.path.isdir(filename):
-                            ret = os.system('cp -ar /config/"%s"/* "%s"' % (filename,filename))
-                            if ret > 0:
-                                logger.error(" Failed to unpersist %s" % filename)
-                                return False
-                            else:
-                                logger.info("%s successully unpersisted" % filename)
-                                return True
-                        else:
-                            if os.path.isfile(filename):
-                                # refresh the file in rootfs if it was mounted over
-                               ret = os.system('cp -a /config"%s" "%s"' % (filename,filename))
-                               if ret > 0:
-                                    logger.error("Failed to unpersist %s" % filename)
-                                    return False
-                               else:
-                                   logger.info("%s successully unpersisted" % filename)
-                    # clean up the persistent store
-                    os.system('rm -Rf /config"%s"' % filename)
-                    # unregister in /config/files used by rc.sysinit
-                    os.system('sed --copy -i "\|^%s$|d" /config/files' % filename)
-                else:
-                    logger.warn("%s is not a persisted file." % filename)
-            else:
-                logger.warn("File not explicitly persisted: %s" % filename)
-
-# ovirt_safe_delete_config
-#       ovirt_safe_delete_config /etc/config /etc/config2 ...
-#
-# Use to *permanently* remove persisted configuration file.
-# WARNING: file is shredded and removed
-#
-def ovirt_safe_delete_config(files):
-    if isinstance(files,STRING_TYPE):
-        files_list = []
-        files_list.append(files)
-    else:
-        files_list=files
-    for f in files_list:
-        filename = os.path.abspath(f)
-        if check_bind_mount(filename):
-            os.system('umount -n "%s" &>/dev/null' % filename)
-
-        os.system('sed --copy -i "\|%s$|d" /config/files' % filename)
-
-        if os.path.isdir(filename):
-            for child in subprocess.Popen("ls -d '%s'" % filename, shell=True, stdout=PIPE, stderr=STDOUT).stdout.read():
-                ovirt_safe_delete_config(child)
-            os.system("rm -rf /config'%s'" % filename)
-            os.system("rm -rf '%s'" % filename)
-        else:
-            os.system("shred -u /config'%s'" % filename)
-            os.system("shred -u '%s'" % filename)
-
-
-# compat function to handle different udev versions
-def udev_info(name, query):
-    # old udev command with shortopts
-    udev_cmd = "udevadm info -n %s -q %s" % (name, query)
-    udev = subprocess.Popen(udev_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-    udev_output = udev.stdout.read()
-    udev.poll()
-    udev_rc = udev.returncode
-    if udev_rc > 0:
-        udev_cmd = "udevadm info --name=%s --query=%s" % (name, query)
-        udev = subprocess.Popen(udev_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-        udev_output = udev.stdout.read()
-        udev.poll()
-        udev_rc = udev.returncode
-    return udev_output
-
-def get_live_disk():
-    live_disk=""
-    if os.path.exists("/dev/live"):
-        live_disk = os.path.dirname(udev_info("/dev/live","path"))
-        if "block" in live_disk:
-            live_disk = os.path.basename(udev_info("/dev/live","path")).strip()
-    elif os.path.exists("/dev/disk/by-label/LIVE"):
-        live_disk = os.path.dirname(udev_info("/dev/disk/by-label/LIVE","path"))
-        if "block" in live_disk:
-            live_disk = os.path.basename(udev_info("/dev/disk/by-label/LIVE","path")).strip()
-    else:
-        ret = os.system("losetup /dev/loop0|grep -q '\.iso'")
-        if ret != 0:
-            client = gudev.Client(['block'])
-            version = open("/etc/default/version")
-            for line in version.readlines():
-                if "PACKAGE" in line:
-                    pkg, pkg_name = line.split("=")
-            for device in client.query_by_subsystem("block"):
-                if device.has_property("ID_CDROM"):
-                    dev = device.get_property("DEVNAME")
-                    blkid_cmd = "blkid '%s'|grep -q '%s' " % (dev, pkg_name)
-                    ret = os.system(blkid_cmd)
-                    if ret == 0:
-                        live_disk = os.path.basename(dev)
-    return live_disk
-
-def backup_file(self, file):
-    dir = os.path.dirname(file)
-    if dir in os.listdir("/"):
-        print "unexpected non-absolute dir: %s" % dir
-        sys.exit(1)
-    os.system("mkdir -p '%s%s'") % (OVIRT_BACKUP_DIR, dir)
-    if os.path.exists(file):
-        shutil.copy(file, OVIRT_BACKUP_DIR + file)
-    #test -f "$1" && cp -pf "$1" "$OVIRT_BACKUP_DIR/${dir:1}"
-
-#add_if_not_exist() {
-#    string="$1"
-#    file="$2"
-#
-#    grep -qE "^[[:space:]]*$string($|#|[[:space:]])" "$file" \
-#        || echo "$string" >> "$file"
-#}
-
-# reboot wrapper
-#   cleanup before reboot
-
-def finish_install():
-    logger.info("Completing Installation")
-    if not OVIRT_VARS.has_key("OVIRT_ISCSI_ENABLED"):
-        # setup new Root if update is prepared
-        root_update_dev = findfs("RootUpdate")
-        root_dev = findfs("Root")
-        e2label_rootbackup_cmd = "e2label '%s' RootBackup" % root_dev
-        e2label_root_cmd = "e2label '%s' Root" % root_update_dev
-        logger.debug(e2label_rootbackup_cmd)
-        logger.debug(e2label_root_cmd)
-        subprocess.Popen(e2label_rootbackup_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-        subprocess.Popen(e2label_root_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-    # run post-install hooks
-    # e.g. to avoid reboot loops using Cobbler PXE only once
-    # Cobbler XMLRPC post-install trigger (XXX is there cobbler SRV record?):
-    # wget "http://192.168.50.2/cblr/svc/op/trig/mode/post/system/$(hostname)"
-    #   -O /dev/null
-    hookdir="/etc/ovirt-config-boot.d"
-    for hook in os.listdir(hookdir):
-        os.system(os.path.join(hookdir,hook))
-    return True
-
-def is_valid_ipv4(ip_address):
-    try:
-        socket.inet_pton(socket.AF_INET, ip_address)
-        return True
-    except socket.error:
-        return False
-
-def is_valid_ipv6(ip_address):
-    try:
-        socket.inet_pton(socket.AF_INET6, ip_address)
-        return True
-    except socket.error:
-        return False
-
-def is_valid_hostname(hostname):
-    regex_1 = "([a-zA-Z]|[0-9])(([a-zA-Z]|[0-9]|-)*([a-zA-Z]|[0-9]))?$"
-    regex_2 = "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$"
-    if re.match(regex_1, hostname):
-        return True
-    else:
-        if re.match(regex_2, hostname):
-            return True
-        else:
-            return False
-
-def is_valid_nfs(nfs_entry):
-    regex = "^([a-zA-Z0-9_\-]+)([\.][a-zA-Z0-9_\-]+)+([:][/][a-zA-Z0-9\~\(\)_\-]*)+([\.][a-zA-Z0-9\(\)_\-]+)*"
-    if re.match(regex, nfs_entry):
-        ip = re.findall( r'[0-9]+(?:\.[0-9]+){3}', nfs_entry)
-        try:
-           if ip[0]:
-               if is_valid_ipv4(ip[0]):
-                   return True
-               else:
-                   return False
-        except:
-            # hostname will fail on purpose
-            return True
-    else:
-        return False
-
-def is_valid_host_port(host):
-    regex = "^([a-zA-Z0-9_\-]+)([\.][a-zA-Z0-9_\-]+)+([:][0-9\~\(\)_\-]*)+([\.][0-9]+)*$"
-    if re.match(regex, host):
-        return True
-    else:
-        return False
-
-def is_valid_url(host):
-    regex = "(((http|https)://)|(www\.))+(([a-zA-Z0-9\._-]+\.[a-zA-Z]{2,6})|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(/[a-zA-Z0-9\&%_\./-~-]*)?"
-    if re.match(regex, host):
-        return True
-    else:
-        return False
-
-def is_valid_host_or_ip(host_or_ip):
-    if host_or_ip != "" :
-        if is_valid_ipv4(host_or_ip):
-            return True
-        if is_valid_ipv6(host_or_ip):
-            return True
-        if is_valid_hostname(host_or_ip):
-            return True
-        else:
-            return False
-    else:
-        return True
-
-def is_valid_user_host(user):
-    regex = "^[\w-]+(\.[\w-]+)*@([a-z0-9-]+(\.[a-z0-9-]+)*?\.[a-z]{2,6}|(\d{1,3}\.){3}\d{1,3})(:\d{4})?$"
-    if re.match(regex, user):
-        return True
-    else:
-        return False
-
-# Check if networking is already up
-def network_up():
-    ret = os.system("ip addr show | grep -q 'inet.*scope global'")
-    if ret == 0:
-        return True
-    return False
-
-def get_ip_address(ifname):
-    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
-    try:
-        ip = socket.inet_ntoa(fcntl.ioctl(
-            s.fileno(),
-            0x8915,  # SIOCGIFADDR
-            struct.pack('256s', ifname[:15])
-        )[20:24])
-    except:
-        ip = ""
-    return ip
-
-def get_netmask(ifname):
-    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
-    try:
-        netmask = fcntl.ioctl(s, 0x891b, struct.pack('256s', ifname))[20:24]
-        netmask = socket.inet_ntoa(netmask)
-    except:
-        netmask = ""
-    return netmask
-
-def get_gateway(ifname):
-    cmd = "ip route list dev "+ ifname + " | awk ' /^default/ {print $3}'"
-    result = subprocess.Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-    result = result.stdout.read().strip()
-    return result
-
-def get_ipv6_address(interface):
-    inet6_lookup_cmd = "ip addr show dev %s | awk '$1==\"inet6\" && $4==\"global\" { print $2 }'" % interface
-    inet6_lookup = subprocess.Popen(inet6_lookup_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-    ipv6_addr = inet6_lookup.stdout.read().strip()
-    try:
-        ip, netmask = ipv6_addr.split("/")
-        return (ip,netmask)
-    except:
-        logger.debug("unable to determine ip/netmask from: " + ipv6_addr)
-    return False
-
-def get_ipv6_gateway(ifname):
-    cmd = "ip route list dev "+ ifname + " | awk ' /^default/ {print $3}'"
-    result = subprocess.Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-    result = result.stdout.read().strip()
-    return result
-
-def has_ip_address(ifname):
-    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
-    try:
-        ip = socket.inet_ntoa(fcntl.ioctl(s.fileno(),
-            0x8915, struct.pack('256s', ifname[:15]))[20:24])
-        return True
-    except IOError:
-        return False
-
-def is_valid_port(port_number):
-    regex = "^(6553[0-5]|655[0-2]\d|65[0-4]\d\d|6[0-4]\d{3}|[1-5]\d{4}|[1-9]\d{0,3}|0)$"
-    if re.match(regex, port_number):
-        return True
-    else:
-        return False
-
-# Cleans partition tables
-def wipe_partitions(drive):
-    logger.info("Wiping old boot sector")
-    os.system("dd if=/dev/zero of=\""+ drive +"\" bs=1024K count=1 &>>" + OVIRT_TMP_LOGFILE)
-    # zero out the GPT secondary header
-    logger.info("Wiping secondary gpt header")
-    disk_kb = subprocess.Popen("sfdisk -s \""+ drive +"\" 2>/dev/null", shell=True, stdout=PIPE, stderr=STDOUT)
-    disk_kb_count = disk_kb.stdout.read()
-    os.system("dd if=/dev/zero of=\"" +drive +"\" bs=1024 seek=$(("+ disk_kb_count+" - 1)) count=1 &>>" + OVIRT_TMP_LOGFILE)
-    if os.path.exists("/dev/mapper/HostVG-Swap"):
-        os.system("swapoff -a")
-    # remove remaining HostVG entries from dmtable
-    for lv in os.listdir("/dev/mapper/"):
-        if "HostVG" in lv:
-            os.system("dmsetup remove " +lv + " &>>" + OVIRT_TMP_LOGFILE)
-
-
-def test_ntp_configuration(self):
-    # stop ntpd service for testing
-    os.system("service ntpd stop > /dev/null 2>&1")
-    for server in OVIRT_VARS["NTP"].split():
-        ret = os.system("ntpdate %s > /dev/null 2>&1" % server)
-        if ret > 0:
-            logger.error("Unable to verify NTP server: %s" % server)
-        else:
-            logger.info("Verified NTP server: %s" % server)
-    os.system("service ntpd start")
-
-def get_dm_device(device):
-    dev_major_cmd="stat -c '%t' " + "\"/dev/" + device + "\""
-    dev_minor_cmd="stat -c '%T' " + "\"/dev/" + device + "\""
-    major_lookup = subprocess.Popen(dev_major_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-    minor_lookup = subprocess.Popen(dev_minor_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-    major_lookup = major_lookup.stdout.read().strip()
-    minor_lookup = minor_lookup.stdout.read().strip()
-    dm_cmd = "ls /dev/mapper"
-    dm_cmd = subprocess.Popen(dm_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-    devices = dm_cmd.stdout.read().strip()
-    for dm in devices.split("\n"):
-        dm_major_cmd="stat -c '%t' " + "\"/dev/mapper/" + dm + "\""
-        dm_minor_cmd="stat -c '%T' " + "\"/dev/mapper/" + dm + "\""
-        dm_major_lookup = subprocess.Popen(dm_major_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-        dm_minor_lookup = subprocess.Popen(dm_minor_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-        dm_major_lookup = dm_major_lookup.stdout.read().strip()
-        dm_minor_lookup = dm_minor_lookup.stdout.read().strip()
-        if dm_major_lookup == major_lookup and minor_lookup == dm_minor_lookup:
-            dm = "/dev/mapper/" + dm
-            return dm
-
-def check_existing_hostvg(install_dev):
-    if install_dev is "":
-        devices_cmd = "pvs --separator=\":\" -o pv_name,vg_name --noheadings 2>/dev/null| grep HostVG |awk -F \":\" {'print $1'}"
-    else:
-        devices_cmd="pvs --separator=: -o pv_name,vg_name --noheadings 2>/dev/null| grep -v '%s' | grep HostVG | awk -F: {'print $1'}" % install_dev
-    devices_cmd = subprocess.Popen(devices_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-    devices = devices_cmd.stdout.read().strip()
-    if len(devices) > 0:
-        logger.error("There appears to already be an installation on another device:")
-        for device in devices.split(":"):
-            logger.error(device)
-        logger.error("The installation cannot proceed until the device is removed")
-        logger.error("from the system of the HostVG volume group is removed")
-        return devices
-    else:
-        return False
-
-def translate_multipath_device(dev):
-    #trim so that only sdX is stored, but support passing /dev/sdX
-    logger.debug("Translating: %s" % dev)
-    if dev is None:
-        return False
-    if "/dev/mapper" in dev:
-        return dev
-    if "/dev/cciss" in dev:
-        cciss_dev_cmd = "cciss_id " + dev
-        cciss_dev = subprocess.Popen(cciss_dev_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-        dev = "/dev/mapper/" + cciss_dev.stdout.read().strip()
-    dm_dev_cmd = "multipath -ll '%s' | egrep dm-[0-9]+" % dev
-    dm_dev = subprocess.Popen(dm_dev_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-    (dm_dev_output, dummy) = dm_dev.communicate()
-    if dm_dev.returncode > 0:
-        return dev
-    else:
-        logger.debug("Translated to: /dev/mapper/" + dm_dev_output.split()[0])
-        return "/dev/mapper/"+dm_dev_output.split()[0]
-
-def pwd_lock_check(user):
-    passwd_cmd = "passwd -S %s" % user
-    passwd = subprocess.Popen(passwd_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-    passwd, err = passwd.communicate()
-    if "locked" in passwd:
-        return True
-    else:
-        return False
-
-def pwd_set_check(user):
-    passwd_cmd = "passwd -S %s" % user
-    passwd = subprocess.Popen(passwd_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-    passwd, err = passwd.communicate()
-    if "set" in passwd:
-        return True
-    else:
-        return False
-
-def get_installed_version_number():
-    if mount_liveos():
-        existing_version = open("/liveos/version")
-        existing_install = {}
-        for line in existing_version.readlines():
-            try:
-                key, value = line.strip().split("=")
-                value = value.replace("'", "")
-                existing_install[key] = value
-            except:
-                pass
-        if existing_install.has_key("VERSION") and existing_install.has_key("RELEASE"):
-            return [existing_install["VERSION"],existing_install["RELEASE"]]
-        else:
-            return False
-
-def get_media_version_number():
-    new_install = {}
-    if mount_live():
-        try:
-            upgrade_version = open("/live/isolinux/version")
-        except:
-            upgrade_version = open("/live/syslinux/version")
-        for line in upgrade_version.readlines():
-            try:
-                key, value = line.strip().split("=")
-                value = value.replace("'", "")
-                new_install[key] = value
-            except:
-                pass
-    else:
-        logger.error("Failed to mount_live()")
-        return False
-    if new_install.has_key("VERSION") and new_install.has_key("RELEASE"):
-        return [new_install["VERSION"],new_install["RELEASE"]]
-    return False
-
-def findfs(label):
-    system("partprobe /dev/mapper/*")
-    system("udevadm settle")
-    blkid_cmd = "/sbin/blkid -c /dev/null -l -o device -t LABEL=\"" + label + "\""
-    blkid = subprocess.Popen(blkid_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-    blkid_output = blkid.stdout.read().strip()
-    return blkid_output
-
-def system(command):
-    if os.system(command + " &>> " + OVIRT_TMP_LOGFILE) == 0:
-        os.system("echo '\n' >> " + OVIRT_TMP_LOGFILE)
-        return True
-    else:
-        return False
-
-def password_check(password_1, password_2):
-          if password_1 != "" and password_2 != "":
-              if password_1 != password_2:
-                  return (1, "Passwords Do Not Match\n\n\n\n\n\n")
-              try:
-                  cracklib.FascistCheck(password_1)
-              except ValueError, e:
-                  return (0, "You have provided a weak password!\nStrong passwords contain a mix of uppercase,\
-                          lowercase, numeric and punctuation characters.\n\nThey are six or more characters long and \
-                          do not contain dictionary words")
-              return (0, "\n\n\n\n\n\n")
-          elif password_1 != "" and password_2 == "":
-              return (1, "Please Confirm Password\n\n\n\n\n\n")
-          return (1, "\n\n\n\n\n\n")
-
-def get_logrotate_size():
-    size = augtool_get("/files/etc/logrotate.d/ovirt-node/rule/size")
-    if "m" in size.lower():
-        multiplier = 1024
-    else:
-        multiplier = 1
-    size = size.lower().rstrip("kmb")
-    size = int(size) * multiplier
-    return str(size)
-
-def get_virt_hw_status():
-    hwvirt_msg = ""
-    try:
-        conn = libvirt.openReadOnly(None)
-        libvirt_capabilities = conn.getCapabilities()
-    except:
-        return "(Failed to Establish Libvirt Connection)"
-    if "kvm" in libvirt_capabilities:
-        logger.info("Hardware virtualization detected")
-    else:
-        hwvirt_msg = "Virtualization hardware is unavailable."
-        cpuflags_cmd = "cat /proc/cpuinfo |grep ^flags|tail -n 1"
-        cpuflags_lookup = subprocess.Popen(cpuflags_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-        cpuflags = cpuflags_lookup.stdout.read().strip()
-        if "vmx" in cpuflags or "svm" in cpuflags:
-            hwvirt_msg = "(Virtualization hardware detected but disabled)"
-        else:
-            hwvirt_msg = "(Virtualization hardware was not detected)"
-    return hwvirt_msg
-
-def get_mac_address(dev):
-    nic_addr_file = open("/sys/class/net/" + dev + "/address")
-    dev_address = nic_addr_file.read().strip()
-    return dev_address
-
-def logical_to_physical_networks():
-    networks = {}
-    client = gudev.Client(['net'])
-    for device in client.query_by_subsystem("net"):
-        try:
-            dev_interface = device.get_property("INTERFACE")
-            dev_address = get_mac_address(dev_interface)
-            bridge_cmd = "/files/etc/sysconfig/network-scripts/ifcfg-%s/BRIDGE" % str(dev_interface)
-            dev_bridge =  augtool_get(bridge_cmd)
-        except:
-            pass
-        if not dev_bridge is None:
-            networks[dev_bridge] = (dev_interface,dev_address)
-    return networks
-
-def pad_or_trim(length, string):
-    to_rem = len(string) - length
-    # if negative pad name space
-    if to_rem < 0:
-        while abs(to_rem) != 0:
-            string = string + " "
-            to_rem = to_rem + 1
-    else:
-        string = string.rstrip(string[-to_rem:])
-    return string
-
-class PluginBase(object):
-    """Base class for pluggable Hypervisor configuration options.
-
-    Configuration plugins are modules in ovirt_config_setup package.
-    They provide implementation of this base class, adding specific
-    form elements and processing.
-    """
-
-    def __init__(self, name, screen):
-        """Initialize a PluginBase instance
-
-        name -- configuration option label
-        screen -- parent NodeConfigScreen
-        """
-        self.name = name
-        """A name of the configuration option."""
-        self.ncs = screen
-        """A NodeConfigScreen instance."""
-
-    def label(self):
-        """Returns label for the configuration option."""
-        return self.name
-
-    def form(self):
-        """Returns form elements for the configuration option.
-        Must be implemented by the child class.
-        """
-        pass
-
-    def action(self):
-        """Form processing action for the Hypervisor configuration option.
-        Must be implemented by the child class.
-        """
-        pass
-
-OVIRT_VARS = parse_defaults()
-
-# setup logging facility
-if is_firstboot():
-    log_file = OVIRT_TMP_LOGFILE
-else:
-    log_file = OVIRT_LOGFILE
-
-logger = logging.getLogger(PRODUCT_SHORT)
-handler = logging.FileHandler(log_file)
-formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
-handler.setFormatter(formatter)
-logger.addHandler(handler)
-logger.setLevel(logging.INFO)
 
+++ /dev/null
-#!/usr/bin/python
-# password.py - Copyright (C) 2010 Red Hat, Inc.
-# Written by Joey Boggs <
[email protected]>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-from ovirtnode.ovirtfunctions import *
-import libuser
-import random
-import crypt
-
-def cryptPassword(password):
-    saltlen = 2
-    algo = 'sha512'
-    saltlen = 16
-    saltstr = '$6$'
-    for i in range(saltlen):
-        saltstr = saltstr + random.choice (string.letters +
-                                           string.digits + './')
-    return crypt.crypt (password, saltstr)
-
-def set_password(password, user):
-    admin = libuser.admin()
-    root = admin.lookupUserByName(user)
-    passwd = cryptPassword(password)
-    unmount_config("/etc/shadow")
-    admin.setpassUser(root, passwd, "is_crypted")
-    ovirt_store_config("/etc/shadow")
-    return True
-
-def check_ssh_password_auth():
-    password_auth_status = augeas.Augeas("root=/")
-    password_auth_status.get("/files/etc/ssh/sshd_config/PasswordAuthentication")
-    return password_auth_status
-
-def toggle_ssh_access():
-    ssh_config = augeas.Augeas("root=/")
-    ssh_config.set("/files/etc/ssh/sshd_config", OVIRT_VARS["ssh_pass_enabled"])
-    ssh_config.save()
-    ovirt_store_config("/etc/ssh/sshd_config")
-    rc = os.system("service sshd reload")
-    return rc
-
-def set_sasl_password(user, password):
-    os.system("saslpasswd2 -a libvirt -p %s") % user
 
+++ /dev/null
-#!/bin/bash
-#
-# Copyright (C) 2009, Red Hat, Inc.
-# Written by Darryl L. Pierce <
[email protected]>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-#
-# Convenience wrapper to give access to the ovirt_store_config
-# function in /usr/libexec/ovirt-functions
-
-. /usr/libexec/ovirt-functions
-
-ME=$(basename "$0")
-warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
-help() { printf "Usage: $ME FILE ...\n
-Copies the specified file to /config and then bindmounts it back at it's original location.
-The file is stored with its full path detail.\n\n" >&2; exit 1;
-}
-die() { warn "$*"; help; exit 1; }
-
-if [ $# -eq 0 ]; then die "You need to specify at least one file."; fi
-
-ovirt_store_config $*
-
 
+++ /dev/null
-#!/usr/bin/python
-# rhn.py - Copyright (C) 2011 Red Hat, Inc.
-# Register system to RHN
-# Written by Joey Boggs <
[email protected]> and Alan Pevec <
[email protected]>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-import os
-import sys
-from ovirtnode.ovirtfunctions import *
-from subprocess import Popen, PIPE, STDOUT
-from snack import *
-import _snack
-
-RHN_CONFIG_FILE = "/etc/sysconfig/rhn/up2date"
-
-def run_rhnreg( serverurl="", cacert="", activationkey="", username="", password="", profilename="", proxyhost="", proxyuser="", proxypass=""):
-    # novirtinfo: rhn-virtualization daemon refreshes virtinfo
-    extra_args = ['--novirtinfo','--norhnsd','--nopackages','--force']
-    args = ['/usr/sbin/rhnreg_ks']
-    # Get cacert location
-    if len(serverurl) > 0:
-        args.append('--serverUrl')
-        args.append(serverurl)
-    location="/etc/sysconfig/rhn/%s" % os.path.basename(cacert)
-    if len(cacert) > 0:
-        if not os.path.exists(cacert):
-            logger.debug("CACert: " + cacert)
-            logger.debug("Location: " + location)
-            logger.info("Downloading Satellite CA cert.....")
-            logger.debug("From: " + cacert + " To: " + location)
-            os.system("wget -q -r -nd --no-check-certificate --timeout=30 --tries=3 -O \"" + location +"\" \"" + cacert + "\"")
-        if os.path.isfile(location):
-            if os.stat(location).st_size > 0:
-                args.append('--sslCACert')
-                args.append(location)
-                ovirt_store_config(location)
-            else:
-                logger.error("Error Downloading Satellite CA cert!")
-                return 3
-
-    if len(activationkey):
-        args.append('--activationkey')
-        args.append(activationkey)
-    elif len(username):
-        args.append('--username')
-        args.append(username)
-        if len(password):
-            args.append('--password')
-            args.append(password)
-    else:
-        # skip RHN registration when neither activationkey
-        # nor username/password is supplied
-        # return success for AUTO w/o rhn_* parameters
-        return 1
-
-    if len(profilename):
-        args.append('--profilename')
-        args.append(profilename)
-
-    if len(proxyhost) > 1:
-        args.append('--proxy')
-        args.append(proxyhost)
-        if len(proxyuser):
-            args.append('--proxyUser')
-            args.append(proxyuser)
-            if len(proxypass):
-                args.append('--proxyPassword')
-                args.append(proxypass)
-
-    args.extend(extra_args)
-
-    logger.info("Registering to RHN account.....")
-
-    unmount_config("/etc/sysconfig/rhn/systemid")
-    unmount_config("/etc/sysconfig/rhn/up2date")
-    # regenerate up2date config
-    if os.path.exists("/etc/sysconfig/rhn/up2date"):
-        os.unlink("/etc/sysconfig/rhn/up2date")
-    logged_args = str(args).replace(password, "XXXXXXXX")
-    logger.debug(logged_args)
-    rhn_reg = subprocess.Popen(args, shell=False, stdout=PIPE, stderr=STDOUT)
-    rhn_reg_output = rhn_reg.stdout.read()
-    logger.debug(rhn_reg_output)
-    if rhn_reg.wait() == 0:
-        ovirt_store_config("/etc/sysconfig/rhn/up2date")
-        ovirt_store_config("/etc/sysconfig/rhn/systemid")
-        logger.info("System %s sucessfully registered to %s" % (profilename, serverurl))
-        return 0
-    else:
-        if "username/password" in rhn_reg_output:
-            rc = 2
-        else:
-            rc = 1
-        logger.error("Error registering to RHN account!")
-        return rc
-
-def parse_host_port(u):
-    if u.count('://') == 1:
-        (proto, u) = u.split('://')
-    else:
-        proto = ''
-    if u.count(':') == 1:
-        (u, port) = u.split(':')
-        try:
-            port=int(port)
-        except:
-            port=0
-    elif proto == 'http':
-        port = 80
-    elif proto == 'https':
-        port = 443
-    else:
-        port = 0
-    host = u.split('/')[0]
-    return (host, port)
-
-def run_rhsm( serverurl="", cacert="", activationkey="", username="", password="", profilename="", proxyhost="", proxyuser="", proxypass=""):
-    extra_args = ['--force','--autosubscribe']
-    sm = ['/usr/sbin/subscription-manager']
-
-    args = list(sm)
-    args.append('register')
-    if len(activationkey):
-        args.append('--activationkey')
-        args.append(activationkey)
-    elif len(username):
-        args.append('--username')
-        args.append(username)
-        if len(password):
-            args.append('--password')
-            args.append(password)
-    else:
-        # skip RHN registration when neither activationkey
-        # nor username/password is supplied
-        # return success for AUTO w/o rhn_* parameters
-        return 1
-
-    if len(serverurl) > 0:
-        (host, port) = parse_host_port(serverurl)
-        if port == 0:
-            port = "443"
-        else:
-            port = str(port)
-    else:
-        host = "subscription.rhn.redhat.com"
-        port = "443"
-    smconf=list(sm)
-    smconf.append('config')
-    smconf.append('--server.hostname')
-    smconf.append(host)
-    smconf.append('--server.port')
-    smconf.append(port)
-    log(str(smconf))
-    smconf_proc = subprocess.Popen(smconf, shell=False, stdout=PIPE, stderr=STDOUT)
-    smconf_output = smconf_proc.stdout.read()
-    log(smconf_proc)
-    if smconf_proc.wait() == 0:
-        ovirt_store_config("/etc/rhsm/rhsm.conf")
-
-    if len(profilename):
-        args.append('--name')
-        args.append(profilename)
-
-    if len(proxyhost) > 1:
-        args.append('--proxy')
-        args.append(proxyhost)
-        if len(proxyuser):
-            args.append('--proxyuser')
-            args.append(proxyuser)
-            if len(proxypass):
-                args.append('--proxypassword')
-                args.append(proxypass)
-
-    args.extend(extra_args)
-
-    log("Registering to RHN account.....")
-
-    import glob
-    all_rhsm_configs="/var/lib/rhsm/productid.js /var/lib/rhsm/cache/installed_products.json /var/lib/rhsm/facts/facts.json".split()
-    unmount_config(all_rhsm_configs)
-    unmount_config(glob.glob("/etc/pki/consumer/*pem"))
-    def unlink_if_exists(f):
-        if os.path.exists(f):
-            os.unlink(f)
-    for f in all_rhsm_configs:
-        unlink_if_exists(f)
-
-    logged_args = str(args).replace(password, "XXXXXXXX")
-    log(logged_args)
-    smreg_proc = subprocess.Popen(args, shell=False, stdout=PIPE, stderr=STDOUT)
-    smreg_output = smreg_proc.stdout.read()
-    log(smreg_output)
-    if smreg_proc.wait() == 0:
-        ovirt_store_config(all_rhsm_configs)
-        ovirt_store_config(glob.glob("/etc/pki/consumer/*pem"))
-        log("System %s sucessfully registered to %s" % (profilename, serverurl))
-        return 0
-    else:
-        if "username/password" in smreg_output:
-            rc = 2
-        else:
-            rc = 1
-        log("Error registering to RHN account!")
-        return rc
-
-def ov(var):
-    if OVIRT_VARS.has_key(var):
-        return OVIRT_VARS[var]
-    else:
-        return ""
-
-# AUTO for auto-install
-#if len(sys.argv):
-#    if sys.argv[1] == "AUTO":
-#            run_rhnreg( ov("OVIRT_RHN_URL"), ov("OVIRT_RHN_CA_CERT"), ov("OVIRT_RHN_ACTIVATIONKEY"), ov("OVIRT_RHN_USERNAME"), ov("OVIRT_RHN_PASSWORD"), ov("OVIRT_RHN_PROFILE"), ov("OVIRT_RHN_PROXY"), ov("OVIRT_RHN_PROXYUSER"), ov("OVIRT_RHN_PROXYPASSWORD") )
-#
-#
-# configuration UI plugin interface
-#
-class Plugin(PluginBase):
-    """Plugin for RHN registration option.
-    """
-
-    def __init__(self, ncs):
-        PluginBase.__init__(self, "Red Hat Network", ncs)
-        self.rhn_conf = {}
-    def form(self):
-        elements = Grid(2, 12)
-        login_grid = Grid(4,2)
-        self.rhn_user = Entry(15, "")
-        self.rhn_pass = Entry(15, "", password = 1)
-        login_grid.setField(self.rhn_user, 1, 0)
-        login_grid.setField(Label("Login: "), 0, 0, anchorLeft = 1)
-        login_grid.setField(Label(" Password: "), 2, 0, anchorLeft = 1)
-        login_grid.setField(self.rhn_pass, 3, 0, padding = (0,0,0,1))
-        elements.setField(login_grid, 0, 4, anchorLeft = 1)
-        profile_grid = Grid(2, 2)
-        self.profilename = Entry(30, "")
-        profile_grid.setField(Label("Profile Name (optional): "), 0, 0, anchorLeft = 1)
-        profile_grid.setField(self.profilename, 1, 0, anchorLeft = 1)
-        elements.setField(profile_grid, 0, 5, anchorLeft= 1, padding = (0, 0, 0, 1))
-        rhn_type_grid = Grid(3, 2)
-        self.public_rhn = Checkbox("RHN ")
-        self.public_rhn.setCallback(self.public_rhn_callback)
-        self.rhn_satellite = Checkbox("Satellite ")
-        self.rhn_satellite.setCallback(self.rhn_satellite_callback)
-        self.sam = Checkbox("Subscription Asset Manager")
-        self.sam.setCallback(self.sam_callback)
-        rhn_type_grid.setField(self.public_rhn, 0, 0)
-        rhn_type_grid.setField(self.rhn_satellite, 1, 0)
-        rhn_type_grid.setField(self.sam, 2, 0)
-        elements.setField(rhn_type_grid, 0, 6, anchorLeft= 1, padding = (0, 0, 0, 1))
-        rhn_grid = Grid(2,2)
-        rhn_grid.setField(Label("URL: "), 0, 0, anchorLeft = 1)
-        self.rhn_url = Entry(40, "")
-        self.rhn_url.setCallback(self.rhn_url_callback)
-        rhn_grid.setField(self.rhn_url, 1, 0, anchorLeft = 1, padding=(1, 0, 0, 0))
-        self.rhn_ca = Entry(40, "")
-        self.rhn_ca.setCallback(self.rhn_ca_callback)
-        rhn_grid.setField(Label("CA : "), 0, 1, anchorLeft = 1)
-        rhn_grid.setField(self.rhn_ca, 1, 1, anchorLeft = 1, padding=(1, 0, 0, 0))
-        elements.setField(rhn_grid, 0, 7, anchorLeft = 1, padding = (0, 0, 0, 1))
-        top_proxy_grid = Grid(4,2)
-        bot_proxy_grid = Grid(4,2)
-        elements.setField(Label("HTTP Proxy"), 0, 8, anchorLeft = 1)
-        self.proxyhost = Entry(20, "")
-        self.proxyport = Entry(5, "", scroll = 0)
-        self.proxyuser = Entry(14, "")
-        self.proxypass = Entry(12, "", password = 1)
-        self.proxyhost.setCallback(self.proxyhost_callback)
-        self.proxyport.setCallback(self.proxyport_callback)
-        top_proxy_grid.setField(Label("Server: "), 0, 0, anchorLeft = 1)
-        top_proxy_grid.setField(self.proxyhost, 1, 0, anchorLeft = 1, padding = (0, 0, 1, 0))
-        top_proxy_grid.setField(Label("Port: "), 2, 0, anchorLeft = 1)
-        top_proxy_grid.setField(self.proxyport, 3, 0, anchorLeft = 1, padding = (0, 0, 0, 0))
-        bot_proxy_grid.setField(Label("Username: "), 0, 0, anchorLeft = 1)
-        bot_proxy_grid.setField(self.proxyuser, 1, 0, padding =(0,0,1,0))
-        bot_proxy_grid.setField(Label("Password: "), 2, 0, anchorLeft = 1)
-        bot_proxy_grid.setField(self.proxypass, 3, 0, padding = (0, 0, 0, 0))
-        elements.setField(top_proxy_grid, 0, 10, anchorLeft = 1, padding = (0, 0, 0, 0))
-        elements.setField(bot_proxy_grid, 0, 11, anchorLeft = 1, padding = (0, 0, 0, 0))
-        self.proxyhost.setCallback(self.proxyhost_callback)
-        self.proxyport.setCallback(self.proxyport_callback)
-
-        # optional: profilename, proxyhost, proxyuser, proxypass
-        self.get_rhn_config()
-        if not "https://xmlrpc.rhn.redhat.com/XMLRPC" in self.rv("serverURL"):
-            self.rhn_url.set(self.rv("serverURL"))
-            self.rhn_ca.set(self.rv("sslCACert"))
-        self.proxyhost.set(self.rv("httpProxy"))
-        self.proxyuser.set(self.rv("proxyUser"))
-        self.proxypass.set(self.rv("proxyPassword"))
-        self.rhn_actkey = Entry(40, "")
-        if self.rhn_url.value() == "https://xmlrpc.rhn.redhat.com/XMLRPC" or len(self.rhn_url.value()) == 0:
-            self.public_rhn.setValue("*")
-            self.rhn_url.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_SET)
-            self.rhn_ca.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_SET)
-        else:
-            self.rhn_satellite.setValue(" 0")
-            self.rhn_url.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_RESET)
-            self.rhn_ca.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_RESET)
-        if network_up():
-            elements.setField(Textbox(62,4,"RHN Registration is only required if you wish to use\nRed Hat Enterprise Linux Virtualization or Virtuali-\nzation Platform entitlements for your guests."), 0, 2, anchorLeft = 1)
-        else:
-            elements.setField(Textbox(62,3,"Network Down, Red Hat Network Registration Disabled"), 0, 2, anchorLeft = 1)
-            for i in self.rhn_user, self.rhn_pass, self.profilename, self.public_rhn, self.rhn_satellite, self.sam, self.rhn_url, self.rhn_ca, self.proxyhost, self.proxyport, self.proxyuser, self.proxypass:
-                i.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_SET)
-        return [Label(""), elements]
-
-    def action(self):
-        self.ncs.screen.setColor("BUTTON", "black", "red")
-        self.ncs.screen.setColor("ACTBUTTON", "blue", "white")
-        if not network_up():
-            return False
-        if self.rhn_satellite.value() == 1 and self.rhn_ca.value() == "":
-            ButtonChoiceWindow(self.ncs.screen, "RHN Configuration", "Please input a CA certificate URL", buttons = ['Ok'])
-            return False
-        if len(self.rhn_user.value()) < 1 or len(self.rhn_pass.value()) < 1:
-            ButtonChoiceWindow(self.ncs.screen, "RHN Configuration", "Login/Password must not be empty\n", buttons = ['Ok'])
-            return False
-        if self.sam.value() == 1:
-            reg_rc = run_rhsm(  serverurl=self.rhn_url.value(),
-                cacert=self.rhn_ca.value(),
-                activationkey=self.rhn_actkey.value(),
-                username=self.rhn_user.value(),
-                password=self.rhn_pass.value(),
-                profilename=self.profilename.value(),
-                proxyhost=self.proxyhost.value()+ ":" + self.proxyport.value(),
-                proxyuser=self.proxyuser.value(),
-                proxypass=self.proxypass.value())
-        else:
-            reg_rc = run_rhnreg(  serverurl=self.rhn_url.value(),
-                cacert=self.rhn_ca.value(),
-                activationkey=self.rhn_actkey.value(),
-                username=self.rhn_user.value(),
-                password=self.rhn_pass.value(),
-                profilename=self.profilename.value(),
-                proxyhost=self.proxyhost.value()+ ":" + self.proxyport.value(),
-                proxyuser=self.proxyuser.value(),
-                proxypass=self.proxypass.value())
-        if reg_rc == 0 and not False:
-            ButtonChoiceWindow(self.ncs.screen, "RHN Configuration", "RHN Registration Successful", buttons = ['Ok'])
-            self.ncs.reset_screen_colors()
-            return True
-        elif reg_rc > 0:
-            if reg_rc == 2:
-                msg = "Invalid Username / Password "
-            elif reg_rc == 3:
-                msg = "Unable to retreive satellite certificate"
-            else:
-                msg = "Check ovirt.log for details"
-            ButtonChoiceWindow(self.ncs.screen, "RHN Configuration", "RHN Configuration Failed\n\n" + msg, buttons = ['Ok'])
-            return False
-
-    def rhn_url_callback(self):
-        # TODO URL validation
-        if not is_valid_url(self.rhn_url.value()):
-            self.ncs.screen.setColor("BUTTON", "black", "red")
-            self.ncs.screen.setColor("ACTBUTTON", "blue", "white")
-            ButtonChoiceWindow(self.ncs.screen, "Configuration Check", "Invalid Hostname or Address", buttons = ['Ok'])
-        if self.rhn_satellite.value() == 1:
-            host = self.rhn_url.value().replace("/XMLRPC","")
-
-    def rhn_ca_callback(self):
-        # TODO URL validation
-        msg = ""
-        if not self.rhn_ca.value() == "":
-            if not is_valid_url(self.rhn_ca.value()):
-                msg = "Invalid URL"
-        elif self.rhn_ca.value() == "":
-            msg = "Please input a CA certificate URL"
-        if not msg == "":
-            self.ncs.screen.setColor("BUTTON", "black", "red")
-            self.ncs.screen.setColor("ACTBUTTON", "blue", "white")
-            ButtonChoiceWindow(self.ncs.screen, "Configuration Check", msg, buttons = ['Ok'])
-
-    def get_rhn_config(self):
-        if os.path.exists(RHN_CONFIG_FILE):
-            rhn_config = open(RHN_CONFIG_FILE)
-            try:
-                for line in rhn_config:
-                    if "=" in line and "[comment]" not in line:
-                        item, value = line.split("=")
-                        self.rhn_conf[item] = value.strip()
-            except:
-                pass
-            logger.debug(self.rhn_conf)
-        else:
-            logger.debug("RHN Config does not exist")
-            return
-
-    def rv(self, var):
-        if self.rhn_conf.has_key(var):
-            return self.rhn_conf[var]
-        else:
-            return ""
-
-    def public_rhn_callback(self):
-        self.rhn_satellite.setValue(" 0")
-        self.sam.setValue(" 0")
-        self.rhn_url.set("")
-        self.rhn_ca.set("")
-        self.rhn_url.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_SET)
-        self.rhn_ca.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_SET)
-
-    def rhn_satellite_callback(self):
-        self.public_rhn.setValue(" 0")
-        self.sam.setValue(" 0")
-        self.rhn_url.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_RESET)
-        self.rhn_ca.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_RESET)
-
-    def sam_callback(self):
-        self.public_rhn.setValue(" 0")
-        self.rhn_satellite.setValue(" 0")
-        self.rhn_url.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_RESET)
-        self.rhn_ca.setFlags(_snack.FLAG_DISABLED, _snack.FLAGS_RESET)
-        ButtonChoiceWindow(self.ncs.screen, "RHN Configuration", "Subscription Asset Manager server is not available presently, please consult\n https://access.redhat.com/kb/docs/DOC-45987", buttons = ['Ok'])
-
-    def proxyhost_callback(self):
-        if len(self.proxyhost.value()) > 0:
-            if not is_valid_hostname(self.proxyhost.value()):
-                self.ncs.screen.setColor("BUTTON", "black", "red")
-                self.ncs.screen.setColor("ACTBUTTON", "blue", "white")
-                ButtonChoiceWindow(self.ncs.screen, "Configuration Check", "Invalid Proxy Host", buttons = ['Ok'])
-
-    def proxyport_callback(self):
-        if len(self.proxyport.value()) > 0:
-            if not is_valid_port(self.proxyport.value()):
-                self.ncs.screen.setColor("BUTTON", "black", "red")
-                self.ncs.screen.setColor("ACTBUTTON", "blue", "white")
-                ButtonChoiceWindow(self.ncs.screen, "Configuration Check", "Invalid Proxy Port", buttons = ['Ok'])
-
-def get_plugin(ncs):
-    return Plugin(ncs)
 
+++ /dev/null
-
-from ovirtnode.ovirtfunctions import *
-import os
-
-def enable_snmpd(password):
-    CONF="/var/lib/net-snmp/snmpd.conf"
-    ovirt_store_config("/etc/sysconfig/snmpd")
-    ovirt_store_config("/var/lib/net-snmp")
-    system("service snmpd stop")
-    # reset snmpd options to defaults, image has "-v" to prevent snmpd start
-    system("sed -c -ie '/^OPTIONS/d' /etc/sysconfig/snmpd")
-    if os.path.exists(CONF):
-        system("sed -c -ie '/^createUser root/d' %s" % CONF)
-    os.system("echo \"createUser root SHA %s AES\" >> %s" % (password,CONF))
-    system("service snmpd start")
-
-def disable_snmpd():
-    system("service snmpd stop")
-    system("umount /etc/sysconfig/snmpd")
-    remove_config("/etc/sysconfig/snmpd")
-
-def snmp_auto():
-    if OVIRT_VARS.has_key("OVIRT_SNMP_PASSWORD}"):
-        enable_snmpd(OVIRT_VARS["OVIRT_SNMP_PASSWORD"])
 
+++ /dev/null
-#!/usr/bin/python
-# storage.py - Copyright (C) 2010 Red Hat, Inc.
-# Written by Joey Boggs <
[email protected]>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-from ovirtnode.ovirtfunctions import *
-import os
-import time
-import re
-import subprocess
-from subprocess import PIPE, STDOUT
-import gudev
-
-class Storage:
-    def __init__(self):
-        OVIRT_VARS = parse_defaults()
-        self.overcommit=0.5
-        self.BOOT_SIZE=50
-        self.ROOT_SIZE=256
-        self.CONFIG_SIZE=5
-        self.LOGGING_SIZE=2048
-        self.EFI_SIZE=256
-        self.SWAP_SIZE=""
-        self.SWAP2_SIZE=0
-        self.DATA2_SIZE=0
-        self.BOOTDRIVE = ""
-        self.HOSTVGDRIVE = ""
-        self.APPVGDRIVE = []
-        self.RootBackup_end = self.ROOT_SIZE * 2 + self.EFI_SIZE
-        self.Root_end = self.EFI_SIZE + self.ROOT_SIZE
-        # -1 indicates data partition should use remaining disk
-        self.DATA_SIZE = -1
-        # gpt or msdos partition table type
-        self.LABEL_TYPE="gpt"
-        if OVIRT_VARS.has_key("OVIRT_INIT"):
-            OVIRT_VARS["OVIRT_INIT"] = OVIRT_VARS["OVIRT_INIT"].strip(",")
-            if "," in OVIRT_VARS["OVIRT_INIT"]:
-                disk_count = 0
-                for disk in OVIRT_VARS["OVIRT_INIT"].split(","):
-                    if disk_count < 1:
-                        self.ROOTDRIVE = disk
-                        disk_count = disk_count + 1
-                    else:
-                        self.HOSTVGDRIVE = self.HOSTVGDRIVE + disk + ","
-            else:
-                self.ROOTDRIVE = translate_multipath_device(OVIRT_VARS["OVIRT_INIT"])
-                self.HOSTVGDRIVE = translate_multipath_device(OVIRT_VARS["OVIRT_INIT"])
-        if OVIRT_VARS.has_key("OVIRT_VOL_SWAP2_SIZE"):
-            self.SWAP2_SIZE = OVIRT_VARS["OVIRT_VOL_SWAP2_SIZE"]
-        if OVIRT_VARS.has_key("OVIRT_VOL_DATA2_SIZE"):
-            self.DATA2_SIZE = int(OVIRT_VARS["OVIRT_VOL_DATA2_SIZE"])
-        if OVIRT_VARS.has_key("OVIRT_INIT_APP"):
-            if self.SWAP2_SIZE != 0 or self.DATA2_SIZE != 0:
-                for drv in OVIRT_VARS["OVIRT_INIT_APP"].split(","):
-                    DRIVE = translate_multipath_device(drv)
-                    self.APPVGDRIVE.append(DRIVE)
-            if not self.cross_check_host_app:
-                logger.error("Skip disk partitioning, AppVG overlaps with HostVG")
-                sys.exit(1)
-        else:
-            if self.SWAP2_SIZE != 0 or self.DATA2_SIZE != 0:
-                logger.error("Missing device parameter for AppVG: unable to partition any disk")
-                sys.exit(2)
-
-        mem_size_cmd = "awk '/MemTotal:/ { print $2 }' /proc/meminfo"
-        mem_size_mb = subprocess.Popen(mem_size_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-        MEM_SIZE_MB = mem_size_mb.stdout.read()
-        MEM_SIZE_MB= int(MEM_SIZE_MB) / 1024
-        # we multiply the overcommit coefficient by 10 then divide the
-        # product by 10 to avoid decimals in the result
-        OVERCOMMIT_SWAP_SIZE = int(MEM_SIZE_MB) * self.overcommit * 10 / 10
-        # add to the swap the amounts from http://kbase.redhat.com/faq/docs/DOC-15252
-        MEM_SIZE_GB= int(MEM_SIZE_MB)/1024
-        if MEM_SIZE_GB < 4:
-            BASE_SWAP_SIZE=2048
-        elif MEM_SIZE_GB < 16:
-            BASE_SWAP_SIZE=4096
-        elif MEM_SIZE_GB < 64:
-            BASE_SWAP_SIZE=8192
-        else:
-            BASE_SWAP_SIZE=16384
-        self.SWAP_SIZE = int(BASE_SWAP_SIZE) + int(OVERCOMMIT_SWAP_SIZE)
-
-
-    def cross_check_host_app(self):
-        for hdrv in self.HOSTVGDRIVE:
-            if hdrv in self.APPDRIVE:
-                # Skip disk partitioning, AppVG overlaps with HostVG
-                return False
-            else:
-                return True
-
-    def get_drive_size(self, drive):
-        size_cmd = "sfdisk -s " + drive + " 2>null"
-        size = subprocess.Popen(size_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-        size = size.stdout.read()
-        size = int(int(size) / 1024)
-        return size
-
-
-    def wipe_lvm_on_disk(self, dev):
-        part_delim="p"
-        if "/dev/sd" in dev:
-            part_delim=""
-        vg_cmd = "pvs -o vg_uuid --noheadings \"%s\" \"%s%s\"[0-9]* 2>/dev/null|sort -u" % (dev, dev, part_delim)
-        vg_proc = subprocess.Popen(vg_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-        for vg in vg_proc.stdout.read().split():
-            pvs_cmd="pvs -o pv_name,vg_uuid --noheadings | grep \"%s\" | egrep -v -q \"%s%s[0-9]+|%s \"" % (vg, dev, part_delim, dev)
-            if system(pvs_cmd):
-                logger.error("The volume group \"%s\" spans multiple disks." % vg)
-                logger.error("This operation cannot complete.  Please manually cleanup the storage using standard disk tools.")
-                sys.exit(1)
-            wipe_volume_group(vg)
-        return
-
-
-    def reread_partitions(self, drive):
-        if "dev/mapper" in drive:
-            # kpartx -a -p p "$drive"
-            # XXX fails with spaces in device names (TBI)
-            # ioctl(3, DM_TABLE_LOAD, 0x966980) = -1 EINVAL (Invalid argument)
-            # create/reload failed on 0QEMU    QEMU HARDDISK   drive-scsi0-0-0p1
-            system("partprobe")
-            # partprobe fails on cdrom:
-            # Error: Invalid partition table - recursive partition on /dev/sr0.
-            system("service multipathd reload")
-
-        else:
-            system("blockdev --rereadpt " + drive + " &>>/dev/null")
-
-
-    def get_sd_name(self, id):
-        device_sys_cmd = "grep -H \"^%s$\" /sys/block/*/dev | cut -d: -f1" % id
-        device_sys = subprocess.Popen(device_sys_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-        device_sys_output = device_sys.stdout.read().strip()
-        if not device_sys_output is "":
-            device = os.path.basename(os.path.dirname(device_sys_output))
-            return device
-
-
-    # gets the dependent block devices for multipath devices
-    def get_multipath_deps(self, mpath_device):
-        deplist=""
-        #get dependencies for multipath device
-        deps_cmd = "dmsetup deps -u mpath-%s | sed 's/^.*: //' \
-        | sed 's/, /:/g' | sed 's/[\(\)]//g'" % mpath_device
-        deps = subprocess.Popen(deps_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-        deps_output = deps.stdout.read()
-        for dep in deps_output.split():
-            device=self.get_sd_name(dep)
-            if device is not None:
-                deplist = "%s %s" % (device, deplist)
-        return deplist
-
-        return (dev_names.sort(), self.disk_dict)
-
-    # Find a usable/selected storage device.
-    # If there are none, give a diagnostic and return nonzero.
-    # If there is just one, e.g., /dev/sda, treat it as selected (see below).
-    # and return 0.  If there are two or more, make the user select one
-    # or decline.  Upon decline, return nonzero. Otherwise, print the
-    # selected name, then return 0.
-    # Sample output: /dev/sda
-    def get_dev_name(self):
-        devices = []
-        # list separator
-        for d in os.listdir("/sys/block/"):
-            if re.match("^[hsv]+d", d):
-                devices.append("/dev/%s" % d)
-            byid_list_cmd = "find /dev/disk/by-id -mindepth 1 -not -name '*-part*' 2>/dev/null"
-            byid_list = subprocess.Popen(byid_list_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-            byid_list_output = byid_list.stdout.read()
-        for d in byid_list_output.split():
-            d = os.readlink(d)
-            d_basename = os.path.basename(d)
-            udev_cmd = "udevadm info --name=/dev/" + d_basename + " --query=property | grep -q ^ID_BUS: &>>/dev/null"
-            if os.system(udev_cmd):
-                devices.append("/dev/%s" % d_basename)
-        # FIXME: workaround for detecting cciss devices
-        if os.path.exists("/dev/cciss"):
-            for d in os.listdir("/dev/cciss"):
-                if not re.match("p[0-9]+\$", d):
-                     devices.append("/dev/cciss/%s" % d)
-
-        # include multipath devices
-        devs_to_remove=""
-        multipath_list_cmd = "dmsetup ls --target=multipath | cut -f1"
-        multipath_list = subprocess.Popen(multipath_list_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-        multipath_list_output = multipath_list.stdout.read()
-
-        for d in multipath_list_output.split():
-            devices.append("/dev/mapper/%s" % d)
-            sd_devs=""
-            sd_devs = self.get_multipath_deps(d)
-
-            dm_dev_cmd = "multipath -ll \"%s\" | grep \"%s\" | sed -r 's/^.*(dm-[0-9]+ ).*$/\\1/'" % (d, d)
-            dm_dev = subprocess.Popen(dm_dev_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-            dm_dev_output = dm_dev.stdout.read()
-            devs_to_remove="%s %s %s" % (devs_to_remove, sd_devs, dm_dev_output)
-        # Remove /dev/sd* devices that are part of a multipath device
-        dev_list=[]
-        for d in devices:
-            if os.path.basename(d) not in devs_to_remove and not "/dev/dm-" in d:
-                 dev_list.append(d)
-
-        for dev in dev_list:
-            if dev_list.count(dev) > 1:
-                count = dev_list.count(dev)
-                while (count > 1):
-                    dev_list.remove(dev)
-                    count = count - 1
-        return dev_list
-
-    def get_udev_devices(self):
-        self.disk_dict = {}
-        client = gudev.Client(['block'])
-        for device in client.query_by_subsystem("block"):
-            dev_name = device.get_property("DEVNAME")
-            dev_bus = device.get_property("ID_BUS")
-            dev_model = device.get_property("ID_MODEL")
-            dev_serial = device.get_property("ID_SERIAL")
-            dev_desc = device.get_property("ID_SCSI_COMPAT")
-            dev_size_cmd = "sfdisk -s %s 2>/dev/null" % dev_name
-            dev_size = subprocess.Popen(dev_size_cmd, shell=True, stdout=PIPE, stderr=STDOUT)
-            dev_size = dev_size.stdout.read()
-            size_failed = 0
-            if not device.get_property("ID_CDROM"):
-                try:
-                    dev_size = int(dev_size) / 1024 /1024
-                except:
-                   size_failed = 1
-            if not dev_desc:
-                if "/dev/vd" in dev_name:
-                    dev_desc = "virtio disk"
-                else:
-                    dev_desc = "unknown"
-            if not device.get_property("ID_CDROM") and not "/dev/dm-" in dev_name and not "/dev/loop" in dev_name and size_failed == 0:
-                dev_name = translate_multipath_device(dev_name)
-                if dev_bus == "usb":
-                    dev_bus = "USB Device          "
-                elif dev_bus == "ata" or dev_bus == "scsi" or dev_bus == "cciss" or "/dev/vd" in dev_name:
-                    dev_bus = "Local / FibreChannel"
-                else:
-                    dev_bus = "                    "
-
-                self.disk_dict[dev_name] = "%s,%s,%s,%s,%s,%s" % (dev_bus,dev_name,dev_size,dev_desc,dev_serial,dev_model)
-        devs = self.get_dev_name()
-        return (sorted(devs), self.disk_dict)
-
-    def check_partition_sizes(self):
-        drive_list = []
-        drive_space_dict = {}
-        min_data_size = self.DATA_SIZE
-        if self.DATA_SIZE == -1 :
-            min_data_size=5
-        if OVIRT_VARS["OVIRT_ISCSI_ENABLED"] == "y":
-            BOOTDRIVESPACE = get_drive_size(self.BOOTDRIVE)
-            drive_list.append("BOOT")
-            drive_space_dict["BOOTDRIVESPACE"] = BOOTDRIVESPACE
-            drive_space_dict["BOOT_NEED_SIZE"] = self.BOOT_SIZE
-        else:
-            ROOTDRIVESPACE = get_drive_size(self.ROOTDRIVE)
-            HOSTVGDRIVESPACE = get_drive_size(self.HOSTVGDRIVE)
-            ROOT_NEED_SIZE=self.ROOT_SIZE * 2
-            HOSTVG_NEED_SIZE=self.SWAP_SIZE + self.CONFIG_SIZE + self.LOGGING_SIZE + min_data_size
-            drive_space_dict["ROOTDRIVESPACE"] = ROOTDRIVESPACE
-            drive_space_dict["ROOT_NEED_SIZE"] = ROOT_NEED_SIZE
-            drive_space_dict["HOSTVGDRIVESPACE"] = HOSTVGDRIVESPACE
-            drive_space_dict["HOSTVG_NEED_SIZE"] = HOSTVG_NEED_SIZE
-            if self.ROOTDRIVE == self.HOSTVGDRIVE:
-                drive_list.append("ROOT")
-                ROOT_NEED_SIZE=self.ROOT_SIZE * 2 + HOSTVG_NEED_SIZE
-                drive_space_dict["ROOT_NEED_SIZE"] = ROOT_NEED_SIZE
-            else:
-                drive_list.append("ROOT")
-                drive_list.append("HOSTVG")
-
-            for drive in drive_list:
-                drive_need_size = drive_space_dict[drive + "NEED_SIZE"]
-                drive_disk_size= drive_space_dict[drive + "DRIVESPACE"]
-    
-            if drive_need_size > drive_disk_size:
-                gap_size = drive_need_size - drive_disk_size
-                logger.error("The target storage device is too small for the desired sizes:")
-                logger.error(" Disk Target: " + drive)
-                logger.error(" Size of target storage device: " + drive_disk_size + "MB")
-                logger.error(" Total storage size to be used: " + drive_need_size + "MB")
-                logger.error("You need an additional " + gap_size + "MB of storage.")
-                sys.exit(1)
-            else:
-                logger.info("Required Space : " + drive_need_size + "MB")
-                return True
-
-    def create_hostvg(self):
-        logger.info("Creating LVM partition")
-        logger.info(self.HOSTVGDRIVE)
-        self.physical_vols = []
-        for drv in self.HOSTVGDRIVE.split(","):
-            if drv != "":
-                if self.ROOTDRIVE == drv:
-                    parted_cmd = "parted \"" + drv + "\" -s \"mkpart primary ext2 "+ str(self.RootBackup_end) +"M -1\""
-                    logger.debug(parted_cmd)
-                    system(parted_cmd)
-                    hostvgpart="4"
-                elif self.BOOTDRIVE == drv:
-                    parted_cmd = "parted \"" + drv + "\" -s \"mkpart primary ext2 " + str(self.boot_size_si) + " -1\""
-                    logger.debug(parted_cmd)
-                    system(parted_cmd)
-                    hostvgpart="2"
-                    self.ROOTDRIVE = self.BOOTDRIVE
-                else:
-                    system("parted \""+ drv +"\" -s \"mklabel "+self.LABEL_TYPE+"\"")
-                    parted_cmd = "parted \""+ drv + "\" -s \"mkpart primary ext2 1M -1 \""
-                    logger.debug(parted_cmd)
-                    system(parted_cmd)
-                    hostvgpart = "1"
-                logger.info("Toggling LVM on")
-                parted_cmd = "parted \"" + drv +  "\" -s \"set " + str(hostvgpart) + " lvm on\""
-                logger.debug(parted_cmd)
-                system(parted_cmd)
-                system("parted \"" + self.ROOTDRIVE + "\" -s \"print\"")
-                system("udevadm settle 2> /dev/null || udevsettle &>/dev/null")
-                self.reread_partitions(drv)
-
-                # sync GPT to the legacy MBR partitions
-                if OVIRT_VARS.has_key("OVIRT_INSTALL_ROOT") and OVIRT_VARS["OVIRT_INSTALL_ROOT"] == "y" :
-                    if self.LABEL_TYPE == "gpt":
-                        logger.info("Running gptsync to create legacy mbr")
-                        system("gptsync \"" + self.ROOTDRIVE + "\"")
-
-                partpv = drv + hostvgpart
-                if not os.path.exists(partpv):
-                    # e.g. /dev/cciss/c0d0p2
-                    partpv = drv + "p" + hostvgpart
-                self.physical_vols.append(partpv)
-        drv_count = 0
-        logger.debug(self.physical_vols)
-        for partpv in self.physical_vols:
-            logger.info("Creating physical volume on " + partpv)
-            if not os.path.exists(partpv):
-                logger.error(partpv + "is not available!")
-                return False
-            if not system("dd if=/dev/zero of=\"" + partpv + "\" bs=1024k count=1"):
-                logger.error("Failed to wipe lvm partition")
-                return False
-            if not system("pvcreate -ff -y \"" + partpv + "\""):
-                logger.error("Failed to pvcreate on " + partpv)
-                return False
-            if drv_count < 1:
-                logger.info("Creating volume group on " + partpv)
-                if not system("vgcreate /dev/HostVG \"" + partpv + "\""):
-                    logger.error("Failed to vgcreate /dev/HostVG on " + partpv)
-                    return False
-            else:
-                logger.info("Extending volume group on " + partpv)
-                if not system("vgextend /dev/HostVG \"" + partpv + "\""):
-                    logger.error("Failed to vgextend /dev/HostVG on " + partpv)
-                    return False
-            drv_count = drv_count + 1
-        if self.SWAP_SIZE > 0:
-            logger.info("Creating swap partition")
-            system("lvcreate --name Swap --size "+str(self.SWAP_SIZE) + "M /dev/HostVG")
-            system("mkswap -L \"SWAP\" /dev/HostVG/Swap")
-            os.system("echo \"/dev/HostVG/Swap swap swap defaults 0 0\" >> /etc/fstab")
-            if OVIRT_VARS.has_key("OVIRT_CRYPT_SWAP"):
-                os.system("echo \"SWAP /dev/HostVG/Swap /dev/mapper/ovirt-crypt-swap " + OVIRT_VARS["OVIRT_CRYPT_SWAP"] + "\" >> /etc/ovirt-crypttab")
-        if self.CONFIG_SIZE > 0:
-            logger.info("Creating config partition")
-            system("lvcreate --name Config --size "+str(self.CONFIG_SIZE)+"M /dev/HostVG")
-            system("mke2fs -j -t ext4 /dev/HostVG/Config -L \"CONFIG\"")
-            system("tune2fs -c 0 -i 0 /dev/HostVG/Config")
-        if self.LOGGING_SIZE > 0:
-            logger.info("Creating log partition")
-            system("lvcreate --name Logging --size "+str(self.LOGGING_SIZE)+"M /dev/HostVG")
-            system("mke2fs -j -t ext4 /dev/HostVG/Logging -L \"LOGGING\"")
-            system("tune2fs -c 0 -i 0 /dev/HostVG/Logging")
-            os.system("echo \"/dev/HostVG/Logging /var/log ext4 defaults,noatime 0 0\" >> /etc/fstab")
-        use_data=1
-        if self.DATA_SIZE == -1:
-            logger.info("Creating data partition with remaining free space")
-            system("lvcreate --name Data -l 100%FREE /dev/HostVG")
-            use_data=0
-        elif self.DATA_SIZE > 0:
-            logger.info("Creating data partition")
-            system("lvcreate --name Data --size "+str(self.DATA_SIZE)+"M /dev/HostVG")
-            use_data=0
-        if use_data == 0:
-            system("mke2fs -j -t ext4 /dev/HostVG/Data -L \"DATA\"")
-            system("tune2fs -c 0 -i 0 /dev/HostVG/Data")
-            os.system("echo \"/dev/HostVG/Data /data ext4 defaults,noatime 0 0\" >> /etc/fstab")
-            os.system("echo \"/data/images /var/lib/libvirt/images bind bind 0 0\" >> /etc/fstab")
-            os.system("echo \"/data/core /var/log/core bind bind 0 0\" >> /etc/fstab")
-
-        logger.info("Mounting config partition")
-        mount_config()
-        if os.path.ismount("/config"):
-            ovirt_store_config("/etc/fstab")
-        # remount /var/log from tmpfs to HostVG/Logging
-        unmount_logging()
-        mount_logging()
-        if use_data == 0:
-            logger.info("Mounting data partition")
-            mount_data()
-        logger.info("Completed HostVG Setup!")
-        return True
-
-    def create_appvg(self):
-        logger.info("Creating LVM partition(s) for AppVG")
-        physical_vols = []
-        logger.debug("APPVGDRIVE: " + ' '.join(self.APPVGDRIVE))
-        logger.debug("SWAP2_SIZE: " + str(self.SWAP2_SIZE))
-        logger.debug("DATA2_SIZE: " + str(self.DATA2_SIZE))
-        for drv in self.APPVGDRIVE:
-            wipe_partitions(drv)
-            self.reread_partitions(drv)
-            logger.info("Labeling Drive: " + drv)
-            appvgpart = "1"
-            while True:
-                parted_cmd = "parted -s \"" + drv + "\" \"mklabel " + self.LABEL_TYPE + " mkpart primary ext2 2048s -1 set " + appvgpart + " lvm on print\""
-                system(parted_cmd)
-                self.reread_partitions(drv)
-                if os.path.exists(drv + appvgpart) or os.path.exists(drv + "p" + appvgpart):
-                    break
-
-            partpv = drv + appvgpart
-            if not os.path.exists(partpv):
-                # e.g. /dev/cciss/c0d0p2
-                partpv=drv + "p" + appvgpart
-            logger.info("Creating physical volume")
-            if not os.path.exists(partpv):
-                logger.error(partpv + " is not available!")
-                sys.exit(1)
-            dd_cmd = "dd if=/dev/zero of=\""+ partpv + "\" bs=1024k count=1"
-            logger.info(dd_cmd)
-            system(dd_cmd)
-            system("pvcreate -ff -y \"" + partpv + "\"")
-            physical_vols.append(partpv)
-
-        logger.info("Creating volume group AppVG")
-        is_first = True
-        for drv in physical_vols:
-            if is_first:
-                system("vgcreate AppVG \"" + drv + "\"")
-                is_first = False
-            else:
-                system("vgextend AppVG \"" + drv +"\"")
-
-        if self.SWAP2_SIZE > 0:
-            logger.info("Creating swap2 partition")
-            lv_cmd = "lvcreate --name Swap2 --size \"" + str(self.SWAP2_SIZE) + "M\" /dev/AppVG"
-            logger.debug(lv_cmd)
-            system(lv_cmd)
-            if OVIRT_VARS.has_key("OVIRT_CRYPT_SWAP2"):
-                os.system("echo \"SWAP2 /dev/AppVG/Swap2 /dev/mapper/ovirt-crypt-swap2 " + OVIRT_VARS["OVIRT_CRYPT_SWAP2"] + "\" >> /etc/ovirt-crypttab")
-            else:
-                system("mkswap -L \"SWAP2\" /dev/AppVG/Swap2")
-                os.system("echo \"/dev/AppVG/Swap2 swap swap defaults 0 0\" >> /etc/fstab")
-
-        use_data = "1"
-        if self.DATA2_SIZE == -1:
-            logger.info("Creating data2 partition with remaining free space")
-            system("lvcreate --name Data2 -l 100%FREE /dev/AppVG")
-            use_data = 0
-        elif self.DATA2_SIZE > 0:
-            logger.info("Creating data2 partition")
-            system("lvcreate --name Data2 --size " + str(self.DATA2_SIZE) + "M /dev/AppVG")
-            use_data = 0
-
-        if use_data == 0:
-            system("mke2fs -j -t ext4 /dev/AppVG/Data2 -L \"DATA2\"")
-            system("tune2fs -c 0 -i 0 /dev/AppVG/Data2")
-            os.system("echo \"/dev/AppVG/Data2 /data2 ext4 defaults,noatime 0 0\" >> /etc/fstab")
-            logger.info("Mounting data2 partition")
-            mount_data2()
-            logger.info("Completed AppVG!")
-            return True
-
-    def perform_partitioning(self):
-        if self.HOSTVGDRIVE is None and OVIRT_VARS["OVIRT_ISCSI_ENABLED"] != "y":
-            logger.error("\nNo storage device selected.")
-            return False
-
-        if self.BOOTDRIVE is None and OVIRT_VARS["OVIRT_ISCSI_ENABLED"] == "y":
-            logger.error("No storage device selected.")
-            return False
-
-        logger.info("Saving parameters")
-        unmount_config("/etc/default/ovirt")
-
-        logger.info("Removing old LVM partitions")
-        # HostVG must not exist at this point
-        # we wipe only foreign LVM here
-        logger.info("Wiping LVM on HOSTVGDRIVE %s" % self.HOSTVGDRIVE)
-        self.wipe_lvm_on_disk(self.HOSTVGDRIVE)
-        logger.info("Wiping LVM on ROOTDRIVE %s" % self.ROOTDRIVE)
-        self.wipe_lvm_on_disk(self.ROOTDRIVE)
-        self.boot_size_si = self.BOOT_SIZE * (1024 * 1024) / (1000 * 1000)
-        if OVIRT_VARS.has_key("OVIRT_ISCSI_ENABLED") and OVIRT_VARS["OVIRT_ISCSI_ENABLED"] == "y":
-            logger.info("iSCSI enabled, partitioning boot drive: $BOOTDRIVE")
-            wipe_partitions(self.BOOTDRIVE)
-            reread_partitions(self.BOOTDRIVE)
-            logger.info("Creating boot partition")
-            system("parted \""+ self.BOOTDRIVE+"\" -s \"mklabel "+self.LABEL_TYPE+"\"")
-            system("parted \""+self.BOOTDRIVE+"\" -s \"mkpartfs primary ext2 1M "+self.boot_size_si+"M\"")
-            reread_partitions(self.BOOTDRIVE)
-            partboot= self.BOOTDRIVE + "1"
-            if not os.path.exists(partboot):
-                partboot = self.BOOTDRIVE + "p1"
-            # sleep to ensure filesystems are created before continuing
-            time.sleep(10)
-            system("mke2fs \""+str(partboot)+"\" -L Boot")
-            system("tune2fs -c 0 -i 0 \""+str(partboot)+"\"")
-            if OVIRT_VARS["OVIRT_ISCSI_HOSTVG"] == "y":
-                self.create_hostvg()
-            logger.info("Completed!")
-            return
-        if OVIRT_VARS.has_key("OVIRT_ROOT_INSTALL") and OVIRT_VARS["OVIRT_ROOT_INSTALL"] == "y":
-            logger.info("Partitioning root drive: " + self.ROOTDRIVE)
-            wipe_partitions(self.ROOTDRIVE)
-            self.reread_partitions(self.ROOTDRIVE)
-            logger.info("Labeling Drive: " + self.ROOTDRIVE)
-            parted_cmd = "parted \""+ self.ROOTDRIVE +"\" -s \"mklabel "+ self.LABEL_TYPE+"\""
-            logger.debug(parted_cmd)
-            system(parted_cmd)
-            logger.debug("Creating Root and RootBackup Partitions")
-            parted_cmd = "parted \"" + self.ROOTDRIVE + "\" -s \"mkpart primary fat32 1M "+ str(self.EFI_SIZE)+"M\""
-            logger.debug(parted_cmd)
-            system(parted_cmd)
-            parted_cmd = "parted \"" + self.ROOTDRIVE + "\" -s \"mkpart primary ext2 "+str(self.EFI_SIZE)+" "+ str(self.Root_end)+"M\""
-            logger.debug(parted_cmd)
-            system(parted_cmd)
-            parted_cmd = "parted \""+self.ROOTDRIVE+"\" -s \"mkpart primary ext2 "+str(self.Root_end)+"M "+str(self.RootBackup_end)+"M\""
-            logger.debug(parted_cmd)
-            system(parted_cmd)
-            parted_cmd = "parted \""+self.ROOTDRIVE+"\" -s \"set 1 boot on\""
-            logger.debug(parted_cmd)
-            system(parted_cmd)
-            # sleep to ensure filesystems are created before continuing
-            time.sleep(5)
-            # force reload some cciss devices will fail to mkfs
-            system("multipath -r")
-            self.reread_partitions(self.ROOTDRIVE)
-            partefi = self.ROOTDRIVE + "1"
-            partroot = self.ROOTDRIVE + "2"
-            partrootbackup = self.ROOTDRIVE + "3"
-            if not os.path.exists(partroot):
-                partefi = self.ROOTDRIVE + "p1"
-                partroot = self.ROOTDRIVE + "p2"
-                partrootbackup= self.ROOTDRIVE + "p3"
-            system("ln -snf \""+partefi+"\" /dev/disk/by-label/EFI")
-            system("mkfs.vfat \""+partefi+"\" -n EFI")
-            system("ln -snf \""+partroot+"\" /dev/disk/by-label/Root")
-            system("mke2fs \""+partroot+"\" -L Root")
-            system("tune2fs -c 0 -i 0 \""+partroot+"\"")
-            system("ln -snf \""+partrootbackup+"\" /dev/disk/by-label/RootBackup")
-            system("mke2fs \""+partrootbackup+"\" -L RootBackup")
-            system("tune2fs -c 0 -i 0 \""+partrootbackup+"\"")
-
-        hostvg1=self.HOSTVGDRIVE.split(",")[0]
-        if self.ROOTDRIVE != hostvg1 :
-            system("parted \"" + hostvg1 +"\" -s \"mklabel " + self.LABEL_TYPE + "\"")
-        if self.create_hostvg():
-            if len(self.APPVGDRIVE) > 0:
-                self.create_appvg()
-        else:
-            return False
-        if OVIRT_VARS.has_key("OVIRT_CRYPT_SWAP2") or OVIRT_VARS.has_key("OVIRT_CRYPT_SWAP"):
-            ovirt_store_config("/etc/ovirt-crypttab")
-        return True
-
-    def check_partition_sizes(self):
-        drive_list = []
-        drive_space_dict = {}
-        min_data_size = self.DATA_SIZE
-        if self.DATA_SIZE == -1 :
-            min_data_size=5
-
-        if OVIRT_VARS.has_key("OVIRT_ISCSI_ENABLED"):
-            BOOTDRIVESPACE = self.get_drive_size(self.BOOTDRIVE)
-            drive_list.append("BOOT")
-            drive_space_dict["BOOTDRIVESPACE"] = BOOTDRIVESPACE
-            drive_space_dict["BOOT_NEED_SIZE"] = self.BOOT_SIZE
-        else:
-            ROOTDRIVESPACE = self.get_drive_size(self.ROOTDRIVE)
-            for drive in self.HOSTVGDRIVE.split(","):
-                space = self.get_drive_size(drive)
-                HOSTVGDRIVESPACE = HOSTVGDRIVESPACE + space
-            ROOT_NEED_SIZE=self.ROOT_SIZE * 2
-            HOSTVG_NEED_SIZE= int(self.SWAP_SIZE) + int(self.CONFIG_SIZE) + int(self.LOGGING_SIZE) + int(min_data_size)
-            drive_space_dict["ROOTDRIVESPACE"] = ROOTDRIVESPACE
-            drive_space_dict["ROOT_NEED_SIZE"] = ROOT_NEED_SIZE
-            drive_space_dict["HOSTVGDRIVESPACE"] = HOSTVGDRIVESPACE
-            drive_space_dict["HOSTVG_NEED_SIZE"] = HOSTVG_NEED_SIZE
-            hostvg1=self.HOSTVGDRIVE.split(",")[0]
-            if self.ROOTDRIVE == hostvg1:
-                drive_list.append("ROOT")
-                ROOT_NEED_SIZE=self.ROOT_SIZE * 2 + HOSTVG_NEED_SIZE
-                drive_space_dict["ROOT_NEED_SIZE"] = ROOT_NEED_SIZE
-            else:
-                drive_list.append("ROOT")
-                drive_list.append("HOSTVG")
-
-            for drive in drive_list:
-                drive_need_size = drive_space_dict[drive + "_NEED_SIZE"]
-                drive_disk_size= drive_space_dict[drive + "DRIVESPACE"]
-
-            if drive_need_size > drive_disk_size:
-                gap_size = drive_need_size - drive_disk_size
-                logger.error("The target storage device is too small for the desired sizes:")
-                logger.error(" Disk Target: " + drive)
-                logger.error(" Size of target storage device: " + str(drive_disk_size) + "MB")
-                logger.error(" Total storage size to be used: " + str(drive_need_size) + "MB")
-                logger.error("You need an additional " + str(gap_size) + "MB of storage.")
-                sys.exit(1)
-            else:
-                logger.info("Required Space : " + str(drive_need_size) + "MB")
-
-def storage_auto():
-    storage = Storage()
-    if not OVIRT_VARS["OVIRT_INIT"] == "":
-        if storage.perform_partitioning():
-            return True
-        else:
-            return False
-    else:
-        logger.error("Storage Device Is Required for Auto Installation")
 
+++ /dev/null
-#!/bin/bash
-#
-# Copyright (C) 2009, Red Hat, Inc.
-# Written by Darryl L. Pierce <
[email protected]>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-#
-# Convenience wrapper to give access to the ovirt_store_config
-# function in /usr/libexec/ovirt-functions
-
-. /usr/libexec/ovirt-functions
-
-ME=$(basename "$0")
-warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
-help() { printf "Usage: $ME FILE ...\n
-Unpersists a previous persisted file, removing it from /config.
-The file is restored to its original location.\n\n" >&2; exit 1;
-}
-die() { warn "$*"; help; exit 1; }
-
-if [ $# -eq 0 ]; then die "You need to specify at least one file."; fi
-
-remove_config $*
-
 
+++ /dev/null
-build/
-data/
-dist/
-devdata.db
 
+++ /dev/null
-recursive-include ovirtserver/public *
-include ovirtserver/public/favicon.ico
-recursive-include ovirtserver/i18n *
-recursive-include ovirtserver/templates *
 
+++ /dev/null
-This file is for you to describe the server application. Typically
-you would include information such as the information below:
-
-Installation and Setup
-======================
-
-Install ``server`` using the setup.py script::
-
-    $ cd server
-    $ python setup.py install
-
-Create the project database for any model classes defined::
-
-    $ paster setup-app development.ini
-
-Start the paste http server::
-
-    $ paster serve development.ini
-
-While developing you may want the server to reload after changes in package files (or its dependencies) are saved. This can be achieved easily by adding the --reload option::
-
-    $ paster serve --reload development.ini
-
-Then you are ready to go.
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-[DEFAULT]
-debug = true
-# Uncomment and replace with the address which should receive any error reports
-smtp_server = localhost
-error_email_from = paste@localhost
-
-[server:main]
-use = egg:Paste#http
-host = 127.0.0.1
-port = 8080
-
-[app:main]
-use = egg:server
-full_stack = true
-#lang = ru
-cache_dir = %(here)s/data
-beaker.session.key = ovirtserver
-beaker.session.secret = somesecret
-
-# If you'd like to fine-tune the individual locations of the cache data dirs
-# for the Cache data, or the Session saves, un-comment the desired settings
-# here:
-#beaker.cache.data_dir = %(here)s/data/cache
-#beaker.session.data_dir = %(here)s/data/sessions
-
-# pick the form for your database
-# %(here) may include a ':' character on Windows environments; this can
-# invalidate the URI when specifying a SQLite db via path name
-# sqlalchemy.url=postgres://username:password@hostname:port/databasename
-# sqlalchemy.url=mysql://username:password@hostname:port/databasename
-
-
-# If you have sqlite, here's a simple default to get you started
-# in development
-
-sqlalchemy.url = sqlite:///%(here)s/devdata.db
-#echo shouldn't be used together with the logging module.
-sqlalchemy.echo = false
-sqlalchemy.echo_pool = false
-sqlalchemy.pool_recycle = 3600
-
-# if you are using Mako and want to be able to reload
-# the mako template from disk during the development phase
-# you should say 'true' here
-# This option is only used for mako templating engine
-# WARNING: if you want to deploy your application using a zipped egg
-# (ie: if your application's setup.py defines zip-safe=True, then you
-# MUST put "false" for the production environment because there will
-# be no disk and real files to compare time with.
-# On the contrary if your application defines zip-safe=False and is
-# deployed in an unzipped manner, then you can leave this option to true
-templating.mako.reloadfromdisk = true
-
-# the compiled template dir is a directory that must be readable by your
-# webserver. It will be used to store the resulting templates once compiled
-# by the TemplateLookup system.
-# During development you generally don't need this option since paste's HTTP
-# server will have access to you development directories, but in production
-# you'll most certainly want to have apache or nginx to write in a directory
-# that does not contain any source code in any form for obvious security reasons.
-#
-#templating.mako.compiled_templates_dir = /some/dir/where/webserver/has/access
-
-# WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT*
-# Debug mode will enable the interactive debugging tool, allowing ANYONE to
-# execute malicious code after an exception is raised.
-#set debug = false
-
-# Logging configuration
-# Add additional loggers, handlers, formatters here
-# Uses python's logging config file format
-# http://docs.python.org/lib/logging-config-fileformat.html
-
-[loggers]
-keys = root, ovirtserver, sqlalchemy
-
-[handlers]
-keys = console
-
-[formatters]
-keys = generic
-
-# If you create additional loggers, add them as a key to [loggers]
-[logger_root]
-level = INFO
-handlers = console
-
-[logger_ovirtserver]
-level = DEBUG
-handlers =
-qualname = ovirtserver
-
-[logger_sqlalchemy]
-level = INFO
-handlers =
-qualname = sqlalchemy.engine
-# "level = INFO" logs SQL queries.
-# "level = DEBUG" logs SQL queries and results.
-# "level = WARN" logs neither.  (Recommended for production systems.)
-
-
-# If you create additional handlers, add them as a key to [handlers]
-[handler_console]
-class = StreamHandler
-args = (sys.stderr,)
-level = NOTSET
-formatter = generic
-
-# If you create additional formatters, add them as a key to [formatters]
-[formatter_generic]
-format = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
-datefmt = %H:%M:%S
 
+++ /dev/null
-This directory exists so that Subversion-based projects can share a single
-copy of the ``ez_setup`` bootstrap module for ``setuptools``, and have it
-automatically updated in their projects when ``setuptools`` is updated.
-
-For your convenience, you may use the following svn:externals definition::
-
-    ez_setup svn://svn.eby-sarna.com/svnroot/ez_setup
-
-You can set this by executing this command in your project directory::
-
-    svn propedit svn:externals .
-
-And then adding the line shown above to the file that comes up for editing.
-Then, whenever you update your project, ``ez_setup`` will be updated as well.
 
+++ /dev/null
-#!python
-#
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""Bootstrap setuptools installation
-
-If you want to use setuptools in your package's setup.py, just include this
-file in the same directory with it, and add this to the top of your setup.py::
-
-    from ez_setup import use_setuptools
-    use_setuptools()
-
-If you want to require a specific version of setuptools, set a download
-mirror, or use an alternate download directory, you can do so by supplying
-the appropriate options to ``use_setuptools()``.
-
-This file can also be run as a script to install or upgrade setuptools.
-"""
-import sys
-DEFAULT_VERSION = "0.6c7"
-DEFAULT_URL     = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3]
-
-md5_data = {
-    'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca',
-    'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb',
-    'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b',
-    'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a',
-    'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618',
-    'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac',
-    'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5',
-    'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4',
-    'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c',
-    'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b',
-    'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27',
-    'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277',
-    'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa',
-    'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e',
-    'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e',
-    'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f',
-    'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2',
-    'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc',
-    'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167',
-    'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64',
-    'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d',
-    'setuptools-0.6c6-py2.3.egg': '35686b78116a668847237b69d549ec20',
-    'setuptools-0.6c6-py2.4.egg': '3c56af57be3225019260a644430065ab',
-    'setuptools-0.6c6-py2.5.egg': 'b2f8a7520709a5b34f80946de5f02f53',
-    'setuptools-0.6c7-py2.3.egg': '209fdf9adc3a615e5115b725658e13e2',
-    'setuptools-0.6c7-py2.4.egg': '5a8f954807d46a0fb67cf1f26c55a82e',
-    'setuptools-0.6c7-py2.5.egg': '45d2ad28f9750e7434111fde831e8372',
-}
-
-import sys, os
-
-def _validate_md5(egg_name, data):
-    if egg_name in md5_data:
-        from md5 import md5
-        digest = md5(data).hexdigest()
-        if digest != md5_data[egg_name]:
-            print >>sys.stderr, (
-                "md5 validation of %s failed!  (Possible download problem?)"
-                % egg_name
-            )
-            sys.exit(2)
-    return data
-
-
-def use_setuptools(
-    version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
-    download_delay=15
-):
-    """Automatically find/download setuptools and make it available on sys.path
-
-    `version` should be a valid setuptools version number that is available
-    as an egg for download under the `download_base` URL (which should end with
-    a '/').  `to_dir` is the directory where setuptools will be downloaded, if
-    it is not already available.  If `download_delay` is specified, it should
-    be the number of seconds that will be paused before initiating a download,
-    should one be required.  If an older version of setuptools is installed,
-    this routine will print a message to ``sys.stderr`` and raise SystemExit in
-    an attempt to abort the calling script.
-    """
-    try:
-        import setuptools
-        if setuptools.__version__ == '0.0.1':
-            print >>sys.stderr, (
-            "You have an obsolete version of setuptools installed.  Please\n"
-            "remove it from your system entirely before rerunning this script."
-            )
-            sys.exit(2)
-    except ImportError:
-        egg = download_setuptools(version, download_base, to_dir, download_delay)
-        sys.path.insert(0, egg)
-        import setuptools; setuptools.bootstrap_install_from = egg
-
-    import pkg_resources
-    try:
-        pkg_resources.require("setuptools>="+version)
-
-    except pkg_resources.VersionConflict, e:
-        # XXX could we install in a subprocess here?
-        print >>sys.stderr, (
-            "The required version of setuptools (>=%s) is not available, and\n"
-            "can't be installed while this script is running. Please install\n"
-            " a more recent version first.\n\n(Currently using %r)"
-        ) % (version, e.args[0])
-        sys.exit(2)
-
-def download_setuptools(
-    version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
-    delay = 15
-):
-    """Download setuptools from a specified location and return its filename
-
-    `version` should be a valid setuptools version number that is available
-    as an egg for download under the `download_base` URL (which should end
-    with a '/'). `to_dir` is the directory where the egg will be downloaded.
-    `delay` is the number of seconds to pause before an actual download attempt.
-    """
-    import urllib2, shutil
-    egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3])
-    url = download_base + egg_name
-    saveto = os.path.join(to_dir, egg_name)
-    src = dst = None
-    if not os.path.exists(saveto):  # Avoid repeated downloads
-        try:
-            from distutils import log
-            if delay:
-                log.warn("""
----------------------------------------------------------------------------
-This script requires setuptools version %s to run (even to display
-help).  I will attempt to download it for you (from
-%s), but
-you may need to enable firewall access for this script first.
-I will start the download in %d seconds.
-
-(Note: if this machine does not have network access, please obtain the file
-
-   %s
-
-and place it in this directory before rerunning this script.)
----------------------------------------------------------------------------""",
-                    version, download_base, delay, url
-                ); from time import sleep; sleep(delay)
-            log.warn("Downloading %s", url)
-            src = urllib2.urlopen(url)
-            # Read/write all in one block, so we don't create a corrupt file
-            # if the download is interrupted.
-            data = _validate_md5(egg_name, src.read())
-            dst = open(saveto,"wb"); dst.write(data)
-        finally:
-            if src: src.close()
-            if dst: dst.close()
-    return os.path.realpath(saveto)
-
-def main(argv, version=DEFAULT_VERSION):
-    """Install or upgrade setuptools and EasyInstall"""
-
-    try:
-        import setuptools
-    except ImportError:
-        egg = None
-        try:
-            egg = download_setuptools(version, delay=0)
-            sys.path.insert(0,egg)
-            from setuptools.command.easy_install import main
-            return main(list(argv)+[egg])   # we're done here
-        finally:
-            if egg and os.path.exists(egg):
-                os.unlink(egg)
-    else:
-        if setuptools.__version__ == '0.0.1':
-            # tell the user to uninstall obsolete version
-            use_setuptools(version)
-
-    req = "setuptools>="+version
-    import pkg_resources
-    try:
-        pkg_resources.require(req)
-    except pkg_resources.VersionConflict:
-        try:
-            from setuptools.command.easy_install import main
-        except ImportError:
-            from easy_install import main
-        main(list(argv)+[download_setuptools(delay=0)])
-        sys.exit(0) # try to force an exit
-    else:
-        if argv:
-            from setuptools.command.easy_install import main
-            main(argv)
-        else:
-            print "Setuptools version",version,"or greater has been installed."
-            print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)'
-
-
-
-def update_md5(filenames):
-    """Update our built-in md5 registry"""
-
-    import re
-    from md5 import md5
-
-    for name in filenames:
-        base = os.path.basename(name)
-        f = open(name,'rb')
-        md5_data[base] = md5(f.read()).hexdigest()
-        f.close()
-
-    data = ["    %r: %r,\n" % it for it in md5_data.items()]
-    data.sort()
-    repl = "".join(data)
-
-    import inspect
-    srcfile = inspect.getsourcefile(sys.modules[__name__])
-    f = open(srcfile, 'rb'); src = f.read(); f.close()
-
-    match = re.search("\nmd5_data = {\n([^}]+)}", src)
-    if not match:
-        print >>sys.stderr, "Internal error!"
-        sys.exit(2)
-
-    src = src[:match.start(1)] + repl + src[match.end(1):]
-    f = open(srcfile,'w')
-    f.write(src)
-    f.close()
-
-
-if __name__=='__main__':
-    if len(sys.argv)>2 and sys.argv[1]=='--md5update':
-        update_md5(sys.argv[2:])
-    else:
-        main(sys.argv[1:])
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""The server package"""
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""
-Global configuration file for TG2-specific settings in server.
-
-This file complements development/deployment.ini.
-
-Please note that **all the argument values are strings**. If you want to
-convert them into boolean, for example, you should use the
-:func:`paste.deploy.converters.asbool` function, as in::
-
-    from paste.deploy.converters import asbool
-    setting = asbool(global_conf.get('the_setting'))
-
-"""
-
-from tg.configuration import AppConfig
-
-import ovirtserver
-from ovirtserver import model
-from ovirtserver.lib import app_globals, helpers
-
-base_config = AppConfig()
-base_config.renderers = []
-
-base_config.package = ovirtserver
-
-#Set the default renderer
-base_config.default_renderer = 'genshi'
-base_config.renderers.append('genshi')
-# if you want raw speed and have installed chameleon.genshi
-# you should try to use this renderer instead.
-# warning: for the moment chameleon does not handle i18n translations
-#base_config.renderers.append('chameleon_genshi')
-
-#Configure the base SQLALchemy Setup
-base_config.use_sqlalchemy = True
-base_config.model = ovirtserver.model
-base_config.DBSession = ovirtserver.model.DBSession
 
+++ /dev/null
-# Copyright (C) yyyy, your name.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-#
-# server - TurboGears configuration
-#
-# The %(here)s variable will be replaced with the parent directory of this file
-#
-[DEFAULT]
-# WARGING == If debug is not set to false, you'll get the interactive
-# debugger on production, which is a huge security hole.
-
-debug = false
-smtp_server = localhost
-error_email_from = paste@localhost
-
-[server:main]
-use = egg:Paste#http
-host = 0.0.0.0
-port = 8080
-
-[app:main]
-use = egg:server
-full_stack = true
-cache_dir = %(here)s/data
-beaker.session.key = ovirtserver
-beaker.session.secret = ${app_instance_secret}
-app_instance_uuid = ${app_instance_uuid}
-
-# If you'd like to fine-tune the individual locations of the cache data dirs
-# for the Cache data, or the Session saves, un-comment the desired settings
-# here:
-#beaker.cache.data_dir = %(here)s/data/cache
-#beaker.session.data_dir = %(here)s/data/sessions
-# Specify the database for SQLAlchemy to use via
-# turbogears.database
-# %(here) may include a ':' character on Windows environments; this can
-# invalidate the URI when specifying a SQLite db via path name
-sqlalchemy.url = sqlite:///%(here)s/somedb.db
-sqlalchemy.echo = False
-
-# WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT*
-# Debug mode will enable the interactive debugging tool, allowing ANYONE to
-# execute malicious code after an exception is raised.
-#set debug = false
-
-# Logging configuration
-# Add additional loggers, handlers, formatters here
-# Uses python's logging config file format
-# http://docs.python.org/lib/logging-config-fileformat.html
-
-[loggers]
-keys = root, ovirtserver, sqlalchemy
-
-[handlers]
-keys = console
-
-[formatters]
-keys = generic
-
-# If you create additional loggers, add them as a key to [loggers]
-[logger_root]
-level = INFO
-handlers = console
-
-[logger_ovirtserver]
-level = INFO
-handlers =
-qualname = ovirtserver
-
-[logger_sqlalchemy]
-level = WARN
-handlers =
-qualname = sqlalchemy.engine
-# "level = INFO" logs SQL queries.
-# "level = DEBUG" logs SQL queries and results.
-# "level = WARN" logs neither.  (Recommended for production systems.)
-
-
-# If you create additional handlers, add them as a key to [handlers]
-[handler_console]
-class = StreamHandler
-args = (sys.stderr,)
-level = NOTSET
-formatter = generic
-
-# If you create additional formatters, add them as a key to [formatters]
-[formatter_generic]
-format = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
-datefmt = %H:%M:%S
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""WSGI environment setup for server."""
-
-from ovirtserver.config.app_cfg import base_config
-
-__all__ = ['load_environment']
-
-#Use base_config to setup the environment loader function
-load_environment = base_config.make_load_environment()
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""WSGI middleware initialization for the server application."""
-
-from ovirtserver.config.app_cfg import base_config
-from ovirtserver.config.environment import load_environment
-
-
-__all__ = ['make_app']
-
-# Use base_config to setup the necessary PasteDeploy application factory.
-# make_base_app will wrap the TG2 app with all the middleware it needs.
-make_base_app = base_config.setup_tg_wsgi_app(load_environment)
-
-
-def make_app(global_conf, full_stack=True, **app_conf):
-    """
-    Set server up with the settings found in the PasteDeploy configuration
-    file used.
-
-    :param global_conf: The global settings for server (those
-        defined under the ``[DEFAULT]`` section).
-    :type global_conf: dict
-    :param full_stack: Should the whole TG2 stack be set up?
-    :type full_stack: str or bool
-    :return: The server application with all the relevant middleware
-        loaded.
-
-    This is the PasteDeploy factory for the server application.
-
-    ``app_conf`` contains all the application-specific settings (those defined
-    under ``[app:main]``.
-
-
-    """
-    app = make_base_app(global_conf, full_stack=True, **app_conf)
-
-    # Wrap your base TurboGears 2 application with custom middleware here
-
-    return app
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""Controllers for the server application."""
 
+++ /dev/null
-# Copyright (C) yyyy, your name
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""Sample controller module"""
-
-# turbogears imports
-from tg import expose
-#from tg import redirect, validate, flash
-
-# third party imports
-#from pylons.i18n import ugettext as _
-#from repoze.what import predicates
-
-# project specific imports
-from ovirtserver.lib.base import BaseController
-#from ovirtserver.model import DBSession, metadata
-
-
-class SampleController(BaseController):
-
-    @expose('ovirtserver.templates.index')
-    def index(self):
-        return dict(page='index')
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""Error controller"""
-
-from tg import request, expose
-
-__all__ = ['ErrorController']
-
-
-class ErrorController(object):
-    """
-    Generates error documents as and when they are required.
-
-    The ErrorDocuments middleware forwards to ErrorController when error
-    related status codes are returned from the application.
-
-    This behaviour can be altered by changing the parameters to the
-    ErrorDocuments middleware in your config/middleware.py file.
-
-    """
-
-    @expose('ovirtserver.templates.error')
-    def document(self, *args, **kwargs):
-        """Render the error document"""
-        resp = request.environ.get('pylons.original_response')
-        default_message = ("<p>We're sorry but we weren't able to process "
-                           " this request.</p>")
-        values = dict(prefix=request.environ.get('SCRIPT_NAME', ''),
-                      code=request.params.get('code', resp.status_int),
-                      message=request.params.get('message', default_message))
-        return values
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""Main Controller"""
-
-from tg import expose, flash, require, url, request, redirect
-from pylons.i18n import ugettext as _, lazy_ugettext as l_
-
-from ovirtserver.lib.base import BaseController
-from ovirtserver.model import DBSession, metadata
-from ovirtserver.controllers.error import ErrorController
-
-__all__ = ['RootController']
-
-
-class RootController(BaseController):
-    """
-    The root controller for the server application.
-
-    All the other controllers and WSGI applications should be mounted on this
-    controller. For example::
-
-        panel = ControlPanelController()
-        another_app = AnotherWSGIApplication()
-
-    Keep in mind that WSGI applications shouldn't be mounted directly: They
-    must be wrapped around with :class:`tg.controllers.WSGIAppController`.
-
-    """
-
-    error = ErrorController()
-
-    @expose('ovirtserver.templates.index')
-    def index(self):
-        """Handle the front-page."""
-        return dict(page='index')
-
-    @expose('ovirtserver.templates.about')
-    def about(self):
-        """Handle the 'about' page."""
-        return dict(page='about')
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""Sample controller with all its actions protected."""
-
-# This controller is only used when you activate auth. You can safely remove
-# this file from your project.
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""Fallback controller."""
-
-from ovirtserver.lib.base import BaseController
-
-__all__ = ['TemplateController']
-
-
-class TemplateController(BaseController):
-    """
-    The fallback controller for server.
-
-    By default, the final controller tried to fulfill the request
-    when no other routes match. It may be used to display a template
-    when all else fails, e.g.::
-
-        def view(self, url):
-            return render('/%s' % url)
-
-    Or if you're using Mako and want to explicitly send a 404 (Not
-    Found) response code when the requested template doesn't exist::
-
-        import mako.exceptions
-
-        def view(self, url):
-            try:
-                return render('/%s' % url)
-            except mako.exceptions.TopLevelLookupException:
-                abort(404)
-
-    """
-
-    def view(self, url):
-        """Abort the request with a 404 HTTP status code."""
-        abort(404)
 
+++ /dev/null
-# Russian translations for ${package}.
-# Copyright (C) 2008 ORGANIZATION
-# This file is distributed under the same license as the ${package} project.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2008.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: ${package} 0.0.0\n"
-"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2008-01-13 14:00+0200\n"
-"PO-Revision-Date: 2008-01-13 14:00+0200\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: ru <
[email protected]>\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
-"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 0.9.1\n"
-
-#: ${package}/controllers/root.py:13
-msgid "Your application is now running"
-msgstr "Ваши приложение успешно запущено"
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""The application's Globals object"""
-
-__all__ = ['Globals']
-
-
-class Globals(object):
-    """Container for objects available throughout the life of the application.
-
-    One instance of Globals is created during application initialization and
-    is available during requests via the 'app_globals' variable.
-
-    """
-
-    def __init__(self):
-        """Do nothing, by default."""
-        pass
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""The base Controller API."""
-
-from tg import TGController, tmpl_context
-from tg.render import render
-from pylons.i18n import _, ungettext, N_
-from tw.api import WidgetBunch
-import ovirtserver.model as model
-
-__all__ = ['Controller', 'BaseController']
-
-
-class BaseController(TGController):
-    """
-    Base class for the controllers in the application.
-
-    Your web application should have one of these. The root of
-    your application is used to compute URLs used by your app.
-
-    """
-
-    def __call__(self, environ, start_response):
-        """Invoke the Controller"""
-        # TGController.__call__ dispatches to the Controller method
-        # the request is routed to. This routing information is
-        # available in environ['pylons.routes_dict']
-
-        return TGController.__call__(self, environ, start_response)
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""WebHelpers used in server."""
-
-from webhelpers import date, feedgenerator, html, number, misc, text
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""The application's model objects"""
-
-from zope.sqlalchemy import ZopeTransactionExtension
-from sqlalchemy.orm import scoped_session, sessionmaker
-#from sqlalchemy import MetaData
-from sqlalchemy.ext.declarative import declarative_base
-
-# Global session manager: DBSession() returns the Thread-local
-# session object appropriate for the current web request.
-maker = sessionmaker(autoflush=True, autocommit=False,
-                     extension=ZopeTransactionExtension())
-DBSession = scoped_session(maker)
-
-# Base class for all of our model classes: By default, the data model is
-# defined with SQLAlchemy's declarative extension, but if you need more
-# control, you can switch to the traditional method.
-DeclarativeBase = declarative_base()
-
-# There are two convenient ways for you to spare some typing.
-# You can have a query property on all your model classes by doing this:
-# DeclarativeBase.query = DBSession.query_property()
-# Or you can use a session-aware mapper as it was used in TurboGears 1:
-# DeclarativeBase = declarative_base(mapper=DBSession.mapper)
-
-# Global metadata.
-# The default metadata is the one from the declarative base.
-metadata = DeclarativeBase.metadata
-
-# If you have multiple databases with overlapping table names, you'll need a
-# metadata for each database. Feel free to rename 'metadata2'.
-#metadata2 = MetaData()
-
-#####
-# Generally you will not want to define your table's mappers, and data objects
-# here in __init__ but will want to create modules them in the model directory
-# and import them at the bottom of this file.
-#
-######
-
-def init_model(engine):
-    """Call me before using any of the tables or classes in the model."""
-
-    DBSession.configure(bind=engine)
-    # If you are using reflection to introspect your database and create
-    # table objects for you, your tables must be defined and mapped inside
-    # the init_model function, so that the engine is available if you
-    # use the model outside tg2, you need to make sure this is called before
-    # you use the model.
-
-    #
-    # See the following example:
-
-    #global t_reflected
-
-    #t_reflected = Table("Reflected", metadata,
-    #    autoload=True, autoload_with=engine)
-
-    #mapper(Reflected, t_reflected)
-
-# Import your model modules here.
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""
-Auth* related model.
-
-This is where the models used by :mod:`repoze.who` and :mod:`repoze.what` are
-defined.
-
-It's perfectly fine to re-use this definition in the server application,
-though.
-
-"""
 
+++ /dev/null
-# Copyright (C) yyyy, your name.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""Sample model module."""
-
-from sqlalchemy import *
-from sqlalchemy.orm import mapper, relation
-from sqlalchemy import Table, ForeignKey, Column
-from sqlalchemy.types import Integer, Unicode
-#from sqlalchemy.orm import relation, backref
-
-from ovirtserver.model import DeclarativeBase, metadata, DBSession
-
-
-class SampleModel(DeclarativeBase):
-    __tablename__ = 'sample_model'
-
-    #{ Columns
-
-    id = Column(Integer, primary_key=True)
-
-    data = Column(Unicode(255), nullable=False)
-
-    #}
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""Templates package for the application."""
 
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
-      xmlns:py="http://genshi.edgewall.org/"
-      xmlns:xi="http://www.w3.org/2001/XInclude">
-
-  <xi:include href="master.html" />
-
-<head>
-  <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
-  <title>A ${code} Error has Occurred </title>
-</head>
-
-<body>
-<h1>Error ${code}</h1>
-
-<div>${XML(message)}</div>
-</body>
-</html>
 
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
-      xmlns:py="http://genshi.edgewall.org/"
-      xmlns:xi="http://www.w3.org/2001/XInclude">
-
-  <head>
-    <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
-    <title>Welcome to the oVirt management server</title>
-  </head>
-
-  <body>
-    <h1>Welcome To The oVirt Server Reference Implementation</h1>
-
-    <p>
-      This server provides a reference implementation for how a management server should interact
-      with the oVirt managed node.
-    </p>
-  </body>
-</html>
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""Unit and functional test suite for server."""
-
-from os import path
-import sys
-
-from tg import config
-from paste.deploy import loadapp
-from paste.script.appinstall import SetupCommand
-from routes import url_for
-from webtest import TestApp
-from nose.tools import eq_
-
-from ovirtserver import model
-
-__all__ = ['setup_db', 'teardown_db', 'TestController', 'url_for']
-
-def setup_db():
-    """Method used to build a database"""
-    engine = config['pylons.app_globals'].sa_engine
-    model.init_model(engine)
-    model.metadata.create_all(engine)
-
-def teardown_db():
-    """Method used to destroy a database"""
-    engine = config['pylons.app_globals'].sa_engine
-    model.metadata.drop_all(engine)
-
-
-class TestController(object):
-    """
-    Base functional test case for the controllers.
-
-    The server application instance (``self.app``) set up in this test
-    case (and descendants) has authentication disabled, so that developers can
-    test the protected areas independently of the :mod:`repoze.who` plugins
-    used initially. This way, authentication can be tested once and separately.
-
-    Check ovirtserver.tests.functional.test_authentication for the repoze.who
-    integration tests.
-
-    This is the officially supported way to test protected areas with
-    repoze.who-testutil (http://code.gustavonarea.net/repoze.who-testutil/).
-
-    """
-
-    application_under_test = 'main_without_authn'
-
-    def setUp(self):
-        """Method called by nose before running each test"""
-        # Loading the application:
-        conf_dir = config.here
-        wsgiapp = loadapp('config:test.ini#%s' % self.application_under_test,
-                          relative_to=conf_dir)
-        self.app = TestApp(wsgiapp)
-        # Setting it up:
-        test_file = path.join(conf_dir, 'test.ini')
-        cmd = SetupCommand('setup-app')
-        cmd.run([test_file])
-
-    def tearDown(self):
-        """Method called by nose after running each test"""
-        # Cleaning up the database:
-        teardown_db()
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""Functional test suite for the controllers of the application."""
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""
-Functional test suite for the root controller.
-
-This is an example of how functional tests can be written for controllers.
-
-As opposed to a unit-test, which test a small unit of functionality,
-functional tests exercise the whole application and its WSGI stack.
-
-Please read http://pythonpaste.org/webtest/ for more information.
-
-"""
-from nose.tools import assert_true
-
-from ovirtserver.tests import TestController
-
-
-class TestRootController(TestController):
-    def test_index(self):
-        response = self.app.get('/')
-        msg = 'TurboGears 2 is rapid web application development toolkit '\
-              'designed to make your life easier.'
-        # You can look for specific strings:
-        assert_true(msg in response)
-
-        # You can also access a BeautifulSoup'ed response in your tests
-        # (First run $ easy_install BeautifulSoup
-        # and then uncomment the next two lines)
-
-        #links = response.html.findAll('a')
-        #print links
-        #assert_true(links, "Mummy, there are no links here!")
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""Unit test suite for the models of the application."""
-from nose.tools import assert_equals
-
-from ovirtserver.model import DBSession
-from ovirtserver.tests import setup_db, teardown_db
-
-__all__ = ['ModelTest']
-
-#Create an empty database before we start our tests for this module
-def setup():
-    """Function called by nose on module load"""
-    setup_db()
-
-#Teardown that database
-def teardown():
-    """Function called by nose after all tests in this module ran"""
-    teardown_db()
-
-class ModelTest(object):
-    """Base unit test case for the models."""
-
-    klass = None
-    attrs = {}
-
-    def setup(self):
-        try:
-            new_attrs = {}
-            new_attrs.update(self.attrs)
-            new_attrs.update(self.do_get_dependencies())
-            self.obj = self.klass(**new_attrs)
-            DBSession.add(self.obj)
-            DBSession.flush()
-            return self.obj
-        except:
-            DBSession.rollback()
-            raise
-
-    def tearDown(self):
-        DBSession.rollback()
-
-    def do_get_dependencies(self):
-        """Use this method to pull in other objects that need to be created for this object to be build properly"""
-        return {}
-
-    def test_create_obj(self):
-        pass
-
-    def test_query_obj(self):
-        obj = DBSession.query(self.klass).one()
-        for key, value in self.attrs.iteritems():
-            assert_equals(getattr(obj, key), value)
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""Test suite for the TG app's models"""
-from nose.tools import eq_
-
-from ovirtserver import model
-from ovirtserver.tests.models import ModelTest
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-"""Setup the server application"""
-
-import logging
-
-import transaction
-from tg import config
-
-from ovirtserver.config.environment import load_environment
-
-__all__ = ['setup_app']
-
-log = logging.getLogger(__name__)
-
-
-def setup_app(command, conf, vars):
-    """Place any commands to setup ovirtserver here"""
-    load_environment(conf.global_conf, conf.local_conf)
-    # Load the models
-    from ovirtserver import model
-    print "Creating tables"
-    model.metadata.create_all(bind=config['pylons.app_globals'].sa_engine)
-
-
-    transaction.commit()
-    print "Successfully setup"
 
+++ /dev/null
-Metadata-Version: 1.0
-Name: server
-Version: 0.1dev
-Summary: UNKNOWN
-Home-page: UNKNOWN
-Author: UNKNOWN
-Author-email: UNKNOWN
-License: UNKNOWN
-Description: UNKNOWN
-Platform: UNKNOWN
 
+++ /dev/null
-MANIFEST.in
-README.txt
-setup.cfg
-setup.py
-ovirtserver/__init__.py
-ovirtserver/websetup.py
-ovirtserver/config/__init__.py
-ovirtserver/config/app_cfg.py
-ovirtserver/config/environment.py
-ovirtserver/config/middleware.py
-ovirtserver/controllers/__init__.py
-ovirtserver/controllers/error.py
-ovirtserver/controllers/root.py
-ovirtserver/controllers/secure.py
-ovirtserver/controllers/template.py
-ovirtserver/i18n/ru/LC_MESSAGES/ovirtserver.po
-ovirtserver/lib/__init__.py
-ovirtserver/lib/app_globals.py
-ovirtserver/lib/base.py
-ovirtserver/lib/helpers.py
-ovirtserver/model/__init__.py
-ovirtserver/model/auth.py
-ovirtserver/public/favicon.ico
-ovirtserver/public/css/style.css
-ovirtserver/public/images/contentbg.png
-ovirtserver/public/images/error.png
-ovirtserver/public/images/header_inner2.png
-ovirtserver/public/images/headerbg.png
-ovirtserver/public/images/info.png
-ovirtserver/public/images/inputbg.png
-ovirtserver/public/images/loginbg.png
-ovirtserver/public/images/loginbottombg.png
-ovirtserver/public/images/loginheader-left.png
-ovirtserver/public/images/loginheader-right.png
-ovirtserver/public/images/menu-item-actibg-first.png
-ovirtserver/public/images/menu-item-actibg.png
-ovirtserver/public/images/menu-item-border.png
-ovirtserver/public/images/menubg.png
-ovirtserver/public/images/ok.png
-ovirtserver/public/images/pagebg.png
-ovirtserver/public/images/star.png
-ovirtserver/public/images/strype2.png
-ovirtserver/public/images/under_the_hood_blue.png
-ovirtserver/public/images/warning.png
-ovirtserver/templates/__init__.py
-ovirtserver/templates/about.html
-ovirtserver/templates/authentication.html
-ovirtserver/templates/debug.html
-ovirtserver/templates/error.html
-ovirtserver/templates/footer.html
-ovirtserver/templates/header.html
-ovirtserver/templates/index.html
-ovirtserver/templates/login.html
-ovirtserver/templates/master.html
-ovirtserver/templates/sidebars.html
-ovirtserver/tests/__init__.py
-ovirtserver/tests/functional/__init__.py
-ovirtserver/tests/functional/test_authentication.py
-ovirtserver/tests/functional/test_root.py
-ovirtserver/tests/models/__init__.py
-ovirtserver/tests/models/test_auth.py
-server.egg-info/PKG-INFO
-server.egg-info/SOURCES.txt
-server.egg-info/dependency_links.txt
-server.egg-info/entry_points.txt
-server.egg-info/paster_plugins.txt
-server.egg-info/requires.txt
-server.egg-info/top_level.txt
\ No newline at end of file
 
+++ /dev/null
-
-    [paste.app_factory]
-    main = ovirtserver.config.middleware:make_app
-
-    [paste.app_install]
-    main = pylons.util:PylonsInstaller
 
+++ /dev/null
-PasteScript
-Pylons
-TurboGears2
-tg.devtools
 
+++ /dev/null
-TurboGears2 >= 2.0b7
-Catwalk >= 2.0.2
-Babel >=0.9.4
-toscawidgets >= 0.9.7.1
-zope.sqlalchemy >= 0.4
-repoze.tm2 >= 1.0a4
\ No newline at end of file
 
+++ /dev/null
-ovirtserver
 
+++ /dev/null
-[egg_info]
-tag_build = dev
-tag_svn_revision = true
-
-[easy_install]
-find_links = http://www.pylonshq.com/download/
-
-[nosetests]
-with-pylons=test.ini
-
-# Babel configuration
-[compile_catalog]
-domain = ovirtserver
-directory = ovirtserver/i18n
-statistics = true
-
-[extract_messages]
-add_comments = TRANSLATORS:
-output_file = ovirtserver/i18n/ovirtserver.pot
-width = 80
-keywords = l_
-
-[init_catalog]
-domain = ovirtserver
-input_file = ovirtserver/i18n/ovirtserver.pot
-output_dir = ovirtserver/i18n
-
-[update_catalog]
-domain = ovirtserver
-input_file = ovirtserver/i18n/ovirtserver.pot
-output_dir = ovirtserver/i18n
-previous = true
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-try:
-    from setuptools import setup, find_packages
-except ImportError:
-    from ez_setup import use_setuptools
-    use_setuptools()
-    from setuptools import setup, find_packages
-
-setup(
-    name='server',
-    version='0.1',
-    description='',
-    author='',
-    author_email='',
-    #url='',
-    install_requires=[
-        "TurboGears2 >= 2.0b7",
-        "Catwalk >= 2.0.2",
-        "Babel >=0.9.4",
-        #can be removed iif use_toscawidgets = False
-        "toscawidgets >= 0.9.7.1",
-        "zope.sqlalchemy >= 0.4 ",
-        "repoze.tm2 >= 1.0a4",
-                        ],
-    setup_requires=["PasteScript >= 1.7"],
-    paster_plugins=['PasteScript', 'Pylons', 'TurboGears2', 'tg.devtools'],
-    packages=find_packages(exclude=['ez_setup']),
-    include_package_data=True,
-    test_suite='nose.collector',
-    tests_require=['WebTest', 'BeautifulSoup'],
-    package_data={'ovirtserver': ['i18n/*/LC_MESSAGES/*.mo',
-                                 'templates/*/*',
-                                 'public/*/*']},
-    message_extractors={'ovirtserver': [
-            ('**.py', 'python', None),
-            ('templates/**.mako', 'mako', None),
-            ('templates/**.html', 'genshi', None),
-            ('public/**', 'ignore', None)]},
-
-    entry_points="""
-    [paste.app_factory]
-    main = ovirtserver.config.middleware:make_app
-
-    [paste.app_install]
-    main = pylons.util:PylonsInstaller
-    """,
-)
 
+++ /dev/null
-# Copyright (C) 2010, Red Hat, Inc.
-# Written by Darryl L. Pierce
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
-#
-# server - TurboGears 2 testing environment configuration
-#
-# The %(here)s variable will be replaced with the parent directory of this file
-#
-[DEFAULT]
-debug = true
-# Uncomment and replace with the address which should receive any error reports
-smtp_server = localhost
-error_email_from = paste@localhost
-
-[server:main]
-use = egg:Paste#http
-host = 0.0.0.0
-port = 5000
-
-[app:main]
-use = config:development.ini
-
-[app:main_without_authn]
-use = main
-skip_authentication = True
-
-# Add additional test specific configuration options as necessary.
 
+++ /dev/null
-# Copyright (C) 2010 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-EXTRA_DIST = \
-  create-ovirt-iso-nodes \
-  edit-livecd \
-  livecd-iso-to-iscsi \
-  livecd-rpms \
-  livecd-setauth
 
+++ /dev/null
-#!/bin/bash
-#
-# Create fake oVirt Nodes for testing CDROM boot
-# Copyright 2008 Red Hat, Inc.
-# Written by Perry Myers <
[email protected]>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Library General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-PATH=$PATH:/sbin:/usr/sbin
-
-ME=$(basename "$0")
-warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
-try_h() { printf "Try \`$ME -h' for more information.\n" >&2; }
-die() { warn "$@"; try_h; exit 1; }
-
-NET_DEFAULT=network:default
-IMGDIR_DEFAULT=/var/lib/libvirt/images
-imgdir=$IMGDIR_DEFAULT
-NODEIMG_DEFAULT=/usr/share/ovirt-node-image/ovirt-node-image.iso
-nodeimg=$NODEIMG_DEFAULT
-NUM_DISKS_DEFAULT=1
-RANGE_DEFAULT="6-9"
-RAM_DEFAULT=512
-VCPUS_DEFAULT=1
-
-NODE_DISK_FMT=qcow2
-NODE_DISK_SIZE=6144M
-
-gen_fake_managed_node() {
-    local num=$1
-    local src_nodeimg=$2
-    local last_mac=$(( 54 + $num ))
-
-    local os_variant=fedora10
-    if [ "$no_virtio" = 1 ]; then
-        os_variant=fedora8
-    fi
-
-    echo "Creating fake node$num using $nodeimg..."
-    local dest_nodeimg="$imgdir/node${num}-$(basename $src_nodeimg)"
-    echo "$src_nodeimg -> $dest_nodeimg"
-    rsync -av $src_nodeimg $dest_nodeimg
-
-    virsh destroy node$num > /dev/null 2>&1
-    virsh undefine node$num > /dev/null 2>&1
-
-    local disks=
-    for ((i=0;i<$num_disks;i+=1)); do
-        qemu-img create -f $NODE_DISK_FMT \
-            $imgdir/node${num}-${i}.$NODE_DISK_FMT $NODE_DISK_SIZE
-        disks="$disks --disk path=$imgdir/node${num}-${i}.$NODE_DISK_FMT"
-    done
-
-    # FIXME: virt-install should be changed to have a --nostart parameter
-    # that just defines the VM w/o starting it.
-    virt-install --name=node$num --ram=$ram --vcpus=$vcpus $disks \
-        --cdrom=$dest_nodeimg --livecd \
-        --network=$net --mac=00:16:3e:12:34:$last_mac \
-        --vnc --accelerate --hvm --noautoconsole \
-        --os-type=linux --os-variant=$os_variant \
-        --force --noreboot
-    virsh destroy node$num > /dev/null 2>&1
-    echo "node$num created"
-}
-
-usage() {
-    case $# in 1) warn "$1"; try_h; exit 1;; esac
-    cat <<EOF
-Usage: $ME [-d image_dir] [-n node.iso] [-c num_disks] [-s start-stop]
-           [-v vcpus] [-r ram] [-x] [-b network]
-  -n: node.iso to boot (default: $NODEIMG_DEFAULT)
-  -b: network name (default: $NET_DEFAULT)
-  -d: directory to place virtual disk (default: $IMGDIR_DEFAULT)
-  -c: number of disks per fake node (default: $NUM_DISKS_DEFAULT)
-  -s: node range (default: $RANGE_DEFAULT)
-  -v: vcpus per node (default: $VCPUS_DEFAULT)
-  -r: ram in MB per node (default: $RAM_DEFAULT)
-  -x: toggle virtio devices off
-  -h: display this help and exit
-EOF
-}
-
-err=0 help=0
-no_virtio=0
-num_disks=$NUM_DISKS_DEFAULT
-range=$RANGE_DEFAULT
-ram=$RAM_DEFAULT
-vcpus=$VCPUS_DEFAULT
-net=$NET_DEFAULT
-while getopts :d:n:b:s:c:v:r:xh c; do
-    case $c in
-        n) nodeimg=$OPTARG;;
-        d) imgdir=$OPTARG;;
-        b) net=$OPTARG;;
-        c) num_disks=$OPTARG;;
-        s) range=$OPTARG;;
-        v) vcpus=$OPTARG;;
-        r) ram=$OPTARG;;
-        x) no_virtio=1;;
-        h) help=1;;
-        '?') err=1; warn "invalid option: \`-$OPTARG'";;
-        :) err=1; warn "missing argument to \`-$OPTARG' option";;
-        *) err=1; warn "internal error: \`-$OPTARG' not handled";;
-    esac
-done
-test $err = 1 && { try_h; exit 1; }
-test $help = 1 && { usage; exit 0; }
-
-# first, check to see we are root
-if [ $( id -u ) -ne 0 ]; then
-    die "Must run as root"
-fi
-
-mkdir -p $imgdir
-
-test -f $nodeimg || die "could not find $nodeimg"
-
-# define the fake managed nodes we will use.
-range_start=$(echo $range | cut -d '-' -f 1)
-range_stop=$(echo $range | cut -d '-' -f 2)
-
-for i in `seq $range_start $range_stop` ; do
-    gen_fake_managed_node $i $nodeimg
-done
 
+++ /dev/null
-#!/bin/bash
-#
-# Edit a livecd to insert files
-# Copyright 2008 Red Hat, Inc.
-# Written by Perry Myers <
[email protected]>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Library General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#!/bin/bash
-
-PATH=$PATH:/sbin:/usr/sbin
-
-ME=$(basename "$0")
-warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
-try_h() { printf "Try \`$ME -h' for more information.\n" >&2; }
-die() { warn "$@"; try_h; exit 1; }
-
-NODEIMG_DEFAULT=/usr/share/ovirt-node-image/ovirt-node-image.iso
-CD=$NODEIMG_DEFAULT
-
-usage() {
-    case $# in 1) warn "$1"; try_h; exit 1;; esac
-    cat <<EOF
-Usage: $ME -i LiveCD.iso [-b bootparams] [-p program]
-  -b BOOTPARAMS  optional parameters appended to the kernel command line
-  -i LIVECD.iso  LiveCD ISO to edit (default: $NODEIMG_DEFAULT)
-  -o OUTPUT.iso  specify the output file (required)
-  -p CODE        Arbitrary CODE that is eval'd while 'cd'd into the root of
-                   the livecd root filesystem.  Note; the code is not run in
-                   a chroot environment, so it can access the host filesystem.
-                   If this option is omitted, this program pauses and allows
-                   the user (in another terminal) to modify the filesystem
-                   manually.  Type <enter> when done, and the script
-                   re-packages the ISO.
-  -h             display this help and exit
-
-EXAMPLES
-
-  Example Script:
-    #!/bin/sh
-    touch etc/sysconfig/foo
-  Save as foo and make executable:
-    chmod a+x foo
-  Run this to create a file /etc/sysconfig/foo in the livecd filesystem
-  (note the use of "\$PWD/foo", not "./foo", since it will be run from a
-   different directory):
-
-    $ME -i input.iso -o /tmp/result.iso -p "\$PWD/foo"
-
-  or, equivalently, but without a separate script:
-
-    $ME -i input.iso -o /tmp/result.iso -p 'touch etc/sysconfig/foo'
-
-EOF
-}
-
-# exit after any error:
-set -e
-
-CODE=
-OUTPUT_FILE=
-
-err=0 help=0
-while getopts :b:hi:o:p: c; do
-    case $c in
-        i) CD=$OPTARG;;
-        b) PARAMS=$OPTARG;;
-        o) OUTPUT_FILE=$OPTARG;;
-        p) CODE=$OPTARG;;
-        h) help=1;;
-        '?') err=1; warn "invalid option: \`-$OPTARG'";;
-        :) err=1; warn "missing argument to \`-$OPTARG' option";;
-        *) err=1; warn "internal error: \`-$OPTARG' not handled";;
-    esac
-done
-test $err = 1 && { try_h; exit 1; }
-test $help = 1 && { usage; exit 0; }
-
-# Require "-o OUTPUT_FILE"
-test -z "$OUTPUT_FILE" \
-  && { warn "no output file specified; use -o FILE.iso"; try_h; exit 1; }
-
-# Fail if there are any extra command-line arguments.
-if test $OPTIND -le $#; then
-  bad_arg=$(eval "echo \$$OPTIND")
-  warn "extra argument '$bad_arg'"; try_h; exit 1
-fi
-
-# first, check to see we are root
-if [ $( id -u ) -ne 0 ]; then
-    die "Must run as root"
-fi
-
-# Check for some prerequisites.
-# "type" prints "PROG not found" if it's not in $PATH.
-type mkisofs
-type mksquashfs
-type sed
-type implantisomd5
-
-sane_name()
-{
-  case $1 in
-    *[^a-zA-Z0-9._,+:/@%=-]*) false;;
-    *) true;;
-  esac
-}
-
-# Fail if names we'll use contain white space or shell meta-characters
-sane_name "$PWD" || die "invalid working directory name: $PWD"
-sane_name "$CD" || die "invalid ISO name: $CD"
-
-WDIR=`mktemp -d $PWD/livecd.XXXXXXXXXX`
-
-addExit() {
-    EXIT="$@ ; $EXIT"
-    trap "$EXIT" EXIT HUP TERM INT QUIT
-}
-
-delExit() {
-    EXIT=${EXIT/$@ ; /}
-    trap "$EXIT" EXIT HUP TERM INT QUIT
-}
-
-mnt() {
-    local margs="$1" ; shift
-    local mp="$WDIR/$1"
-    for D in "$@" ; do
-        mkdir -v -p "$WDIR/$D"
-    done
-    eval mount -v $margs "$mp"
-    addExit "df | grep $mp > /dev/null 2>&1 && umount -v $mp"
-}
-
-addExit "rm -rf $WDIR"
-
-ID_FS_LABEL= # initialize, in case vol_id fails
-eval "$(/lib/udev/vol_id $CD)"
-LABEL=$ID_FS_LABEL
-
-# mount the CD image
-mnt "-t iso9660 $CD -o loop,ro" cd
-
-# mount compressed filesystem
-mnt "-t squashfs $WDIR/cd/LiveOS/squashfs.img -o ro,loop" sq
-
-# create writable copy of the new filesystem for the CD
-cp -pr $WDIR/cd $WDIR/cd-w
-
-# create writable copy of the filesystem for the new compressed
-# squashfs filesystem
-cp -pr $WDIR/sq $WDIR/sq-w
-
-# mount root filesystem
-mnt "-t ext2 $WDIR/sq-w/LiveOS/ext3fs.img -o rw,loop" ex
-
-echo ">>> Updating CD content"
-if [ -n "$CODE" ]; then
-      cd $WDIR/ex
-      addExit "cd -"
-      eval "$CODE"
-      delExit "cd -"
-      cd -
-else
-    echo "***"
-    echo "*** Pausing to allow manual changes.  Press any key to continue."
-    echo "***"
-    read
-fi
-
-# Try to unmount.  But this is likely to fail, so let the user retry,
-# e.g., if he forgot to "cd" out of $WDIR/ex.
-while :; do
-  echo ">>> Unmounting ext3fs"
-  umount $WDIR/ex && break
-  echo ">>> Unmounting the working file system copy failed"
-  echo "***"
-  echo "*** Did you forget to 'cd' out of $WDIR/ex?"
-  echo "***"
-  echo "*** Press any key to repeat the attempt."
-  echo "***"
-  read
-done
-
-echo ">>> Compressing filesystem"
-mksquashfs $WDIR/sq-w/ $WDIR/cd-w/LiveOS/squashfs.img -noappend
-
-echo ">>> Recomputing MD5 sums"
-( cd $WDIR/cd-w && find . -type f -not -name md5sum.txt \
-    -not -path '*/isolinux/*' -print0 | xargs -0 -- md5sum > md5sum.txt )
-
-if [ -n "$PARAMS" ]; then
-    case $PARAMS in
-      *@*) warn "PARAMS contains the @ sed delimiter, be sure it's escaped";;
-    esac
-    echo ">>> Appending boot parameters"
-    sed -i 's@^  append .*$@& '"$PARAMS@" "$WDIR/cd-w/isolinux/isolinux.cfg"
-fi
-
-echo ">>> Creating ISO image $ISO"
-mkisofs \
-    -V "$LABEL" \
-    -r -cache-inodes -J -l \
-    -b isolinux/isolinux.bin \
-    -c isolinux/boot.cat \
-    -no-emul-boot -boot-load-size 4 -boot-info-table \
-    -o "$OUTPUT_FILE" \
-    $WDIR/cd-w
-
-echo ">>> Implanting ISO MD5 Sum"
-implantisomd5 --force "$OUTPUT_FILE"
-
-# The trap ... callbacks will unmount everything.
-set +e
 
+++ /dev/null
-#!/usr/bin/python
-# Convert a live CD iso into iscsi root bootable format
-# iSCSI lun must be accessible via this script
-# Copyright 2009 Red Hat, Inc.
-# Written by Joey boggs <
[email protected]>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Library General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-from optparse import OptionParser
-from tempfile import mkdtemp
-import dbus
-import dbus.glib
-import sys
-import os
-import subprocess
-import shutil
-
-parser = OptionParser()
-parser.add_option("--iso", dest="iso", help="LiveCD iso filename")
-parser.add_option("--target", dest="target", help="iSCSI target ip address")
-parser.add_option("--targetname", dest="targetname", help="iSCSI target lun")
-parser.add_option("--targetport", dest="targetport", default="3260", help="iSCSI port number, defaults to 3260")
-parser.add_option("--user", dest="user", help="Target username(optional)")
-parser.add_option("--password", dest="password", help="Target password")
-parser.add_option("--reverse_user", dest="reverse_user", help="Reverse CHAP username(optional)")
-parser.add_option("--reverse_password", dest="reverse_password", help="Reverse CHAP password(optional)")
-parser.add_option("--disk", dest="disk", help="iSCSI disk device name")
-parser.add_option("--disk-label", dest="disk_label", default="ovirt-node-root", help="file system label")
-
-(options, args) = parser.parse_args()
-
-def fail(msg):
-    print(msg)
-    sys.exit(1)
-
-if os.geteuid () != 0:
-    fail("You must run as root")
-
-if options.iso is None:
-    fail("ERROR: iso file must be defined")
-else:
-    options.iso = os.path.abspath(options.iso)
-
-if options.target is None:
-    fail("ERROR: iscsi target must be defined")
-
-if options.targetname is None:
-    fail("ERROR: iscsi targetname must be defined")
-
-if len(options.disk_label.strip()) > 15:
-    fail("ERROR: disk label must be 14 characters or less")
-
-try:
-    file = os.mkdir("tftpboot")
-except OSError, e:
-    tftp_remove = raw_input("tftpboot directory exists, overwrite? (y/N)? ")
-    if tftp_remove.lower() == "y":
-        shutil.rmtree("tftpboot")
-        os.mkdir("tftpboot")
-    else:
-        print "Aborting"
-        sys.exit(1)
-
-if options.disk is None:
-    print "Below are the detected disks, if the iscsi disk is not shown, please ensure you are logged into the correct target\n"
-    bus = dbus.SystemBus ()
-    hal_obj = bus.get_object ('org.freedesktop.Hal', '/org/freedesktop/Hal/Manager')
-    hal = dbus.Interface (hal_obj, 'org.freedesktop.Hal.Manager')
-    udis = hal.FindDeviceByCapability ('storage')
-    dev_dict = {}
-    dev_count = 1
-    for udi in udis:
-        dev_obj = bus.get_object ('org.freedesktop.Hal', udi)
-        dev = dbus.Interface (dev_obj, 'org.freedesktop.Hal.Device')
-        dev_bus=dev.GetProperty ('storage.bus')
-        dev_name=dev.GetProperty ('block.device')
-        dev_size=dev.GetProperty ('storage.size')
-        dev_size=(dev_size/1024/1024)
-        basename=os.path.basename(udi)
-        if dev_bus == "scsi":
-            print "%s. %s %sM %s \n" % (dev_count,dev_name,dev_size,basename)
-            dev_dict[str(dev_count)] = dev_name
-            dev_count = dev_count + 1
-    print "Enter Q to Quit"
-    dev_choice = raw_input("Which device? ")
-    while not dev_dict.has_key(dev_choice):
-        if dev_choice.lower() == "q":
-           print "Aborting"
-           sys.exit(1)
-        else:
-            print "%s is an invalid choice" % dev_choice
-            dev_choice = raw_input("Which device? ")
-    options.disk = dev_dict[dev_choice]
-
-cont = raw_input("Creating file system on %s, do you wish to continue (y/N) " % options.disk)
-if cont.lower() != "y":
-    print "Aborting"
-    sys.exit(1)
-
-isomount = mkdtemp()
-isomount_ret = subprocess.call(["mount", "-o", "loop", options.iso, isomount])
-if isomount_ret != 0:
-    fail("Error mounting %s" % options.iso)
-
-kernel="%s/isolinux/vmlinuz0" % isomount
-initrd="%s/isolinux/initrd0.img" % isomount
-squashfs="%s/LiveOS/squashfs.img" % isomount
-ext3fs="tftpboot/squashfs-root/LiveOS/ext3fs.img"
-shutil.copy(kernel,"tftpboot")
-shutil.copy(initrd,"tftpboot")
-
-unsquash = subprocess.call(["unsquashfs", squashfs])
-
-# workaround until bug is fixed with squashfs -d option
-shutil.move("squashfs-root","tftpboot/squashfs-root")
-
-print "Placing embedded file system on %s" % options.disk
-dd_cmd="dd if=%s of=%s" % (ext3fs,options.disk)
-copy_iscsi_ret = subprocess.call(dd_cmd, shell=True)
-if copy_iscsi_ret != 0:
-    fail("Error copying to %s" % options.disk)
-
-e2label_cmd="e2label %s %s" % (options.disk,options.disk_label)
-e2label_ret = subprocess.call(e2label_cmd, shell=True)
-if e2label_ret != 0:
-    fail("Error relabeling %s to %s" % (options.disk,options.disk_label))
-
-umount_ret = subprocess.call(["umount", isomount])
-if umount_ret != 0:
-    fail("Error unmounting %s, continuing" % isomount)
-else:
-    os.rmdir(isomount)
-shutil.rmtree("tftpboot/squashfs-root")
-
-pxe_template = """
-
-# pxelinux configuration.
-DEFAULT pxeboot
-TIMEOUT 20
-PROMPT 0
-LABEL ovirt-node-iscsi
-        KERNEL /vmlinuz0
-        APPEND initrd=/initrd0.img ro root=LABEL=%(disk_label)s netroot=iscsi:%(user)s%(password)s@%(target)s::%(target_port)s::%(target_name)s ip=eth0:dhcp
-       ipappend 2
-ONERROR LOCALBOOT 0
-"""
-
-# insert empty values for unneeded variables in the pxe template
-if not options.user is None:
-    options.user = options.user + ":"
-else:
-    options.user = ""
-
-if not options.password is None:
-    options.password = options.password + ":"
-else:
-    options.password = ""
-
-if not options.reverse_user is None:
-    options.reverse_user = options.reverse_user + ":"
-else:
-    options.reverse_user = ""
-
-if not options.reverse_password is None:
-    options.reverse_password = options.reverse_password + ":"
-else:
-    options.reverse_password = ""
-
-os.mkdir("tftpboot/pxelinux.cfg")
-pxe_cfg = pxe_template % {
-            "disk_label": options.disk_label,
-            "target": options.target,
-            "target_port": options.targetport,
-            "target_name": options.targetname,
-            "user": options.user,
-            "password": options.password,
-            "reverse_user": options.reverse_user,
-            "reverse_password": options.reverse_password
-        }
-
-pxe_conf = open("tftpboot/pxelinux.cfg/default", 'w')
-pxe_conf.write(pxe_cfg)
-pxe_conf.close()
-
-if os.path.exists("/usr/share/syslinux/pxelinux.0"):
-    shutil.copy("/usr/share/syslinux/pxelinux.0","tftpboot")
-elif os.path.exists("/usr/lib/syslinux/pxelinux.0"):
-   shutil.copy("/usr/lib/syslinux/pxelinux.0","tftpboot")
-else:
-    print "Warning: You need to add pxelinux.0 to tftpboot/ subdirectory"
-
-print "Your iscsiroot has been setup on %s" % options.disk
-print ""
-print "Copy the tftpboot/ subdirectory to your tftpserver root directory"
-print "Set up your DHCP, TFTP and PXE server to serve /tftpboot/.../pxeboot.0"
 
+++ /dev/null
-#!/bin/bash
-#
-# Script to install/update a livecd with a set of RPMS provided in a directory
-# Copyright 2009 Red Hat, Inc.
-# Written by Perry Myers <
[email protected]>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Library General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-if [[ $# < 1 ]]; then
-    echo "Usage: $0 rpmdir"
-    exit 1
-fi
-
-RPMDIR=$1
-
-rpm --root $PWD -Uvh $(find $RPMDIR -type f -name "*.rpm" -print)
-
 
+++ /dev/null
-#!/bin/bash
-#
-# Script to interactively add root password and authorized_keys file
-# to a livecd
-# Copyright 2008 Red Hat, Inc.
-# Written by Perry Myers <
[email protected]>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Library General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-DEFAULT_AUTH=~/.ssh/authorized_keys
-
-printf "Do you want to set a root password? [y/N]: "
-read yesno
-if [ "$yesno" = "y" -o "$yesno" = "Y" ]; then
-    chroot . passwd root
-fi
-
-printf "Do you want to set an authorized_keys file? [y/N]: "
-read yesno
-if [ "$yesno" = "y" -o "$yesno" = "Y" ]; then
-    echo "Enter the location of the authorized_keys file [default: $DEFAULT_AUTH]: "
-    read -e authkeys
-    if [ -z "$authkeys" ]; then
-        authkeys=$DEFAULT_AUTH
-    fi
-
-    authkeys=$(eval echo $authkeys)
-    if [ -f $authkeys ]; then
-        SSH=root/.ssh
-        AUTH=$SSH/authorized_keys
-
-        mkdir -p $SSH
-        chmod 755 $SSH
-        cp -v $authkeys $AUTH
-        chmod 644 $AUTH
-    else
-        echo "$authkeys not found, skipping"
-    fi
-fi
 
+++ /dev/null
-#!/bin/sh
-
-modprobe 8021q