From aclement at linagora.com Mon Feb 1 09:22:29 2010 From: aclement at linagora.com (Arthur CLEMENT) Date: Mon, 1 Feb 2010 10:22:29 +0100 Subject: [Ovirt-devel] How I installed ovirt on fc 12 In-Reply-To: <201001190956.29356.clement.arthur@gmail.com> References: <201001190956.29356.clement.arthur@gmail.com> Message-ID: <201002011022.29835.aclement@linagora.com> Hello, There has been some changes since my first ovirt installation feedback. - ipa-server has been patched (1.2.2-3.fc12) - Cobbler does not work out of the box. - ovirt-node-image-pxe does not boot (problem with dracut) Cobbler problem : The default tpftp config does not work, the problem might be there : ovirt/server/installer/modules/ovirt/files/cobbler-import (l 47) cobbler distro add --name="oVirt-Node-$node_arch" --arch=$node_arch \ --initrd=$node_dir/tftpboot/initrd0.img --kernel=$node_dir/tftpboot/vmlinuz0 \ --kopts="rootflags=loop root=/ovirt-node-image.iso rootfstype=iso9660 ro console=tty0 console=ttyS0,115200n8" I think this is the line that adds the ovirt-node pxe config of /var/lib/tftpboot/pxelinux.cfg/default. To have my node booting, I am using this config in /var/lib/tftpboot/pxelinux.cfg/default : LABEL oVirt-Node-x86_64 kernel /images/oVirt-Node-x86_64/vmlinuz0 MENU LABEL oVirt-Node-x86_64 append initrd=/images/oVirt-Node-x86_64/initrd0.img ksdevice=bootif lang= ro rootflags=loop text selinux=0 rootfstype=iso9660 root=live:/ovirt-node-image.iso kssendmac ks=http://10.75.196.100/cblr/svc/op/ks/profile/oVirt-Node- x86_64 rd_NO_PLYMOUTH rd_NO_LVM rd_NO_LUKS ipappend 2 And I don't understand why there are these lines with MAC in ovirt/server/installer/modules/ovirt/files/cobbler-import cobbler profile add --name=oVirt-Node-$node_arch --distro=oVirt-Node-$node_arch cobbler system add --netboot-enabled=1 --profile=oVirt-Node-$node_arch \ --name=node3 --mac=00:16:3e:12:34:57 cobbler system add --netboot-enabled=1 --profile=oVirt-Node-$node_arch \ --name=node4 --mac=00:16:3e:12:34:58 --kopts="ovirt_init=scsi ovirt_local_boot" cobbler system add --netboot-enabled=1 --profile=oVirt-Node-$node_arch \ --name=node5 --mac=00:16:3e:12:34:59 --kopts="ovirt_init=scsi" But that's not all. The pxe node image does not boot, there is a bug in dracut : https://bugzilla.redhat.com/show_bug.cgi?id=548283 So I rebuild the pxe image with the patched dracut (on a fc13), and this pxe node image is working on my ovirt server (fc12) I draw your attention to this tftp option : root=live:/ovirt-node-image.iso "live:/" is mandatory for dracut, otherwise it can not mount / I still have problems, I have to disable plymouth and usb (in the server bios) to make the node booting but it's not critical. Regards , A. On Mardi 19 Janvier 2010 09:56:29 you wrote: > Hi, > > I installed ovirt on fedora 12 (64 bits) successfully but I had to make > some changes to make it work. > > 1. Installation from rpms builded from the lastest git version > > 2. Patch ace : missing backslashes in sed commands > > vim /usr/share/ace/modules/ovirt/manifests/freeipa.pp > > line 33 : '/\\[kdcdefaults\\]/a \\ kdc_ports = 88' > single_exec {"set_kdc_defaults": > command => "/bin/sed -i '/\\[kdcdefaults\\]/a \\ kdc_ports > = 88' /usr/share/ipa/kdc.conf.template", require => Package[ipa-server] > } > > Line 44 : > > file_replacement{"ipa_proxy_config_1": > file => "/etc/httpd/conf.d/ipa.conf", > pattern => "^", > replacement => "", > require => Single_exec[replace_line_returns] > } > > 3. Patch ipa-server > > https://bugzilla.redhat.com/show_bug.cgi?id=544927 > https://www.redhat.com/archives/freeipa-devel/2010-January/msg00054.html > > I had to install ipa-server before running ace to patch > /usr/lib/python2.6/site-packages/ipaserver/funcs.py. > > yum install ipa-server > > diff -u /usr/lib/python2.6/site-packages/ipaserver/funcs.py.orig > /usr/lib/python2.6/site-packages/ipaserver/funcs.py --- > /usr/lib/python2.6/site-packages/ipaserver/funcs.py.orig 2010-01-15 > 15:57:56.000000000 -0500 +++ > /usr/lib/python2.6/site-packages/ipaserver/funcs.py 2010-01-15 > 16:00:40.000000000 -0500 @@ -332,7 +332,7 @@ > > schema_entry = self.__get_base_entry("", "objectclass=*", > ['dn','subschemasubentry'], opts) schema_cn = > schema_entry.get('subschemasubentry') > - schema = self.__get_base_entry(schema_cn, "objectclass=*", ['*'], opts) > + schema = self.__get_base_entry(schema_cn, "objectclass=*", ['*', > 'objectclasses','attributetypes','matchingrules'], opts) > > return schema > > > Ruby from fedora packages causes some compatibility troubles : > /usr/bin/rake db:migrate (modules/ovirt/manifests/ovirt.pp) crash and a > lot of compatibility errors raise when mongrel and other ruby dependances > try to start. > > > 4. Change ruby environment to 2.3.4 > > vim /usr/share/ovirt-server/config/environment.rb > > Line 23 > RAILS_GEM_VERSION = '2.3.4' unless defined? RAILS_GEM_VERSION > > > > 5. Patch ruby initializers > > http://webtips-seja.blogspot.com/2009/10/undefined-method-quoteident-for.ht > ml > > vim /usr/share/ovirt-server/config/initializers/new_rails_defaults.rb > > Add : > > def PGconn.quote_ident(name) > %("#{name}") > end > > > > 6. Adapt ruby gems > > > You must have : > > > *** LOCAL GEMS *** > > actionmailer (2.3.4) > actionpack (2.3.4) > activeldap (1.2.0) > activerecord (2.3.4) > activeresource (2.3.4) > activesupport (2.3.4) > cgi_multipart_eof_fix (2.5.0) > cobbler (1.6.1) > columnize (0.3.1) > daemons (1.0.10) > fastthread (1.0.7) > flexmock (0.8.6) > gem_plugin (0.2.3) > gettext (2.0.4) > gettext_activerecord (2.0.4) > gettext_rails (2.0.4) > highline (1.5.1) > hoe (2.3.3) > krb5-auth (0.7) > linecache (0.43) > locale (2.0.4) > locale_rails (2.0.4) > mongrel (1.1.5) > postgres (0.7.9.2008.01.28) > rack (1.0.1) > rails (2.3.4) > rake (0.8.7) > ruby-debug (0.10.3) > ruby-debug-base (0.10.3) > rubyforge (1.0.5) > > > gem uninstall rack -v 1.0.0 > gem install columnize -v 0.3.1 > gem install gettext gettext_activerecord gettext_rails -v 2.0.4 > gem install rubydebug -v 0.10.3 > gem install ruby-debug -v 0.10.3 > gem install locale locale_rails -v 2.0.4 > gem uninstall actionmailer actionpack activerecord activeresource > activesupport -v 2.3.5 gem uninstall locale locale_rails -v 2.0.5 > gem uninstall gettext -v 2.1.0 > gem uninstall gettext gettext_activerecord gettext_rails -v 2.1.0 > gem uninstall locale locale_rails -v 2.0.5 > > > 7. Launch ovirt-installer > > ovirt-installer > ace -d -l logfile install ovirt > > > 8. Fix bug in /etc/httpd/aliases > > libnssckbi.so -> ../../../lib64/libnssckbi.so > to > libnssckbi.so -> ../../../usr/lib64/libnssckbi.so > > > I had some troubles to make the proxy and ssl working but the problem > solved itself after a while... > > For more information, me (arthurc) and my colleague (pierre-gilles) are > available on #ovirt at freenode. From dpierce at redhat.com Wed Feb 3 18:37:48 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 3 Feb 2010 13:37:48 -0500 Subject: [Ovirt-devel] Making the node generic... Message-ID: <20100203183748.GA4598@mcpierce-laptop.redhat.com> One task I'm working on is to make the managed node more generic, so that it can be leveraged by other hypervisor managers in the same way that it is managed by the ovirt-wui. One thing I'm considering doing is to add a new configuration file to the node, /etc/sysconfig/node-config. This will be a central point for defining specific elements, such as management servers, user names, etc. And it can be overridden by a configuration management system, such as puppet. Options specified in it should also be easily overridden by kernel arguments if necessary. Now, to the topic of making the node generic. Currently I'm documenting the startup process for the node in order to identify the points where a node would want to perform key events, such as notifying a management system that the node is online, or report its hardware and configuration information, etc. What I would like to do is make the startup process as modular as possible. That way a third party can take the node and provide new functionality for a separate management system without having to change the code provided by the node itself. One method I was considering is to have a directory for scripts, and then execute those on the node. So, for example, with a directory called /etc/node/startup, if the node finds a script name "awake" then it would execute that during that stage. Or, if it finds one named "network-change" then it would execute that script when it detected a change in networking interfaces. Thoughts? Questions? -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From pmyers at redhat.com Wed Feb 3 18:50:37 2010 From: pmyers at redhat.com (Perry Myers) Date: Wed, 03 Feb 2010 13:50:37 -0500 Subject: [Ovirt-devel] Making the node generic... In-Reply-To: <20100203183748.GA4598@mcpierce-laptop.redhat.com> References: <20100203183748.GA4598@mcpierce-laptop.redhat.com> Message-ID: <4B69C57D.20106@redhat.com> On 02/03/2010 01:37 PM, Darryl L. Pierce wrote: > One task I'm working on is to make the managed node more generic, so > that it can be leveraged by other hypervisor managers in the same way > that it is managed by the ovirt-wui. > > One thing I'm considering doing is to add a new configuration file to > the node, /etc/sysconfig/node-config. This will be a central point for > defining specific elements, such as management servers, user names, etc. > And it can be overridden by a configuration management system, such as > puppet. Options specified in it should also be easily overridden by > kernel arguments if necessary. > > Now, to the topic of making the node generic. Currently I'm documenting > the startup process for the node in order to identify the points where a > node would want to perform key events, such as notifying a management > system that the node is online, or report its hardware and configuration > information, etc. > > What I would like to do is make the startup process as modular as > possible. That way a third party can take the node and provide new > functionality for a separate management system without having to change > the code provided by the node itself. > > One method I was considering is to have a directory for scripts, and > then execute those on the node. So, for example, with a directory called > /etc/node/startup, if the node finds a script name "awake" then it would > execute that during that stage. Or, if it finds one named > "network-change" then it would execute that script when it detected a > change in networking interfaces. > > Thoughts? Questions? This is a good start to genericizing things. One thing to keep in mind is that it is better to use some sort of standard external interface for doing as much as possible rather than providing infinite and arbitrary hooks/scripts plugins. i.e. rather than providing N hooks for allowing remote configuration of a node for stateless mode, instead provide a single interface using a well known standard like AMQP/REST/dnssrv to do this. Then other users of the node can just adopt the standard and move forward without needing to modify the node image itself. But providing some level of arbitrary hooks is a good idea in general, so we should do that as well. I just think the more people use those hooks the more they'll deviate from the standard node image and the harder it will be to support in the community. Perry From dpierce at redhat.com Wed Feb 3 19:35:30 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 3 Feb 2010 14:35:30 -0500 Subject: [Ovirt-devel] Making the node generic... In-Reply-To: <4B69C57D.20106@redhat.com> References: <20100203183748.GA4598@mcpierce-laptop.redhat.com> <4B69C57D.20106@redhat.com> Message-ID: <20100203193530.GC9869@mcpierce-laptop.redhat.com> On Wed, Feb 03, 2010 at 01:50:37PM -0500, Perry Myers wrote: > This is a good start to genericizing things. One thing to keep in mind is > that it is better to use some sort of standard external interface for > doing as much as possible rather than providing infinite and arbitrary > hooks/scripts plugins. > > i.e. rather than providing N hooks for allowing remote configuration of a > node for stateless mode, instead provide a single interface using a well > known standard like AMQP/REST/dnssrv to do this. Then other users of the > node can just adopt the standard and move forward without needing to > modify the node image itself. I agree that working with a standard is the way to go, and using any combination of the above is better. But how about data encoding; i.e., how to package together the hardware description, for example? The above describe a few different ways of discovering the management server, but don't provide a way to encode data to be delivered. Are there any standards for that? I'm not aware of any, personally. > But providing some level of arbitrary hooks is a good idea in general, so > we should do that as well. I just think the more people use those hooks > the more they'll deviate from the standard node image and the harder it > will be to support in the community. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From pmyers at redhat.com Wed Feb 3 19:37:15 2010 From: pmyers at redhat.com (Perry Myers) Date: Wed, 03 Feb 2010 14:37:15 -0500 Subject: [Ovirt-devel] Making the node generic... In-Reply-To: <20100203193530.GC9869@mcpierce-laptop.redhat.com> References: <20100203183748.GA4598@mcpierce-laptop.redhat.com> <4B69C57D.20106@redhat.com> <20100203193530.GC9869@mcpierce-laptop.redhat.com> Message-ID: <4B69D06B.8020006@redhat.com> On 02/03/2010 02:35 PM, Darryl L. Pierce wrote: > On Wed, Feb 03, 2010 at 01:50:37PM -0500, Perry Myers wrote: >> This is a good start to genericizing things. One thing to keep in mind is >> that it is better to use some sort of standard external interface for >> doing as much as possible rather than providing infinite and arbitrary >> hooks/scripts plugins. >> >> i.e. rather than providing N hooks for allowing remote configuration of a >> node for stateless mode, instead provide a single interface using a well >> known standard like AMQP/REST/dnssrv to do this. Then other users of the >> node can just adopt the standard and move forward without needing to >> modify the node image itself. > > I agree that working with a standard is the way to go, and using any > combination of the above is better. But how about data encoding; i.e., > how to package together the hardware description, for example? The above > describe a few different ways of discovering the management server, but > don't provide a way to encode data to be delivered. Are there any standards > for that? I'm not aware of any, personally. /me shudders, but CIM probably provides a standard for this. But in the absence of this, as long as we provide a well formed API and keep it consistent as we improve functionality that is a start. i.e. this is how libvirt evolved. Perry From matinata at br.ibm.com Thu Feb 4 19:16:47 2010 From: matinata at br.ibm.com (Ricardo Marin Matinata) Date: Thu, 4 Feb 2010 17:16:47 -0200 Subject: [Ovirt-devel] [PATCH] Make configure_from_network function check if network is up, before touching it Message-ID: <1265311008-7666-1-git-send-email-matinata@br.ibm.com> This patch adds a safety verification to configure_from_network function, where network configuration will not be performed if it is already up and running, preventing lost of communication for connections already established. Signed-off-by: Ricardo Marin Matinata --- scripts/ovirt-early | 9 ++++++--- scripts/ovirt-functions | 7 +++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/ovirt-early b/scripts/ovirt-early index cdd4afd..dd7da00 100755 --- a/scripts/ovirt-early +++ b/scripts/ovirt-early @@ -32,9 +32,12 @@ configure_from_network() { DEVICE=$1 if [ -n "$DEVICE" ]; then - log "Configuring network Using interface $DEVICE" - # setup temporary interface to retrieve configuration - echo "network --device $DEVICE --bootproto dhcp" | nash + log "Configuring network" + if ! network_up ; then + log "Using interface $DEVICE" + # setup temporary interface to retrieve configuration + echo "network --device $DEVICE --bootproto dhcp" | nash + 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 }') diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index fc43343..2801bd8 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -709,6 +709,13 @@ is_valid_ipv4 () { return $result } +# Check if networking is already up +network_up () { + UPIFS=$(/sbin/ip -o link show up | awk -F ": " '{ print $2 }' | grep -v lo | wc -l) + test -n "${UPIFS}" -a "${UPIFS}" -gt "0" + return $? +} + # execute a function if called as a script, e.g. # ovirt-functions ovirt_store_config /etc/hosts -- 1.6.6 From matinata at br.ibm.com Thu Feb 4 19:16:48 2010 From: matinata at br.ibm.com (Ricardo Marin Matinata) Date: Thu, 4 Feb 2010 17:16:48 -0200 Subject: [Ovirt-devel] [PATCH] Expand get_dev_name funtion to consider devices not seen by HAL In-Reply-To: <1265311008-7666-1-git-send-email-matinata@br.ibm.com> References: <1265311008-7666-1-git-send-email-matinata@br.ibm.com> Message-ID: <1265311008-7666-2-git-send-email-matinata@br.ibm.com> This patch augments the get_dev_name functions for devices not properly seen by HAL. Signed-off-by: Ricardo Marin Matinata --- scripts/ovirt-config-storage | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index eed126c..74894d1 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -140,7 +140,8 @@ check_partition_sizes() get_dev_name() { local udi_list=$(hal-find-by-capability --capability storage) - if test -z "$udi_list"; then + local byid_list=$(find /dev/disk/by-id -mindepth 1| grep -v "\-part") + if test -z "$udi_list" -a -z "$byid_list"; then warn "ERROR: no usable storage devices detected" return 1 fi @@ -164,6 +165,10 @@ get_dev_name() && devices="$block_dev" \ || devices="$devices $block_dev" done + d="" + for d in $byid_list; do + devices="$devices `readlink -f $d`"; + done # FIXME: workaround for detecting virtio block devices devices="$devices $(ls /dev/vd? 2> /dev/null | xargs)" -- 1.6.6 From apevec at gmail.com Fri Feb 5 11:12:31 2010 From: apevec at gmail.com (Alan Pevec) Date: Fri, 5 Feb 2010 12:12:31 +0100 Subject: [Ovirt-devel] [PATCH] Expand get_dev_name funtion to consider devices not seen by HAL In-Reply-To: <1265366027.10154.6.camel@localhost> References: <1265311008-7666-1-git-send-email-matinata@br.ibm.com> <1265311008-7666-2-git-send-email-matinata@br.ibm.com> <2be7262f1002041526r58de89c4u853155fbbe5d132a@mail.gmail.com> <1265366027.10154.6.camel@localhost> Message-ID: <2be7262f1002050312i5dd2a034jdf2f467015a90310@mail.gmail.com> Pushed, thanks! Alan On Fri, Feb 5, 2010 at 11:33 AM, Ricardo Marin Matinata wrote: > On Fri, 2010-02-05 at 00:26 +0100, Alan Pevec wrote: >> > - ? ?if test -z "$udi_list"; then >> > + ? ?local byid_list=$(find /dev/disk/by-id ?-mindepth 1| grep -v "\-part") >> >> or just: find /dev/disk/by-id ?-mindepth 1 -not -name '*-part*' >> If agreed, I'll amend and push > > Agree. > > -- > Ricardo Marin Matinata > Adv. Software Engineer | Linux Technology Center > IBM Brazil | Hortolandia | SP > matinata br ibm com > > From apevec at gmail.com Fri Feb 5 11:13:07 2010 From: apevec at gmail.com (Alan Pevec) Date: Fri, 5 Feb 2010 12:13:07 +0100 Subject: [Ovirt-devel] [PATCH] Make configure_from_network function check if network is up, before touching it In-Reply-To: <1265366069.10154.7.camel@localhost> References: <1265311008-7666-1-git-send-email-matinata@br.ibm.com> <2be7262f1002041548k21605aap26a3268ef88ea140@mail.gmail.com> <1265366069.10154.7.camel@localhost> Message-ID: <2be7262f1002050313x116aa7efi6bf22c699a0a4ec7@mail.gmail.com> Pushed, thanks! Alan On Fri, Feb 5, 2010 at 11:34 AM, Ricardo Marin Matinata wrote: > On Fri, 2010-02-05 at 00:48 +0100, Alan Pevec wrote: >> > +# Check if networking is already up >> > +network_up () { >> > + ? ?UPIFS=$(/sbin/ip -o link show up | awk -F ": " '{ print $2 }' | grep -v lo | wc -l) >> > + ? ?test -n "${UPIFS}" -a "${UPIFS}" -gt "0" >> > + ? ?return $? >> >> or just: >> network_up () { >> ? ? test -n "$(/sbin/ip -o link show up | cut -d: -f2 | grep -v 'lo$')" >> } >> >> If you agree, I'll amend and push > > Agree. > > -- > Ricardo Marin Matinata > Adv. Software Engineer | Linux Technology Center > IBM Brazil | Hortolandia | SP > matinata br ibm com From jboggs at redhat.com Fri Feb 5 15:41:44 2010 From: jboggs at redhat.com (Joey Boggs) Date: Fri, 5 Feb 2010 10:41:44 -0500 Subject: [Ovirt-devel] [PATCH node] add noatime mount option to /config /var/log and /data Message-ID: <1265384504-27958-1-git-send-email-jboggs@redhat.com> --- recipe/ovirt-node-image.ks | 2 +- scripts/ovirt-config-storage | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/recipe/ovirt-node-image.ks b/recipe/ovirt-node-image.ks index 0e56168..270eb77 100644 --- a/recipe/ovirt-node-image.ks +++ b/recipe/ovirt-node-image.ks @@ -30,7 +30,7 @@ mkdir -p /boot mkdir -p /config mkdir -p /data mkdir -p /liveos -echo "/dev/HostVG/Config /config ext3 defaults,noauto 0 0" >> /etc/fstab +echo "/dev/HostVG/Config /config ext3 defaults,noauto,noatime 0 0" >> /etc/fstab %end %post diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index 460588b..2dc508f 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -522,7 +522,7 @@ perform_partitioning() lvcreate --name Logging --size ${LOGGING_SIZE}M /dev/HostVG mke2fs -j /dev/HostVG/Logging -L "LOGGING" tune2fs -c 0 -i 0 /dev/HostVG/Logging - echo "/dev/HostVG/Logging /var/log ext3 defaults 0 0" >> /etc/fstab + echo "/dev/HostVG/Logging /var/log ext3 defaults,noatime 0 0" >> /etc/fstab fi local use_data=1 @@ -539,7 +539,7 @@ perform_partitioning() if [ "$use_data" = 0 ]; then mke2fs -j /dev/HostVG/Data -L "DATA" tune2fs -c 0 -i 0 /dev/HostVG/Data - echo "/dev/HostVG/Data /data ext3 defaults 0 0" >> /etc/fstab + echo "/dev/HostVG/Data /data ext3 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 -- 1.6.6 From aclement at linagora.com Mon Feb 8 14:35:23 2010 From: aclement at linagora.com (Arthur CLEMENT) Date: Mon, 8 Feb 2010 15:35:23 +0100 Subject: [Ovirt-devel] Proposals for making configure_from_network function works in f13 Message-ID: <201002081535.24126.aclement@linagora.com> Hi I am running a pxe diskless node in f13 and I have some proposals to make ovirt-early working in this version. nash is no more available (nash/mkinitrd is replaced by dracut), so this following command fails : "echo "network --device $DEVICE --bootproto dhcp" | nash" it makes the network configuration incomplete. I replace the linuxrc command by dhclient and it's working well. There may be another solution to get dhcp but I don't know it. (I did not commit the patch of Ricardo Marin Matinata) @@ -38,8 +38,8 @@ if [ -n "$DEVICE" ]; then log "Configuring network Using interface $DEVICE" # setup temporary interface to retrieve configuration - echo "network --device $DEVICE --bootproto dhcp" | bash - if [ $? -eq 0 ]; then + /sbin/dhclient $1 + 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" And the cobbler/dracut problem in f12 persits in f13 (https://bugzilla.redhat.com/show_bug.cgi?id=548283) --- cobbler-import.ori 2010-01-12 11:54:13.000000000 +0100 +++ cobbler-import 2010-02-08 10:31:44.000000000 +0100 @@ -46,15 +46,9 @@ cobbler distro add --name="oVirt-Node-$node_arch" --arch=$node_arch \ --initrd=$node_dir/tftpboot/initrd0.img -- kernel=$node_dir/tftpboot/vmlinuz0 \ - --kopts="rootflags=loop root=/ovirt-node-image.iso rootfstype=iso9660 ro console=tty0 console=ttyS0,115200n8" + --kopts="rootflags=loop root=live:/ovirt-node-image.iso rootfstype=iso9660 ro console=tty0 console=ttyS0,115200n8" I didn't try this patch but I think this is the way to get this kind of config in /var/lib/tftpboot/pxelinux.cfg/default : LABEL oVirt-Node-x86_64 kernel /images/oVirt-Node-x86_64/vmlinuz0 MENU LABEL oVirt-Node-x86_64 append initrd=/images/oVirt-Node-x86_64/initrd0.img ksdevice=bootif ro rootflags=loop rootfstype=iso9660 root=live:/ovirt-node-image.iso kssendmac ks=http://10.75.196.100/cblr/svc/op/ks/profile/oVirt-Node-x86_64 ipappend 2 -- Arthur CLEMENT Linagora Paris From dpierce at redhat.com Mon Feb 8 19:16:25 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 8 Feb 2010 14:16:25 -0500 Subject: [Ovirt-devel] Proposals for making configure_from_network function works in f13 In-Reply-To: <201002081535.24126.aclement@linagora.com> References: <201002081535.24126.aclement@linagora.com> Message-ID: <20100208191625.GC25953@mcpierce-desktop.usersys.redhat.com> On Mon, Feb 08, 2010 at 03:35:23PM +0100, Arthur CLEMENT wrote: > I am running a pxe diskless node in f13 and I have some proposals to make > ovirt-early working in this version. > > nash is no more available (nash/mkinitrd is replaced by dracut), so this > following command fails : > "echo "network --device $DEVICE --bootproto dhcp" | nash" > it makes the network configuration incomplete. I replace the linuxrc command by > dhclient and it's working well. There may be another solution to get dhcp but > I don't know it. > > (I did not commit the patch of Ricardo Marin Matinata) > > @@ -38,8 +38,8 @@ > if [ -n "$DEVICE" ]; then > log "Configuring network Using interface $DEVICE" > # setup temporary interface to retrieve configuration > - echo "network --device $DEVICE --bootproto dhcp" | bash > - if [ $? -eq 0 ]; then > + /sbin/dhclient $1 > + 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" > > > > And the cobbler/dracut problem in f12 persits in f13 > (https://bugzilla.redhat.com/show_bug.cgi?id=548283) > > --- cobbler-import.ori 2010-01-12 11:54:13.000000000 +0100 > +++ cobbler-import 2010-02-08 10:31:44.000000000 +0100 > @@ -46,15 +46,9 @@ > > cobbler distro add --name="oVirt-Node-$node_arch" --arch=$node_arch \ > --initrd=$node_dir/tftpboot/initrd0.img -- > kernel=$node_dir/tftpboot/vmlinuz0 \ > - --kopts="rootflags=loop root=/ovirt-node-image.iso rootfstype=iso9660 ro > console=tty0 console=ttyS0,115200n8" > + --kopts="rootflags=loop root=live:/ovirt-node-image.iso rootfstype=iso9660 > ro console=tty0 console=ttyS0,115200n8" > > > I didn't try this patch but I think this is the way to get this kind of config > in /var/lib/tftpboot/pxelinux.cfg/default : > > LABEL oVirt-Node-x86_64 > kernel /images/oVirt-Node-x86_64/vmlinuz0 > MENU LABEL oVirt-Node-x86_64 > append initrd=/images/oVirt-Node-x86_64/initrd0.img ksdevice=bootif ro > rootflags=loop rootfstype=iso9660 root=live:/ovirt-node-image.iso kssendmac > ks=http://10.75.196.100/cblr/svc/op/ks/profile/oVirt-Node-x86_64 > ipappend 2 Thank you for the feedback, Arthur. On first glance, this patch looks like it should work for what has changed in fedora. Can you do a checkout of our git repo, create a test branch and then test this? If it works, then I would be happy to consider it for inclusion in the codebase. :) -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From apevec at gmail.com Tue Feb 9 13:25:59 2010 From: apevec at gmail.com (Alan Pevec) Date: Tue, 9 Feb 2010 14:25:59 +0100 Subject: [Ovirt-devel] Proposals for making configure_from_network function works in f13 In-Reply-To: <201002081535.24126.aclement@linagora.com> References: <201002081535.24126.aclement@linagora.com> Message-ID: <2be7262f1002090525h19ad7821l8eb8756b525212a7@mail.gmail.com> > (I did not commit the patch of Ricardo Marin Matinata) Ricardo's patch has been pushed to 'next' so this needs to be rebased: --- a/scripts/ovirt-early +++ b/scripts/ovirt-early @@ -40,7 +40,7 @@ configure_from_network() { if ! network_up ; then log "Using interface $DEVICE" # setup temporary interface to retrieve configuration - echo "network --device $DEVICE --bootproto dhcp" | nash + /sbin/dhclient $DEVICE fi if [ $? -eq 0 ]; then # from network-scripts/ifup-post ACK from me, after you provide testing results as requested by Darryl From aclement at linagora.com Tue Feb 9 14:17:13 2010 From: aclement at linagora.com (Arthur CLEMENT) Date: Tue, 9 Feb 2010 15:17:13 +0100 Subject: [Ovirt-devel] Proposals for making configure_from_network function works in f13 In-Reply-To: <2be7262f1002090525h19ad7821l8eb8756b525212a7@mail.gmail.com> References: <201002081535.24126.aclement@linagora.com> <2be7262f1002090525h19ad7821l8eb8756b525212a7@mail.gmail.com> Message-ID: <201002091517.13885.aclement@linagora.com> It's working with Ricardo's patch The ovirt-early script on my node : http://pastebin.com/f7d655481 On Mardi 09 F?vrier 2010 14:25:59 Alan Pevec wrote: > > (I did not commit the patch of Ricardo Marin Matinata) > > Ricardo's patch has been pushed to 'next' so this needs to be rebased: > > --- a/scripts/ovirt-early > +++ b/scripts/ovirt-early > @@ -40,7 +40,7 @@ configure_from_network() { > if ! network_up ; then > log "Using interface $DEVICE" > # setup temporary interface to retrieve configuration > - echo "network --device $DEVICE --bootproto dhcp" | nash > + /sbin/dhclient $DEVICE > fi > if [ $? -eq 0 ]; then > # from network-scripts/ifup-post > > ACK from me, after you provide testing results as requested by Darryl > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel -- Arthur CLEMENT Linagora Paris From dpierce at redhat.com Tue Feb 9 14:37:19 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 9 Feb 2010 09:37:19 -0500 Subject: [Ovirt-devel] Proposals for making configure_from_network function works in f13 In-Reply-To: <201002091517.13885.aclement@linagora.com> References: <201002081535.24126.aclement@linagora.com> <2be7262f1002090525h19ad7821l8eb8756b525212a7@mail.gmail.com> <201002091517.13885.aclement@linagora.com> Message-ID: <20100209143719.GA7236@mcpierce-desktop.usersys.redhat.com> On Tue, Feb 09, 2010 at 03:17:13PM +0100, Arthur CLEMENT wrote: > It's working with Ricardo's patch > The ovirt-early script on my node : http://pastebin.com/f7d655481 Very good. Please send a patch with your code in it to the list and I'll take it upstream. :) -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From aclement at linagora.com Tue Feb 9 14:43:30 2010 From: aclement at linagora.com (Arthur CLEMENT) Date: Tue, 9 Feb 2010 15:43:30 +0100 Subject: [Ovirt-devel] Proposals for making configure_from_network function works in f13 In-Reply-To: <20100209143719.GA7236@mcpierce-desktop.usersys.redhat.com> References: <201002081535.24126.aclement@linagora.com> <201002091517.13885.aclement@linagora.com> <20100209143719.GA7236@mcpierce-desktop.usersys.redhat.com> Message-ID: <201002091543.30606.aclement@linagora.com> diff --git a/scripts/ovirt-early b/scripts/ovirt-early index 3bd44a5..0689bdb 100755 --- a/scripts/ovirt-early +++ b/scripts/ovirt-early @@ -40,7 +40,7 @@ configure_from_network() { if ! network_up ; then log "Using interface $DEVICE" # setup temporary interface to retrieve configuration - echo "network --device $DEVICE --bootproto dhcp" | nash + /sbin/dhclient $1 fi if [ $? -eq 0 ]; then # from network-scripts/ifup-post On Mardi 09 F?vrier 2010 15:37:19 Darryl L. Pierce wrote: > On Tue, Feb 09, 2010 at 03:17:13PM +0100, Arthur CLEMENT wrote: > > It's working with Ricardo's patch > > The ovirt-early script on my node : http://pastebin.com/f7d655481 > > Very good. Please send a patch with your code in it to the list and I'll > take it upstream. :) -- Arthur CLEMENT Linagora Paris From dpierce at redhat.com Tue Feb 9 18:15:10 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 9 Feb 2010 13:15:10 -0500 Subject: [Ovirt-devel] Updated ovirt-build and ovirt-release RPMs... Message-ID: <20100209181510.GB14748@mcpierce-desktop.usersys.redhat.com> I've built and uploaded new versions of $SUBJECT rpms to the ovirt.org yum repo. If you don't already have them installed, please grab them and install them to on your development environment. The main change is that the build Makefile now point so the git repos on fedorahosted.org rather than the old, unmaintained ones on et.redhat.com. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Tue Feb 9 18:29:06 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 9 Feb 2010 13:29:06 -0500 Subject: [Ovirt-devel] Proposals for making configure_from_network function works in f13 In-Reply-To: <201002091543.30606.aclement@linagora.com> References: <201002081535.24126.aclement@linagora.com> <201002091517.13885.aclement@linagora.com> <20100209143719.GA7236@mcpierce-desktop.usersys.redhat.com> <201002091543.30606.aclement@linagora.com> Message-ID: <20100209182906.GC14748@mcpierce-desktop.usersys.redhat.com> On Tue, Feb 09, 2010 at 03:43:30PM +0100, Arthur CLEMENT wrote: > diff --git a/scripts/ovirt-early b/scripts/ovirt-early > index 3bd44a5..0689bdb 100755 > --- a/scripts/ovirt-early > +++ b/scripts/ovirt-early > @@ -40,7 +40,7 @@ configure_from_network() { > if ! network_up ; then > log "Using interface $DEVICE" > # setup temporary interface to retrieve configuration > - echo "network --device $DEVICE --bootproto dhcp" | nash > + /sbin/dhclient $1 > fi > if [ $? -eq 0 ]; then > # from network-scripts/ifup-post > > > On Mardi 09 F?vrier 2010 15:37:19 Darryl L. Pierce wrote: > > On Tue, Feb 09, 2010 at 03:17:13PM +0100, Arthur CLEMENT wrote: > > > It's working with Ricardo's patch > > > The ovirt-early script on my node : http://pastebin.com/f7d655481 > > > > Very good. Please send a patch with your code in it to the list and I'll > > take it upstream. :) > -- > Arthur CLEMENT > Linagora Paris Thanks. This is now pushed upstream. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From apevec at gmail.com Tue Feb 9 19:45:25 2010 From: apevec at gmail.com (Alan Pevec) Date: Tue, 9 Feb 2010 20:45:25 +0100 Subject: [Ovirt-devel] Proposals for making configure_from_network function works in f13 In-Reply-To: <201002091543.30606.aclement@linagora.com> References: <201002081535.24126.aclement@linagora.com> <201002091517.13885.aclement@linagora.com> <20100209143719.GA7236@mcpierce-desktop.usersys.redhat.com> <201002091543.30606.aclement@linagora.com> Message-ID: <2be7262f1002091145o73d40011t80b9dacd2a005db0@mail.gmail.com> For submitting patches, please use git format-patch/send-email so that authorship is preserved, also add signed-off-by line in the patch comment (git commit -s adds it automatically) On Tue, Feb 9, 2010 at 3:43 PM, Arthur CLEMENT wrote: > diff --git a/scripts/ovirt-early b/scripts/ovirt-early > index 3bd44a5..0689bdb 100755 > --- a/scripts/ovirt-early > +++ b/scripts/ovirt-early > @@ -40,7 +40,7 @@ configure_from_network() { > ? ? ? ? if ! network_up ; then > ? ? ? ? ? ? log "Using interface $DEVICE" > ? ? ? ? ? ? # setup temporary interface to retrieve configuration > - ? ? ? ? ? ?echo "network --device $DEVICE --bootproto dhcp" | nash > + ? ? ? ? ? ?/sbin/dhclient $1 While semantically the same, it'd be more readable to use $DEVICE instead of $1 From dpierce at redhat.com Wed Feb 10 22:09:39 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 10 Feb 2010 17:09:39 -0500 Subject: [Ovirt-devel] RFC: First pass at making the node generic... Message-ID: <1265839780-17613-1-git-send-email-dpierce@redhat.com> I'm looking for feedback on this first patch. The node has been pushed towards a more generic boot process. With this patch the node can now boot up and execute a few specifically-named scripts that reside in /etc/node.d/ at key points during the startup. After this goes upstream, the next step will be to define in more detail the remote interfaces for the "managed" runtime operation. From dpierce at redhat.com Wed Feb 10 22:09:40 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 10 Feb 2010 17:09:40 -0500 Subject: [Ovirt-devel] [PATCH] Makes the managed node boot up process more generic. In-Reply-To: <1265839780-17613-1-git-send-email-dpierce@redhat.com> References: <1265839780-17613-1-git-send-email-dpierce@redhat.com> Message-ID: <1265839780-17613-2-git-send-email-dpierce@redhat.com> Refactored the sysvinit scripts so that developers can insert their own startup code into the boot process. Added a new system configuration file, /etc/sysconfig/node-config. Added /etc/node.d/ to allow developers to add scripts to be executed during the startup process. Signed-off-by: Darryl L. Pierce --- Makefile.am | 1 + ovirt-node.spec.in | 12 +++- scripts/node-config | 15 ++++ scripts/ovirt | 49 ++++++++--- scripts/ovirt-awake | 152 +++++++++++++++++++++++------------ scripts/ovirt-config-boot-wrapper | 4 +- scripts/ovirt-early | 159 ++++++++++++++++++------------------- scripts/ovirt-functions | 2 + scripts/ovirt-post | 83 +++++++++++-------- 9 files changed, 294 insertions(+), 183 deletions(-) create mode 100644 scripts/node-config mode change 100644 => 100755 scripts/ovirt-awake diff --git a/Makefile.am b/Makefile.am index 2f8865d..7798d09 100644 --- a/Makefile.am +++ b/Makefile.am @@ -69,6 +69,7 @@ EXTRA_DIST = \ nodeadmin/utils.py \ nodeadmin/volumeconfig.py \ scripts/collectd.conf.in \ + scripts/node-config \ scripts/ovirt \ scripts/ovirt-awake \ scripts/ovirt-config-boot \ diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in index c3da1a0..3d8d100 100644 --- a/ovirt-node.spec.in +++ b/ovirt-node.spec.in @@ -1,5 +1,6 @@ %define product_family oVirt Node %define beta Beta +%define mgmt_scripts_dir %{_sysconfdir}/node.d %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} @@ -87,6 +88,8 @@ make install DESTDIR=%{buildroot} %{__install} -d -m0755 %{buildroot}%{_sbindir} %{__install} -d -m0755 %{buildroot}%{_sysconfdir} %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/chkconfig.d +%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/sysconfig +%{__install} -d -m0755 %{buildroot}%{mgmt_scripts_dir} %{__install} -d -m0755 %{buildroot}%{_initrddir} %{__install} -d -m0755 %{buildroot}%{app_root} %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/cron.d @@ -94,7 +97,7 @@ make install DESTDIR=%{buildroot} %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/logrotate.d %{__install} -d -m0755 %{buildroot}%{python_sitelib}/nodeadmin -%{__install} -p -m0755 scripts/ovirt-awake %{buildroot}%{_sbindir} +%{__install} -p -m0644 scripts/node-config %{buildroot}%{_sysconfdir}/sysconfig %{__install} -p -m0755 scripts/ovirt-config-boot %{buildroot}%{_sbindir} %{__install} -p -m0755 scripts/ovirt-config-boot-wrapper %{buildroot}%{_sbindir} %{__install} -p -m0755 scripts/ovirt-config-collectd %{buildroot}%{_sbindir} @@ -153,6 +156,7 @@ make install DESTDIR=%{buildroot} # in Makefile now %{__install} -p -m0755 scripts/ovirt-functions %{buildroot}%{_initrddir} +%{__install} -p -m0755 scripts/ovirt-awake %{buildroot}%{_initrddir} %{__install} -p -m0755 scripts/ovirt-early %{buildroot}%{_initrddir} %{__install} -p -m0755 scripts/ovirt-firstboot %{buildroot}%{_initrddir} %{__install} -p -m0755 scripts/ovirt %{buildroot}%{_initrddir} @@ -227,6 +231,7 @@ ln -s ovirt-release %{buildroot}/etc/system-release %post # Setup basic collectd configuration sed '//,/<\/Plugin>/d' /etc/collectd.conf.in > /etc/collectd.conf +/sbin/chkconfig --add ovirt-awake /sbin/chkconfig --add ovirt-early /sbin/chkconfig --add ovirt-firstboot /sbin/chkconfig --add ovirt @@ -238,6 +243,7 @@ if [ $1 = 0 ] ; then /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 @@ -270,9 +276,11 @@ fi %config(noreplace) %{_sysconfdir}/logrotate.d/ovirt-node %config(noreplace) %{_sysconfdir}/cron.d/ovirt-logrotate +%{mgmt_scripts_dir} %{_sysconfdir}/ovirt-config-boot.d %{_sysconfdir}/ovirt-config-setup.d %config(noreplace) %{_sysconfdir}/collectd.conf.in +%config(noreplace) %{_sysconfdir}/sysconfig/node-config %doc COPYING # should be ifarch i386 @@ -280,7 +288,6 @@ fi # end i386 bits %{app_root}/syslinux-vesa-splash.jpg -%{_sbindir}/ovirt-awake %{_sbindir}/ovirt-config-boot %{_sbindir}/ovirt-config-boot-wrapper %{_sbindir}/ovirt-config-collectd @@ -300,6 +307,7 @@ fi %{_sbindir}/persist %{_sbindir}/unpersist +%{_initrddir}/ovirt-awake %{_initrddir}/ovirt-early %{_initrddir}/ovirt-firstboot %{_initrddir}/ovirt diff --git a/scripts/node-config b/scripts/node-config new file mode 100644 index 0000000..47d42a1 --- /dev/null +++ b/scripts/node-config @@ -0,0 +1,15 @@ +# 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="" \ No newline at end of file diff --git a/scripts/ovirt b/scripts/ovirt index 3a03460..d8d52cc 100755 --- a/scripts/ovirt +++ b/scripts/ovirt @@ -2,21 +2,24 @@ # # ovirt Start ovirt services # -# chkconfig: - 11 99 -# description: ovirt services -# +### BEGIN INIT INFO +# Provides: ovirt +# Required-Start: ovirt-early +# Default-Start: 2 3 4 5 +# Description: Performs managed node configuration functions. +### END INIT INFO # Source functions library . /etc/init.d/functions . /etc/init.d/ovirt-functions prog=ovirt -lockfile=/var/lock/subsys/$prog - -start() { +VAR_SUBSYS_OVIRT=/var/lock/subsys/$prog - touch $lockfile +# load the configuration file +[ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" +ovirt_start() { if is_standalone; then return 0 fi @@ -72,7 +75,7 @@ start() { 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 + 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 @@ -80,22 +83,42 @@ start() { else log "skipping libvirt-qpid and matahari configuration, could not find $libvirt_qpid_conf" fi +} + +start() { + 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 +} - rm -f $lockfile +stop() { + echo -n "Stopping ovirt: " + success } case "$1" in start) - printf "Starting ovirt: " - + [ -f "$VAR_SUBSYS_OVIRT" ] && exit 0 + echo -n "Starting ovirt: " { log "Starting ovirt" start log "Completed ovirt" } >> $OVIRT_LOGFILE 2>&1 - test $? == 0 && success || failure - echo ;; status) status $prog diff --git a/scripts/ovirt-awake b/scripts/ovirt-awake old mode 100644 new mode 100755 index 336c2b1..55db140 --- a/scripts/ovirt-awake +++ b/scripts/ovirt-awake @@ -1,9 +1,8 @@ #!/bin/bash # -# ovirt-awake Notifies the oVirt server that an oVirt Node is -# starting up. +# ovirt-awake - Notifies any management server that the node is starting. # -# Copyright (C) 2008 Red Hat, Inc. +# Copyright (C) 2008-2010 Red Hat, Inc. # Written by Darryl L. Pierce # # This program is free software; you can redistribute it and/or modify @@ -20,86 +19,135 @@ # 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 +# 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 -# Source function library . /etc/init.d/functions . /etc/init.d/ovirt-functions -function connect-to-server () { - echo "Connecting to $SRV_HOST:$SRV_PORT" - exec 3<> /dev/tcp/$SRV_HOST/$SRV_PORT -} +prog=ovirt-early +NODE_CONFIG=/etc/sysconfig/node-config +VAR_SUBSYS_NODECONFIG=/var/lock/subsys/node-config -function disconnect-from-server () { - <&3- -} +# load the configuration file +[ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" -function send-text () { - echo "$1" 1>&3 -} +send_text () { + local text=${1} -function receive-text () { - read 0<&3 + echo "$text" 1>&3 } -function error () { - errmsg="ERR: (ovirt-awake) $1" - send-text "$errmsg" - log "$errmsg" +receive_text () { + read 0<&3 } -start () { - connect-to-server - - receive-text - - if [ $REPLY == "HELLO?" ]; then - echo "Starting wakeup conversation." +error () { + local text=${1-} - send-text "HELLO!" - - read 0<&3 - - if [ $REPLY == "MODE?" ]; then - send-text "AWAKEN" - - receive-text + send_text "ERR: (ovirt-awake) ${text}" + # log "${text}" +} - KEYTAB=`echo $REPLY | awk '{ print $2 }'` +ovirt_startup () { + local mgmthost=${OVIRT_MANAGEMENT_SERVER} + local mgmtport=${OVIRT_MANAGEMENT_PORT} - if [ -n "$KEYTAB" -a -n "$KEYTAB_FILE" ]; then - echo "Retrieving keytab: '$KEYTAB'" + if [[ -z "${mgmthost}" ]] || [[ -z "${mgmtport}" ]]; then + find_srv identify tcp + mgmthost=$SRV_HOST + mgmtport=$SRV_PORT + fi - wget -q "$KEYTAB" --no-check-certificate --output-document="$KEYTAB_FILE" + if [[ -n "${mgmthost}" ]] && [[ -n "${mgmtport}" ]]; then + # log "Notifying oVirt management server: ${mgmthost}:${mgmtport}" + exec 3<> /dev/tcp/$mgmthost:$mgmtport + + connect-to-server + receive_text + if [ $REPLY == "HELLO?" ]; then + logo "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 - echo "No keytab to retrieve" + error "Did not get a mode request." fi - send-text ACK else - error "Did not get a mode request." + error "Did not get a proper startup marker." fi + # log "Disconnecting." + <&3- else - error "Did not get a proper startup marker." + # log "Missing server information. Failing..." + return 1 fi +} - echo "Disconnecting." +# Override this method to provide support for notifying a management +# system that the node has started and will be available after +# system initialization +start () { + 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") + 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 - disconnect-from-server + # log "Completed ovirt-awake: RC=${RC}" + rm -f $VAR_SUBSYS_NODECONFIG + return $RC } case "$1" in start) - SRV_HOST=$2 - SRV_PORT=$3 - KEYTAB_FILE=$4 - start - RETVAL=$? - ;; + echo -n "Starting ovirt-awake: " + [ -f "$VAR_SUBSYS_NODECONFIG" ] && exit 0 + { + start + RETVAL=$? + log "Completed ovirt-awake: RETVAL=$?" + } >> $OVIRT_LOGFILE 2>&1 + test $RETVAL == 0 && success || failure + ;; *) echo "Usage: $0 start" RETVAL=2 - ;; + ;; esac exit $RETVAL diff --git a/scripts/ovirt-config-boot-wrapper b/scripts/ovirt-config-boot-wrapper index 06f1088..89f0fc0 100755 --- a/scripts/ovirt-config-boot-wrapper +++ b/scripts/ovirt-config-boot-wrapper @@ -20,9 +20,9 @@ continuing." printf "\n" read -p "Please enter kernel boot arguments (hit return to use the above): " if [[ -n "$REPLY" ]]; then - bootparams="${REPLY}" + bootparams="${REPLY}" else - bootparams="${OVIRT_BOOTPARAMS}" + bootparams="${OVIRT_BOOTPARAMS}" fi if ask_yes_or_no "Do you wish to continue ([Y]es/[N]o)?"; then mount_live \ diff --git a/scripts/ovirt-early b/scripts/ovirt-early index 0689bdb..23c4f6e 100755 --- a/scripts/ovirt-early +++ b/scripts/ovirt-early @@ -2,16 +2,22 @@ # # ovirt-early Start early ovirt services # -# chkconfig: - 01 99 -# description: ovirt-early services -# +### BEGIN INIT INFO +# Provides: ovirt-early +# Required-Start: ovirt-awake +# Default-Start: 2 3 4 5 +# Dewscription: Managed node early configuration service +### END INIT INFO # Source functions library . /etc/init.d/functions . /etc/init.d/ovirt-functions prog=ovirt-early -lockfile=/var/lock/subsys/$prog +VAR_SUBSYS_OVIRT_EARLY=/var/lock/subsys/$prog + +# load the configuration file +[ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" BONDING_MODCONF_FILE=/etc/modprobe.d/bonding AUGTOOL_CONFIG=/var/tmp/augtool-config @@ -23,16 +29,16 @@ get_mac_addresses() { 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 + 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_from_network() { +configure_ovirt_management_nic() { DEVICE=$1 if [ -n "$DEVICE" ]; then @@ -62,12 +68,12 @@ configure_from_network() { if [ $? -eq 0 ]; then log "Remote configuration bundle retrieved to $cfgdb" ovirt-process-config $cfgdb $BONDING_MODCONF_FILE $AUGTOOL_CONFIG - if [ $? -eq 0 ]; then - log "Remote configuration retrieved and applied" + if [ $? -eq 0 ]; then + log "Remote configuration retrieved and applied" rm $cfgdb - else - log "Failure to retrieve or apply remote configuration" - fi + else + log "Failure to retrieve or apply remote configuration" + fi else log "Failed to retrieve configuration bundle" fi @@ -88,11 +94,11 @@ configure_from_network() { 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 + > /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" + ONBOOT=yes TYPE=Bridge PEERNTP=yes DELAY=0 \ + > /etc/sysconfig/network-scripts/ifcfg-$BRIDGE + log "Default config applied" fi } @@ -135,9 +141,39 @@ find_disk() { return 1 } +configure_management_interface() { + log "Configuring the manangement interface." + case $OVIRT_RUNTIME_MODE in + "ovirt") + configure_ovirt_management_nic $bootif + if [ -n "$init" ]; then + 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 + 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() { - touch $lockfile + touch $VAR_SUBSYS_OVIRT_EARLY # oVirt boot parameters # BOOTIF=link|eth*| (appended by pxelinux) # ovirt_init=[usb|scsi[:serial#]|/dev/...] @@ -351,21 +387,21 @@ start() { dns=*) dns=${i#dns=} ;; - ntp=*) - ntp=${i#ntp=} - ;; + ntp=*) + ntp=${i#ntp=} + ;; hostname=*) hostname=${i#hostname=} ;; vlan=*) vlan=${i#vlan=} ;; - ssh_pwauth=1 | ssh_pwauth=true) - ssh_pwauth=true - ;; - ssh_pwauth=0 | ssh_pwauth=false) - ssh_pwauth=false - ;; + ssh_pwauth=1 | ssh_pwauth=true) + ssh_pwauth=true + ;; + ssh_pwauth=0 | ssh_pwauth=false) + ssh_pwauth=false + ;; syslog=*) i=${i#syslog=} eval $(printf $i|awk -F: '{print "syslog_server="$1; print "syslog_port="$2;}') @@ -438,22 +474,10 @@ start() { -e "s/^mech_list: .*gssapi.*/mech_list: digest-md5/" \ /etc/sasl2/libvirt.conf else - configure_from_network $bootif - if [ -n "$init" ]; then - 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 - ovirt-config-boot /live "$bootparams" - fi - fi + configure_manament_interface fi - rm -f $lockfile + rm -f $VAR_SUBSYS_OVIRT_EARLY for hook in $ovirt_early; do post="$EARLY_DIR/post-$hook" @@ -465,49 +489,22 @@ start() { return 0 } -scan_for_swap() { - # swap partition activation - # find all of the partitions on the system - - # get the system pagesize - PAGESIZE=`getconf PAGESIZE` - - # look first at raw partitions XXX disk/by-id or HAL? (for cciss) - BLOCKDEVS=`ls /dev/sd? /dev/hd? 2>/dev/null` - - # now LVM partitions - LVMDEVS="$DEVICES `lvscan | awk '{print $2}' | tr -d \"'\"`" - - SWAPDEVS="$LVMDEVS" - for dev in $BLOCKDEVS; do - SWAPDEVS="$SWAPDEVS `fdisk -l $dev 2>/dev/null | tr '*' ' ' \ - | awk '$5 ~ /82/ {print $1}'`" - done - - # now check if any of these partitions are swap, and activate if so - for device in $SWAPDEVS; do - sig=`dd if=$device bs=1 count=10 skip=$(( $PAGESIZE - 10 )) \ - 2>/dev/null` - if [ "$sig" = "SWAPSPACE2" ]; then - swapon $device - fi - done +stop() { + echo -n "Stopping ovirt-early: " + success } case "$1" in start) - printf "Starting ovirt-early: " - + [ -f "$VAR_SUBSYS_NODE_CONFIG" ] && exit 0 + echo -n "Starting ovirt-early: " { - start_log log "Starting ovirt-early" start log "Completed ovirt-early" - stop_log - } - - test $? == 0 && success || failure - echo + RETVAL=$? + } >> $OVIRT_LOGFILE 2>&1 + test $RETVAL == 0 && success || failure ;; status) status $prog @@ -521,5 +518,7 @@ case "$1" in ;; *) echo "Usage: ovirt-early {start}" - exit 2 + RETVAL=2 esac + +exit $RETVAL diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index bab194b..ff2b016 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -16,6 +16,8 @@ OVIRT_STANDALONE=${OVIRT_STANDALONE:-0} OVIRT_BACKUP_DIR=/var/lib/ovirt-backup +MANAGEMENT_SCRIPTS_DIR=/etc/node.d + OVIRT_CONFIG_FILES="\ /etc/sysconfig/network-scripts/ifcfg-* \ /etc/rsyslog.conf \ diff --git a/scripts/ovirt-post b/scripts/ovirt-post index 03363cc..951d108 100755 --- a/scripts/ovirt-post +++ b/scripts/ovirt-post @@ -2,34 +2,40 @@ # # ovirt Start ovirt services # -# chkconfig: - 98 02 -# description: ovirt-post services -# +### BEGIN INIT INFO +# Provides: ovirt-post +# Required-Start: ovirt +# Default-Start: 2 3 4 5 +# Description: Performs managed node post configuration setup. +### END INIT INFO # Source functions library . /etc/init.d/functions . /etc/init.d/ovirt-functions prog=ovirt-post -lockfile=/var/lock/subsys/$prog +VAR_SUBSYS_OVIRT_POST=/var/lock/subsys/$prog + +# load the configuration file +[ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" start() { # wait for libvirt to finish initializing local count=0 while true; do - if [ -r /var/run/libvirt/libvirt-sock ]; 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 $lockfile - + if [ -r /var/run/libvirt/libvirt-sock ]; 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 @@ -38,20 +44,20 @@ start() { cp -f $BACKUP $ISSUE hwvirt=$(virsh capabilities) if [[ $hwvirt =~ kvm ]]; then - log "Hardware virtualization detected" + 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 + 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 cp -f $ISSUE $ISSUE_NET @@ -62,18 +68,27 @@ start() { # 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* - # Removed ovirt-identify-node since it has now - # been replaced with the matahari qmf agent. + # perform any post startup operations + case $OVIRT_RUNTIME_MODE in + esac + + rm -f $VAR_SUBSYS_OVIRT_POST +} - rm -f $lockfile +stop() { + echo -n "Stopping ovirt-post: " + success } case "$1" in start) - printf "Starting ovirt-post: " + [ -f "$VAR_SUBSYS_OVIRT_POST" ] && exit 0 + echo -n "Starting ovirt-post: " { log "Starting ovirt-post" -- 1.6.6 From dpierce at redhat.com Thu Feb 11 13:38:30 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Thu, 11 Feb 2010 08:38:30 -0500 Subject: [Ovirt-devel] [PATCH] Upgraded the version in preparation for version 2.0 development. Message-ID: <1265895510-27044-1-git-send-email-dpierce@redhat.com> Added new files to track changes, development plans, as well as to inform developers of how they can provide contributions to the project. Signed-off-by: Darryl L. Pierce --- .gitignore | 1 + CONTRIBUTING | 4 ++++ ChangeLog | 2 ++ TODO | 6 ++++++ configure.ac | 2 +- 5 files changed, 14 insertions(+), 1 deletions(-) create mode 100644 CONTRIBUTING create mode 100644 ChangeLog create mode 100644 TODO diff --git a/.gitignore b/.gitignore index 19b15d1..dc8f632 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ stamp-h1 ovirt-node*.gz ovirt-node.spec *.pyc +*~ diff --git a/CONTRIBUTING b/CONTRIBUTING new file mode 100644 index 0000000..306f95c --- /dev/null +++ b/CONTRIBUTING @@ -0,0 +1,4 @@ +HOW TO CONTRIBUTE TO THE OVIRT MANAGED NODE +=========================================== + +Please read: http://www.ovirt.org/page/Contributing diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..c4df475 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,2 @@ +CHANGELOG +========= diff --git a/TODO b/TODO new file mode 100644 index 0000000..9acc118 --- /dev/null +++ b/TODO @@ -0,0 +1,6 @@ +BACKLOG OF FEATURES +=================== + +You can find the development backlog here: + +http://www.ovirt.org/page/Backlog diff --git a/configure.ac b/configure.ac index 59593ae..7786d26 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([ovirt-node], [1.0.3], [ovirt-devel at redhat.com]) +AC_INIT([ovirt-node], [1.9.0], [ovirt-devel at redhat.com]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability tar-pax]) AC_PROG_CC AC_CONFIG_HEADERS([config.h]) -- 1.6.6 From jboggs at redhat.com Thu Feb 11 16:19:27 2010 From: jboggs at redhat.com (Joey Boggs) Date: Thu, 11 Feb 2010 11:19:27 -0500 Subject: [Ovirt-devel] [PATCH node] remove ipv4 validation for ntp and rely on actual ntp verification Message-ID: <1265905171-31376-1-git-send-email-jboggs@redhat.com> --- scripts/ovirt-config-networking | 13 ++++++------- scripts/ovirt-functions | 16 ++++++++++++++++ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index ec154c2..40a2d2c 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -414,12 +414,7 @@ function configure_ntp read -ep "Enter an NTP server (hit return when finished): " if [ -z "$REPLY" ]; then break; fi - - if is_valid_ipv4 $REPLY; then - NTPSERVERS="${NTPSERVERS}:${REPLY}" - else - printf "${REPLY} is an invalid address.\n" - fi + NTPSERVERS="${NTPSERVERS}:${REPLY}" done fi fi @@ -560,5 +555,9 @@ if [ "$net_configured" = 1 ]; then ifconfig $i down brctl delbr $i done - service network start + service network start 2> /dev/null + if [ $NTPSERVERS ]; then + log "Testing NTP Configuration" + test_ntp_configuration + fi fi diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index 6435387..48d0e39 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -729,6 +729,22 @@ is_valid_ipv4 () { return $result } +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 + +} + # execute a function if called as a script, e.g. # ovirt-functions ovirt_store_config /etc/hosts -- 1.6.6 From jboggs at redhat.com Thu Feb 11 16:19:28 2010 From: jboggs at redhat.com (Joey Boggs) Date: Thu, 11 Feb 2010 11:19:28 -0500 Subject: [Ovirt-devel] [PATCH node] update filtering of nics for ovirt-config-networking In-Reply-To: <1265905171-31376-1-git-send-email-jboggs@redhat.com> References: <1265905171-31376-1-git-send-email-jboggs@redhat.com> Message-ID: <1265905171-31376-2-git-send-email-jboggs@redhat.com> This updates the filtering model to only display nics that have kernel modules associated with them, which filters out all nonphysical devices. --- scripts/ovirt-config-networking | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index 40a2d2c..96e425f 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -455,7 +455,7 @@ function setup_menu fi # Add virtio NICs that were possibly not detected by hal - NICS="$NICS $(ifconfig -a | awk '/Ethernet/ {print $1}' | grep -v -E "^br|^bond|^vnet|^virbr|\." | xargs)" + NICS="$(ifconfig -a | awk '/Ethernet/ {print $1}'|xargs)" NICS=$(echo $NICS | tr ' ' '\n' | sort -u | xargs) PS3="Please select an interface or configuration option: " @@ -481,6 +481,7 @@ else 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) @@ -489,14 +490,17 @@ else else pxe=" " fi - printf "%s%-10s %-12s %-18s\n" "$pxe" "$nic" "$driver" "$mac" + 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 $NICS "$DNS" "$NTP" "$Abort" "$Save" + select NIC in $PHY_NICS "$DNS" "$NTP" "$Abort" "$Save" do printf "\n" case "$NIC" in -- 1.6.6 From jboggs at redhat.com Thu Feb 11 16:19:29 2010 From: jboggs at redhat.com (Joey Boggs) Date: Thu, 11 Feb 2010 11:19:29 -0500 Subject: [Ovirt-devel] [PATCH node] disallow any partitions being set to 0MB In-Reply-To: <1265905171-31376-2-git-send-email-jboggs@redhat.com> References: <1265905171-31376-1-git-send-email-jboggs@redhat.com> <1265905171-31376-2-git-send-email-jboggs@redhat.com> Message-ID: <1265905171-31376-3-git-send-email-jboggs@redhat.com> --- scripts/ovirt-config-storage | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index 9c3f773..10a4066 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -291,7 +291,7 @@ EOF printf "Aborting" return elif [[ $mb_input =~ ^-*[0-9]+$ ]]; then - if [[ $mb_input -ge $min_size || $mb_input =~ $part_regexp ]] \ + if [[ $mb_input -ge $min_size || $mb_input =~ $part_regexp && $mb_input -ne 0 ]] \ && [[ $mb_input -le $space_left ]] ; then eval "$size_var=$mb_input" size_used=$mb_input -- 1.6.6 From jboggs at redhat.com Thu Feb 11 16:19:31 2010 From: jboggs at redhat.com (Joey Boggs) Date: Thu, 11 Feb 2010 11:19:31 -0500 Subject: [Ovirt-devel] [PATCH node] restart ntp service after testing added ntp servers In-Reply-To: <1265905171-31376-4-git-send-email-jboggs@redhat.com> References: <1265905171-31376-1-git-send-email-jboggs@redhat.com> <1265905171-31376-2-git-send-email-jboggs@redhat.com> <1265905171-31376-3-git-send-email-jboggs@redhat.com> <1265905171-31376-4-git-send-email-jboggs@redhat.com> Message-ID: <1265905171-31376-5-git-send-email-jboggs@redhat.com> --- scripts/ovirt-functions | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index 48d0e39..fae13e7 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -742,7 +742,7 @@ test_ntp_configuration () { printf "\n Verified NTP server: $server \n" fi done - + service ntpd start } # execute a function if called as a script, e.g. -- 1.6.6 From jboggs at redhat.com Thu Feb 11 16:19:30 2010 From: jboggs at redhat.com (Joey Boggs) Date: Thu, 11 Feb 2010 11:19:30 -0500 Subject: [Ovirt-devel] [PATCH node] remove vlans properly when changing network settings In-Reply-To: <1265905171-31376-3-git-send-email-jboggs@redhat.com> References: <1265905171-31376-1-git-send-email-jboggs@redhat.com> <1265905171-31376-2-git-send-email-jboggs@redhat.com> <1265905171-31376-3-git-send-email-jboggs@redhat.com> Message-ID: <1265905171-31376-4-git-send-email-jboggs@redhat.com> --- scripts/ovirt-config-networking | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index 96e425f..f1958c0 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -529,6 +529,13 @@ 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 -- 1.6.6 From mburns at redhat.com Thu Feb 11 16:35:49 2010 From: mburns at redhat.com (Mike Burns) Date: Thu, 11 Feb 2010 11:35:49 -0500 Subject: [Ovirt-devel] [PATCH node] disallow any partitions being set to 0MB In-Reply-To: <1265905171-31376-3-git-send-email-jboggs@redhat.com> References: <1265905171-31376-1-git-send-email-jboggs@redhat.com> <1265905171-31376-2-git-send-email-jboggs@redhat.com> <1265905171-31376-3-git-send-email-jboggs@redhat.com> Message-ID: <1265906149.3058.3.camel@localhost.localdomain> On Thu, 2010-02-11 at 11:19 -0500, Joey Boggs wrote: > --- > scripts/ovirt-config-storage | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage > index 9c3f773..10a4066 100755 > --- a/scripts/ovirt-config-storage > +++ b/scripts/ovirt-config-storage > @@ -291,7 +291,7 @@ EOF > printf "Aborting" > return > elif [[ $mb_input =~ ^-*[0-9]+$ ]]; then > - if [[ $mb_input -ge $min_size || $mb_input =~ $part_regexp ]] \ > + if [[ $mb_input -ge $min_size || $mb_input =~ $part_regexp && $mb_input -ne 0 ]] \ > && [[ $mb_input -le $space_left ]] ; then > eval "$size_var=$mb_input" > size_used=$mb_input If we're not supporting 0, we should also remove this: diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index be22ef6..1a50ea9 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -238,8 +238,7 @@ do_configure() 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 "* All partitions 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" -------------- next part -------------- An HTML attachment was scrubbed... URL: From jboggs at redhat.com Thu Feb 11 17:27:50 2010 From: jboggs at redhat.com (Joey Boggs) Date: Thu, 11 Feb 2010 12:27:50 -0500 Subject: [Ovirt-devel] [PATCH node] disallow any partitions being set to 0MB In-Reply-To: <1265906149.3058.3.camel@localhost.localdomain> References: <1265905171-31376-1-git-send-email-jboggs@redhat.com> <1265905171-31376-2-git-send-email-jboggs@redhat.com> <1265905171-31376-3-git-send-email-jboggs@redhat.com> <1265906149.3058.3.camel@localhost.localdomain> Message-ID: <4B743E16.50802@redhat.com> On 02/11/2010 11:35 AM, Mike Burns wrote: > On Thu, 2010-02-11 at 11:19 -0500, Joey Boggs wrote: >> --- >> scripts/ovirt-config-storage | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage >> index 9c3f773..10a4066 100755 >> --- a/scripts/ovirt-config-storage >> +++ b/scripts/ovirt-config-storage >> @@ -291,7 +291,7 @@ EOF >> printf "Aborting" >> return >> elif [[ $mb_input =~ ^-*[0-9]+$ ]]; then >> - if [[ $mb_input -ge $min_size || $mb_input =~ $part_regexp ]] \ >> + if [[ $mb_input -ge $min_size || $mb_input =~ $part_regexp&& $mb_input -ne 0 ]] \ >> && [[ $mb_input -le $space_left ]] ; then >> eval "$size_var=$mb_input" >> size_used=$mb_input >> > > If we're not supporting 0, we should also remove this: > > diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage > index be22ef6..1a50ea9 100755 > --- a/scripts/ovirt-config-storage > +++ b/scripts/ovirt-config-storage > @@ -238,8 +238,7 @@ do_configure() > 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 "* All partitions 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" > > I pulled this in from downstream, so I figured there would be some discussion around this patch. Should there be support for 0MB sized partitions? If not then I'll update the patch with the comments suggested. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryanh at us.ibm.com Thu Feb 11 17:33:51 2010 From: ryanh at us.ibm.com (Ryan Harper) Date: Thu, 11 Feb 2010 11:33:51 -0600 Subject: [Ovirt-devel] [PATCH node] disallow any partitions being set to 0MB In-Reply-To: <1265905171-31376-3-git-send-email-jboggs@redhat.com> References: <1265905171-31376-1-git-send-email-jboggs@redhat.com> <1265905171-31376-2-git-send-email-jboggs@redhat.com> <1265905171-31376-3-git-send-email-jboggs@redhat.com> Message-ID: <20100211173351.GC6083@us.ibm.com> * Joey Boggs [2010-02-11 10:26]: > --- > scripts/ovirt-config-storage | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage > index 9c3f773..10a4066 100755 > --- a/scripts/ovirt-config-storage > +++ b/scripts/ovirt-config-storage > @@ -291,7 +291,7 @@ EOF > printf "Aborting" > return > elif [[ $mb_input =~ ^-*[0-9]+$ ]]; then > - if [[ $mb_input -ge $min_size || $mb_input =~ $part_regexp ]] \ > + if [[ $mb_input -ge $min_size || $mb_input =~ $part_regexp && $mb_input -ne 0 ]] \ Does this prevent someone setting the SWAP partition to zero? For example if someone doesn't want to enable overcommit is there a requirement for having an active SWAP partition? -- Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx ryanh at us.ibm.com From jboggs at redhat.com Thu Feb 11 17:34:58 2010 From: jboggs at redhat.com (Joey Boggs) Date: Thu, 11 Feb 2010 12:34:58 -0500 Subject: [Ovirt-devel] [PATCH node] disallow any partitions being set to 0MB In-Reply-To: <20100211173351.GC6083@us.ibm.com> References: <1265905171-31376-1-git-send-email-jboggs@redhat.com> <1265905171-31376-2-git-send-email-jboggs@redhat.com> <1265905171-31376-3-git-send-email-jboggs@redhat.com> <20100211173351.GC6083@us.ibm.com> Message-ID: <4B743FC2.6020203@redhat.com> On 02/11/2010 12:33 PM, Ryan Harper wrote: > * Joey Boggs [2010-02-11 10:26]: > >> --- >> scripts/ovirt-config-storage | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage >> index 9c3f773..10a4066 100755 >> --- a/scripts/ovirt-config-storage >> +++ b/scripts/ovirt-config-storage >> @@ -291,7 +291,7 @@ EOF >> printf "Aborting" >> return >> elif [[ $mb_input =~ ^-*[0-9]+$ ]]; then >> - if [[ $mb_input -ge $min_size || $mb_input =~ $part_regexp ]] \ >> + if [[ $mb_input -ge $min_size || $mb_input =~ $part_regexp&& $mb_input -ne 0 ]] \ >> > Does this prevent someone setting the SWAP partition to zero? For > example if someone doesn't want to enable overcommit is there a > requirement for having an active SWAP partition? > > It would, but patch is being nak'ed so no worries From dpierce at redhat.com Thu Feb 11 17:52:10 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Thu, 11 Feb 2010 12:52:10 -0500 Subject: [Ovirt-devel] [PATCH] Provides a reference implementation management server. Message-ID: <1265910730-2150-1-git-send-email-dpierce@redhat.com> The reference implementation server is based on TG2. The majority of the boiler plate code has been stripped out to focus the server solely on the functionality necessary for a management server. Signed-off-by: Darryl L. Pierce --- server/.gitignore | 4 + server/MANIFEST.in | 4 + server/README.txt | 24 ++ server/development.ini | 130 ++++++++++ server/ez_setup/README.txt | 14 ++ server/ez_setup/__init__.py | 247 ++++++++++++++++++++ server/ovirtserver/__init__.py | 18 ++ server/ovirtserver/config/__init__.py | 16 ++ server/ovirtserver/config/app_cfg.py | 54 +++++ server/ovirtserver/config/deployment.ini_tmpl | 104 ++++++++ server/ovirtserver/config/environment.py | 25 ++ server/ovirtserver/config/middleware.py | 55 +++++ server/ovirtserver/controllers/__init__.py | 18 ++ server/ovirtserver/controllers/controller.template | 36 +++ server/ovirtserver/controllers/error.py | 46 ++++ server/ovirtserver/controllers/root.py | 55 +++++ server/ovirtserver/controllers/secure.py | 21 ++ server/ovirtserver/controllers/template.py | 51 ++++ .../ovirtserver/i18n/ru/LC_MESSAGES/ovirtserver.po | 24 ++ server/ovirtserver/lib/__init__.py | 16 ++ server/ovirtserver/lib/app_globals.py | 33 +++ server/ovirtserver/lib/base.py | 44 ++++ server/ovirtserver/lib/helpers.py | 20 ++ server/ovirtserver/model/__init__.py | 77 ++++++ server/ovirtserver/model/auth.py | 27 +++ server/ovirtserver/model/model.template | 37 +++ server/ovirtserver/public/favicon.ico | Bin 0 -> 1104 bytes server/ovirtserver/templates/__init__.py | 18 ++ server/ovirtserver/templates/error.html | 19 ++ server/ovirtserver/templates/index.html | 20 ++ server/ovirtserver/tests/__init__.py | 80 +++++++ server/ovirtserver/tests/functional/__init__.py | 18 ++ .../tests/functional/test_authentication.py | 16 ++ server/ovirtserver/tests/functional/test_root.py | 48 ++++ server/ovirtserver/tests/models/__init__.py | 68 ++++++ server/ovirtserver/tests/models/test_auth.py | 22 ++ server/ovirtserver/websetup.py | 42 ++++ server/server.egg-info/PKG-INFO | 10 + server/server.egg-info/SOURCES.txt | 68 ++++++ server/server.egg-info/dependency_links.txt | 1 + server/server.egg-info/entry_points.txt | 7 + server/server.egg-info/paster_plugins.txt | 4 + server/server.egg-info/requires.txt | 6 + server/server.egg-info/top_level.txt | 1 + server/setup.cfg | 32 +++ server/setup.py | 63 +++++ server/test.ini | 42 ++++ 47 files changed, 1785 insertions(+), 0 deletions(-) create mode 100644 server/.gitignore create mode 100644 server/MANIFEST.in create mode 100644 server/README.txt create mode 100644 server/development.ini create mode 100644 server/ez_setup/README.txt create mode 100644 server/ez_setup/__init__.py create mode 100644 server/ovirtserver/__init__.py create mode 100644 server/ovirtserver/config/__init__.py create mode 100644 server/ovirtserver/config/app_cfg.py create mode 100644 server/ovirtserver/config/deployment.ini_tmpl create mode 100644 server/ovirtserver/config/environment.py create mode 100644 server/ovirtserver/config/middleware.py create mode 100644 server/ovirtserver/controllers/__init__.py create mode 100644 server/ovirtserver/controllers/controller.template create mode 100644 server/ovirtserver/controllers/error.py create mode 100644 server/ovirtserver/controllers/root.py create mode 100644 server/ovirtserver/controllers/secure.py create mode 100644 server/ovirtserver/controllers/template.py create mode 100644 server/ovirtserver/i18n/ru/LC_MESSAGES/ovirtserver.po create mode 100644 server/ovirtserver/lib/__init__.py create mode 100644 server/ovirtserver/lib/app_globals.py create mode 100644 server/ovirtserver/lib/base.py create mode 100644 server/ovirtserver/lib/helpers.py create mode 100644 server/ovirtserver/model/__init__.py create mode 100644 server/ovirtserver/model/auth.py create mode 100644 server/ovirtserver/model/model.template create mode 100644 server/ovirtserver/public/favicon.ico create mode 100644 server/ovirtserver/templates/__init__.py create mode 100644 server/ovirtserver/templates/error.html create mode 100644 server/ovirtserver/templates/index.html create mode 100644 server/ovirtserver/tests/__init__.py create mode 100644 server/ovirtserver/tests/functional/__init__.py create mode 100644 server/ovirtserver/tests/functional/test_authentication.py create mode 100644 server/ovirtserver/tests/functional/test_root.py create mode 100644 server/ovirtserver/tests/models/__init__.py create mode 100644 server/ovirtserver/tests/models/test_auth.py create mode 100644 server/ovirtserver/websetup.py create mode 100644 server/server.egg-info/PKG-INFO create mode 100644 server/server.egg-info/SOURCES.txt create mode 100644 server/server.egg-info/dependency_links.txt create mode 100644 server/server.egg-info/entry_points.txt create mode 100644 server/server.egg-info/paster_plugins.txt create mode 100644 server/server.egg-info/requires.txt create mode 100644 server/server.egg-info/top_level.txt create mode 100644 server/setup.cfg create mode 100644 server/setup.py create mode 100644 server/test.ini diff --git a/server/.gitignore b/server/.gitignore new file mode 100644 index 0000000..41bf6ae --- /dev/null +++ b/server/.gitignore @@ -0,0 +1,4 @@ +build/ +data/ +dist/ +devdata.db diff --git a/server/MANIFEST.in b/server/MANIFEST.in new file mode 100644 index 0000000..e9c47eb --- /dev/null +++ b/server/MANIFEST.in @@ -0,0 +1,4 @@ +recursive-include ovirtserver/public * +include ovirtserver/public/favicon.ico +recursive-include ovirtserver/i18n * +recursive-include ovirtserver/templates * diff --git a/server/README.txt b/server/README.txt new file mode 100644 index 0000000..809ebf3 --- /dev/null +++ b/server/README.txt @@ -0,0 +1,24 @@ +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. diff --git a/server/development.ini b/server/development.ini new file mode 100644 index 0000000..2295b25 --- /dev/null +++ b/server/development.ini @@ -0,0 +1,130 @@ +# 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 +#email_to = you at yourdomain.com +smtp_server = localhost +error_email_from = paste at 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 at hostname:port/databasename +# sqlalchemy.url=mysql://username:password at 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 diff --git a/server/ez_setup/README.txt b/server/ez_setup/README.txt new file mode 100644 index 0000000..77c986d --- /dev/null +++ b/server/ez_setup/README.txt @@ -0,0 +1,14 @@ +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. diff --git a/server/ez_setup/__init__.py b/server/ez_setup/__init__.py new file mode 100644 index 0000000..8d35412 --- /dev/null +++ b/server/ez_setup/__init__.py @@ -0,0 +1,247 @@ +#!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:]) diff --git a/server/ovirtserver/__init__.py b/server/ovirtserver/__init__.py new file mode 100644 index 0000000..1d14a09 --- /dev/null +++ b/server/ovirtserver/__init__.py @@ -0,0 +1,18 @@ +# 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""" diff --git a/server/ovirtserver/config/__init__.py b/server/ovirtserver/config/__init__.py new file mode 100644 index 0000000..90ca87c --- /dev/null +++ b/server/ovirtserver/config/__init__.py @@ -0,0 +1,16 @@ +# 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. diff --git a/server/ovirtserver/config/app_cfg.py b/server/ovirtserver/config/app_cfg.py new file mode 100644 index 0000000..8882a6b --- /dev/null +++ b/server/ovirtserver/config/app_cfg.py @@ -0,0 +1,54 @@ +# 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 diff --git a/server/ovirtserver/config/deployment.ini_tmpl b/server/ovirtserver/config/deployment.ini_tmpl new file mode 100644 index 0000000..7b1403c --- /dev/null +++ b/server/ovirtserver/config/deployment.ini_tmpl @@ -0,0 +1,104 @@ +# 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 +email_to = you at yourdomain.com +smtp_server = localhost +error_email_from = paste at 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 diff --git a/server/ovirtserver/config/environment.py b/server/ovirtserver/config/environment.py new file mode 100644 index 0000000..01b0275 --- /dev/null +++ b/server/ovirtserver/config/environment.py @@ -0,0 +1,25 @@ +# 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() diff --git a/server/ovirtserver/config/middleware.py b/server/ovirtserver/config/middleware.py new file mode 100644 index 0000000..b5f47da --- /dev/null +++ b/server/ovirtserver/config/middleware.py @@ -0,0 +1,55 @@ +# 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 diff --git a/server/ovirtserver/controllers/__init__.py b/server/ovirtserver/controllers/__init__.py new file mode 100644 index 0000000..417d5ed --- /dev/null +++ b/server/ovirtserver/controllers/__init__.py @@ -0,0 +1,18 @@ +# 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.""" diff --git a/server/ovirtserver/controllers/controller.template b/server/ovirtserver/controllers/controller.template new file mode 100644 index 0000000..2de6832 --- /dev/null +++ b/server/ovirtserver/controllers/controller.template @@ -0,0 +1,36 @@ +# 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') diff --git a/server/ovirtserver/controllers/error.py b/server/ovirtserver/controllers/error.py new file mode 100644 index 0000000..6a14218 --- /dev/null +++ b/server/ovirtserver/controllers/error.py @@ -0,0 +1,46 @@ +# 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 = ("

We're sorry but we weren't able to process " + " this request.

") + 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 diff --git a/server/ovirtserver/controllers/root.py b/server/ovirtserver/controllers/root.py new file mode 100644 index 0000000..cfd682b --- /dev/null +++ b/server/ovirtserver/controllers/root.py @@ -0,0 +1,55 @@ +# 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') diff --git a/server/ovirtserver/controllers/secure.py b/server/ovirtserver/controllers/secure.py new file mode 100644 index 0000000..adb98f7 --- /dev/null +++ b/server/ovirtserver/controllers/secure.py @@ -0,0 +1,21 @@ +# 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. diff --git a/server/ovirtserver/controllers/template.py b/server/ovirtserver/controllers/template.py new file mode 100644 index 0000000..77a1fcb --- /dev/null +++ b/server/ovirtserver/controllers/template.py @@ -0,0 +1,51 @@ +# 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) diff --git a/server/ovirtserver/i18n/ru/LC_MESSAGES/ovirtserver.po b/server/ovirtserver/i18n/ru/LC_MESSAGES/ovirtserver.po new file mode 100644 index 0000000..36532d4 --- /dev/null +++ b/server/ovirtserver/i18n/ru/LC_MESSAGES/ovirtserver.po @@ -0,0 +1,24 @@ +# Russian translations for ${package}. +# Copyright (C) 2008 ORGANIZATION +# This file is distributed under the same license as the ${package} project. +# FIRST AUTHOR , 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: ${package} 0.0.0\n" +"Report-Msgid-Bugs-To: EMAIL at 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 \n" +"Language-Team: ru \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 "???????? ???????????????????? ?????????????? ????????????????" + diff --git a/server/ovirtserver/lib/__init__.py b/server/ovirtserver/lib/__init__.py new file mode 100644 index 0000000..90ca87c --- /dev/null +++ b/server/ovirtserver/lib/__init__.py @@ -0,0 +1,16 @@ +# 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. diff --git a/server/ovirtserver/lib/app_globals.py b/server/ovirtserver/lib/app_globals.py new file mode 100644 index 0000000..d5d2abe --- /dev/null +++ b/server/ovirtserver/lib/app_globals.py @@ -0,0 +1,33 @@ +# 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 diff --git a/server/ovirtserver/lib/base.py b/server/ovirtserver/lib/base.py new file mode 100644 index 0000000..90772cc --- /dev/null +++ b/server/ovirtserver/lib/base.py @@ -0,0 +1,44 @@ +# 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) diff --git a/server/ovirtserver/lib/helpers.py b/server/ovirtserver/lib/helpers.py new file mode 100644 index 0000000..88cdc0f --- /dev/null +++ b/server/ovirtserver/lib/helpers.py @@ -0,0 +1,20 @@ +# 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 diff --git a/server/ovirtserver/model/__init__.py b/server/ovirtserver/model/__init__.py new file mode 100644 index 0000000..1b37524 --- /dev/null +++ b/server/ovirtserver/model/__init__.py @@ -0,0 +1,77 @@ +# 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. diff --git a/server/ovirtserver/model/auth.py b/server/ovirtserver/model/auth.py new file mode 100644 index 0000000..d7ea74b --- /dev/null +++ b/server/ovirtserver/model/auth.py @@ -0,0 +1,27 @@ +# 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. + +""" diff --git a/server/ovirtserver/model/model.template b/server/ovirtserver/model/model.template new file mode 100644 index 0000000..716807e --- /dev/null +++ b/server/ovirtserver/model/model.template @@ -0,0 +1,37 @@ +# 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) + + #} diff --git a/server/ovirtserver/public/favicon.ico b/server/ovirtserver/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..840986e4705befe9beb4275e2807fd358a362497 GIT binary patch literal 1104 zcmV-W1h4xaiwFP!000000|7Y%#`{M}MmRZP5C9MW=S=`zU0s?(6{e=9adB~piHWPL ztMKsf)U_xHB8w!DmPpP!#EEiT>N-OZzotgNilw50s}{OQ-t z^78VNlas>2!U6&U#KgqR%*?*NzOJsW&d$!SbyBdfu%Muz$;rva#>TX?w3(Ti+uPgs z&04auvZ$!2y1Kf(y}gex2j}PK(9qCSktL!dMnZf at o5 z^=WBo?eqTG!L-)a*6Ql&*x1;RX;!tCefaqJQBhIy=HN$1M}|Wt-{0TEn}yfO!GVE+ zq*N-`-RJ-R|LpASW at ct!U|@4WF3Wo@$oPbyO(IuUSF(ar`tX0OWF<|!XSIN1gF at gA;^d5tjqK&(Vr6Ob_W0=R?)?A%)7RUD!9CjD-;a-v=jA}IlqoboyQ&+&&w#&=Qrjm-vP)P6Z at 9ysI`}_OK z%F4jN!2bUJ`uh6f;^M)^&t_Rs z^3l at O)Y8(|)Y8MYtj4>w=-kzvNgU77)ZyXb;o{@<_4W4l_V at Pn&CShIQ&aBl?dj?1 z>+9>x$HQV{Wy{OVfpc@~>*{A`XINNRT3TDkzqtPX{d|9grlg}C92_JgBg at duy1Tij zr=`o!%gmD1y~4r3mYSg<{uM)VWnpw>WFU8GbZ8({Xk{QrNlj1yEC2ui z01yBW000R70Gl*n*5r*DAr*v}c{5O;!(~W<1i at wwn?xk>911*^&58pDNEBGHl1-Y! zV+_iHa4-fQI!I$2baBGqn6V%Zf~2u`ViBH2C-SAi8N`^CG-*}uEuuy4%&c&K2(ToAH z@#V*fF*aN?4%eiatvSoO&s7n+hMhu}Fm8LSRK7Cxk>S9DHBxp6v z^#Ky)%NHQGqX60GqJ}YJ6~YCHVxu;3Bfr8`Fy^oVBqLu=oJjP=2&4)cn?$>?=$ot> WvS0=+x)9A_Kma>NIMN(B1ONa82$stL literal 0 HcmV?d00001 diff --git a/server/ovirtserver/templates/__init__.py b/server/ovirtserver/templates/__init__.py new file mode 100644 index 0000000..14d408b --- /dev/null +++ b/server/ovirtserver/templates/__init__.py @@ -0,0 +1,18 @@ +# 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.""" diff --git a/server/ovirtserver/templates/error.html b/server/ovirtserver/templates/error.html new file mode 100644 index 0000000..001f8f4 --- /dev/null +++ b/server/ovirtserver/templates/error.html @@ -0,0 +1,19 @@ + + + + + + + + A ${code} Error has Occurred + + + +

Error ${code}

+ +
${XML(message)}
+ + diff --git a/server/ovirtserver/templates/index.html b/server/ovirtserver/templates/index.html new file mode 100644 index 0000000..1c2496b --- /dev/null +++ b/server/ovirtserver/templates/index.html @@ -0,0 +1,20 @@ + + + + + + Welcome to the oVirt management server + + + +

Welcome To The oVirt Server Reference Implementation

+ +

+ This server provides a reference implementation for how a management server should interact + with the oVirt managed node. +

+ + diff --git a/server/ovirtserver/tests/__init__.py b/server/ovirtserver/tests/__init__.py new file mode 100644 index 0000000..7c1a4a9 --- /dev/null +++ b/server/ovirtserver/tests/__init__.py @@ -0,0 +1,80 @@ +# 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() diff --git a/server/ovirtserver/tests/functional/__init__.py b/server/ovirtserver/tests/functional/__init__.py new file mode 100644 index 0000000..be0e5fb --- /dev/null +++ b/server/ovirtserver/tests/functional/__init__.py @@ -0,0 +1,18 @@ +# 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.""" diff --git a/server/ovirtserver/tests/functional/test_authentication.py b/server/ovirtserver/tests/functional/test_authentication.py new file mode 100644 index 0000000..90ca87c --- /dev/null +++ b/server/ovirtserver/tests/functional/test_authentication.py @@ -0,0 +1,16 @@ +# 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. diff --git a/server/ovirtserver/tests/functional/test_root.py b/server/ovirtserver/tests/functional/test_root.py new file mode 100644 index 0000000..5a7a55e --- /dev/null +++ b/server/ovirtserver/tests/functional/test_root.py @@ -0,0 +1,48 @@ +# 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!") diff --git a/server/ovirtserver/tests/models/__init__.py b/server/ovirtserver/tests/models/__init__.py new file mode 100644 index 0000000..354b222 --- /dev/null +++ b/server/ovirtserver/tests/models/__init__.py @@ -0,0 +1,68 @@ +# 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) diff --git a/server/ovirtserver/tests/models/test_auth.py b/server/ovirtserver/tests/models/test_auth.py new file mode 100644 index 0000000..eb0fce0 --- /dev/null +++ b/server/ovirtserver/tests/models/test_auth.py @@ -0,0 +1,22 @@ +# 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 diff --git a/server/ovirtserver/websetup.py b/server/ovirtserver/websetup.py new file mode 100644 index 0000000..36e3d8c --- /dev/null +++ b/server/ovirtserver/websetup.py @@ -0,0 +1,42 @@ +# 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" diff --git a/server/server.egg-info/PKG-INFO b/server/server.egg-info/PKG-INFO new file mode 100644 index 0000000..2ad8b9b --- /dev/null +++ b/server/server.egg-info/PKG-INFO @@ -0,0 +1,10 @@ +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 diff --git a/server/server.egg-info/SOURCES.txt b/server/server.egg-info/SOURCES.txt new file mode 100644 index 0000000..4632e06 --- /dev/null +++ b/server/server.egg-info/SOURCES.txt @@ -0,0 +1,68 @@ +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 diff --git a/server/server.egg-info/dependency_links.txt b/server/server.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/server/server.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/server/server.egg-info/entry_points.txt b/server/server.egg-info/entry_points.txt new file mode 100644 index 0000000..da62946 --- /dev/null +++ b/server/server.egg-info/entry_points.txt @@ -0,0 +1,7 @@ + + [paste.app_factory] + main = ovirtserver.config.middleware:make_app + + [paste.app_install] + main = pylons.util:PylonsInstaller + \ No newline at end of file diff --git a/server/server.egg-info/paster_plugins.txt b/server/server.egg-info/paster_plugins.txt new file mode 100644 index 0000000..ab508e5 --- /dev/null +++ b/server/server.egg-info/paster_plugins.txt @@ -0,0 +1,4 @@ +PasteScript +Pylons +TurboGears2 +tg.devtools diff --git a/server/server.egg-info/requires.txt b/server/server.egg-info/requires.txt new file mode 100644 index 0000000..661a57b --- /dev/null +++ b/server/server.egg-info/requires.txt @@ -0,0 +1,6 @@ +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 diff --git a/server/server.egg-info/top_level.txt b/server/server.egg-info/top_level.txt new file mode 100644 index 0000000..4e4dbeb --- /dev/null +++ b/server/server.egg-info/top_level.txt @@ -0,0 +1 @@ +ovirtserver diff --git a/server/setup.cfg b/server/setup.cfg new file mode 100644 index 0000000..cb01cf9 --- /dev/null +++ b/server/setup.cfg @@ -0,0 +1,32 @@ +[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 diff --git a/server/setup.py b/server/setup.py new file mode 100644 index 0000000..bf646ad --- /dev/null +++ b/server/setup.py @@ -0,0 +1,63 @@ +# 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 + """, +) diff --git a/server/test.ini b/server/test.ini new file mode 100644 index 0000000..415fcb0 --- /dev/null +++ b/server/test.ini @@ -0,0 +1,42 @@ +# 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 +# email_to = you at yourdomain.com +smtp_server = localhost +error_email_from = paste at 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. -- 1.6.6 From dpierce at redhat.com Thu Feb 11 18:53:20 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Thu, 11 Feb 2010 13:53:20 -0500 Subject: [Ovirt-devel] [PATCH] Upgraded the version in preparation for version 2.0 development. In-Reply-To: <1265895510-27044-1-git-send-email-dpierce@redhat.com> References: <1265895510-27044-1-git-send-email-dpierce@redhat.com> Message-ID: <20100211185320.GB5462@mcpierce-desktop.usersys.redhat.com> On Thu, Feb 11, 2010 at 08:38:30AM -0500, Darryl L. Pierce wrote: > Added new files to track changes, development plans, as well as to > inform developers of how they can provide contributions to the project. > > Signed-off-by: Darryl L. Pierce Since this is not a functional change, I've gone ahead and pushed it upstream. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From jboggs at redhat.com Fri Feb 12 20:14:26 2010 From: jboggs at redhat.com (Joey Boggs) Date: Fri, 12 Feb 2010 15:14:26 -0500 Subject: [Ovirt-devel] [PATCH] Makes the managed node boot up process more generic. In-Reply-To: <1265839780-17613-2-git-send-email-dpierce@redhat.com> References: <1265839780-17613-1-git-send-email-dpierce@redhat.com> <1265839780-17613-2-git-send-email-dpierce@redhat.com> Message-ID: <4B75B6A2.7000903@redhat.com> On 02/10/2010 05:09 PM, Darryl L. Pierce wrote: > Refactored the sysvinit scripts so that developers can insert their own > startup code into the boot process. > > Added a new system configuration file, /etc/sysconfig/node-config. > > Added /etc/node.d/ to allow developers to add scripts to be executed > during the startup process. > > Signed-off-by: Darryl L. Pierce > --- > Makefile.am | 1 + > ovirt-node.spec.in | 12 +++- > scripts/node-config | 15 ++++ > scripts/ovirt | 49 ++++++++--- > scripts/ovirt-awake | 152 +++++++++++++++++++++++------------ > scripts/ovirt-config-boot-wrapper | 4 +- > scripts/ovirt-early | 159 ++++++++++++++++++------------------- > scripts/ovirt-functions | 2 + > scripts/ovirt-post | 83 +++++++++++-------- > 9 files changed, 294 insertions(+), 183 deletions(-) > create mode 100644 scripts/node-config > mode change 100644 => 100755 scripts/ovirt-awake > > diff --git a/Makefile.am b/Makefile.am > index 2f8865d..7798d09 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -69,6 +69,7 @@ EXTRA_DIST = \ > nodeadmin/utils.py \ > nodeadmin/volumeconfig.py \ > scripts/collectd.conf.in \ > + scripts/node-config \ > scripts/ovirt \ > scripts/ovirt-awake \ > scripts/ovirt-config-boot \ > diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in > index c3da1a0..3d8d100 100644 > --- a/ovirt-node.spec.in > +++ b/ovirt-node.spec.in > @@ -1,5 +1,6 @@ > %define product_family oVirt Node > %define beta Beta > +%define mgmt_scripts_dir %{_sysconfdir}/node.d > %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} > > > @@ -87,6 +88,8 @@ make install DESTDIR=%{buildroot} > %{__install} -d -m0755 %{buildroot}%{_sbindir} > %{__install} -d -m0755 %{buildroot}%{_sysconfdir} > %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/chkconfig.d > +%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/sysconfig > +%{__install} -d -m0755 %{buildroot}%{mgmt_scripts_dir} > %{__install} -d -m0755 %{buildroot}%{_initrddir} > %{__install} -d -m0755 %{buildroot}%{app_root} > %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/cron.d > @@ -94,7 +97,7 @@ make install DESTDIR=%{buildroot} > %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/logrotate.d > %{__install} -d -m0755 %{buildroot}%{python_sitelib}/nodeadmin > > -%{__install} -p -m0755 scripts/ovirt-awake %{buildroot}%{_sbindir} > +%{__install} -p -m0644 scripts/node-config %{buildroot}%{_sysconfdir}/sysconfig > %{__install} -p -m0755 scripts/ovirt-config-boot %{buildroot}%{_sbindir} > %{__install} -p -m0755 scripts/ovirt-config-boot-wrapper %{buildroot}%{_sbindir} > %{__install} -p -m0755 scripts/ovirt-config-collectd %{buildroot}%{_sbindir} > @@ -153,6 +156,7 @@ make install DESTDIR=%{buildroot} > # in Makefile now > > %{__install} -p -m0755 scripts/ovirt-functions %{buildroot}%{_initrddir} > +%{__install} -p -m0755 scripts/ovirt-awake %{buildroot}%{_initrddir} > %{__install} -p -m0755 scripts/ovirt-early %{buildroot}%{_initrddir} > %{__install} -p -m0755 scripts/ovirt-firstboot %{buildroot}%{_initrddir} > %{__install} -p -m0755 scripts/ovirt %{buildroot}%{_initrddir} > @@ -227,6 +231,7 @@ ln -s ovirt-release %{buildroot}/etc/system-release > %post > # Setup basic collectd configuration > sed '//,/<\/Plugin>/d' /etc/collectd.conf.in> /etc/collectd.conf > +/sbin/chkconfig --add ovirt-awake > /sbin/chkconfig --add ovirt-early > /sbin/chkconfig --add ovirt-firstboot > /sbin/chkconfig --add ovirt > @@ -238,6 +243,7 @@ if [ $1 = 0 ] ; then > /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 > @@ -270,9 +276,11 @@ fi > %config(noreplace) %{_sysconfdir}/logrotate.d/ovirt-node > %config(noreplace) %{_sysconfdir}/cron.d/ovirt-logrotate > > +%{mgmt_scripts_dir} > %{_sysconfdir}/ovirt-config-boot.d > %{_sysconfdir}/ovirt-config-setup.d > %config(noreplace) %{_sysconfdir}/collectd.conf.in > +%config(noreplace) %{_sysconfdir}/sysconfig/node-config > > %doc COPYING > # should be ifarch i386 > @@ -280,7 +288,6 @@ fi > # end i386 bits > %{app_root}/syslinux-vesa-splash.jpg > > -%{_sbindir}/ovirt-awake > %{_sbindir}/ovirt-config-boot > %{_sbindir}/ovirt-config-boot-wrapper > %{_sbindir}/ovirt-config-collectd > @@ -300,6 +307,7 @@ fi > %{_sbindir}/persist > %{_sbindir}/unpersist > > +%{_initrddir}/ovirt-awake > %{_initrddir}/ovirt-early > %{_initrddir}/ovirt-firstboot > %{_initrddir}/ovirt > diff --git a/scripts/node-config b/scripts/node-config > new file mode 100644 > index 0000000..47d42a1 > --- /dev/null > +++ b/scripts/node-config > @@ -0,0 +1,15 @@ > +# 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="" > \ No newline at end of file > diff --git a/scripts/ovirt b/scripts/ovirt > index 3a03460..d8d52cc 100755 > --- a/scripts/ovirt > +++ b/scripts/ovirt > @@ -2,21 +2,24 @@ > # > # ovirt Start ovirt services > # > -# chkconfig: - 11 99 > -# description: ovirt services > -# > +### BEGIN INIT INFO > +# Provides: ovirt > +# Required-Start: ovirt-early > +# Default-Start: 2 3 4 5 > +# Description: Performs managed node configuration functions. > +### END INIT INFO > > # Source functions library > . /etc/init.d/functions > . /etc/init.d/ovirt-functions > > prog=ovirt > -lockfile=/var/lock/subsys/$prog > - > -start() { > +VAR_SUBSYS_OVIRT=/var/lock/subsys/$prog > > - touch $lockfile > +# load the configuration file > +[ -f "$NODE_CONFIG" ]&& . "$NODE_CONFIG" > > +ovirt_start() { > if is_standalone; then > return 0 > fi > @@ -72,7 +75,7 @@ start() { > 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 > + 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 > @@ -80,22 +83,42 @@ start() { > else > log "skipping libvirt-qpid and matahari configuration, could not find $libvirt_qpid_conf" > fi > +} > + > +start() { > + 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 > +} > > - rm -f $lockfile > +stop() { > + echo -n "Stopping ovirt: " > + success > } > > case "$1" in > start) > - printf "Starting ovirt: " > - > + [ -f "$VAR_SUBSYS_OVIRT" ]&& exit 0 > + echo -n "Starting ovirt: " > { > log "Starting ovirt" > start > log "Completed ovirt" > }>> $OVIRT_LOGFILE 2>&1 > - > test $? == 0&& success || failure > - echo > ;; > status) > status $prog > diff --git a/scripts/ovirt-awake b/scripts/ovirt-awake > old mode 100644 > new mode 100755 > index 336c2b1..55db140 > --- a/scripts/ovirt-awake > +++ b/scripts/ovirt-awake > @@ -1,9 +1,8 @@ > #!/bin/bash > # > -# ovirt-awake Notifies the oVirt server that an oVirt Node is > -# starting up. > +# ovirt-awake - Notifies any management server that the node is starting. > # > -# Copyright (C) 2008 Red Hat, Inc. > +# Copyright (C) 2008-2010 Red Hat, Inc. > # Written by Darryl L. Pierce > # > # This program is free software; you can redistribute it and/or modify > @@ -20,86 +19,135 @@ > # 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 > +# 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 > > -# Source function library > . /etc/init.d/functions > . /etc/init.d/ovirt-functions > > -function connect-to-server () { > - echo "Connecting to $SRV_HOST:$SRV_PORT" > - exec 3<> /dev/tcp/$SRV_HOST/$SRV_PORT > -} > +prog=ovirt-early > +NODE_CONFIG=/etc/sysconfig/node-config > +VAR_SUBSYS_NODECONFIG=/var/lock/subsys/node-config > > -function disconnect-from-server () { > -<&3- > -} > +# load the configuration file > +[ -f "$NODE_CONFIG" ]&& . "$NODE_CONFIG" > > -function send-text () { > - echo "$1" 1>&3 > -} > +send_text () { > + local text=${1} > > -function receive-text () { > - read 0<&3 > + echo "$text" 1>&3 > } > > -function error () { > - errmsg="ERR: (ovirt-awake) $1" > - send-text "$errmsg" > - log "$errmsg" > +receive_text () { > + read 0<&3 > } > > -start () { > - connect-to-server > - > - receive-text > - > - if [ $REPLY == "HELLO?" ]; then > - echo "Starting wakeup conversation." > +error () { > + local text=${1-} > > - send-text "HELLO!" > - > - read 0<&3 > - > - if [ $REPLY == "MODE?" ]; then > - send-text "AWAKEN" > - > - receive-text > + send_text "ERR: (ovirt-awake) ${text}" > + # log "${text}" > +} > > - KEYTAB=`echo $REPLY | awk '{ print $2 }'` > +ovirt_startup () { > + local mgmthost=${OVIRT_MANAGEMENT_SERVER} > + local mgmtport=${OVIRT_MANAGEMENT_PORT} > > - if [ -n "$KEYTAB" -a -n "$KEYTAB_FILE" ]; then > - echo "Retrieving keytab: '$KEYTAB'" > + if [[ -z "${mgmthost}" ]] || [[ -z "${mgmtport}" ]]; then > + find_srv identify tcp > + mgmthost=$SRV_HOST > + mgmtport=$SRV_PORT > + fi > > - wget -q "$KEYTAB" --no-check-certificate --output-document="$KEYTAB_FILE" > + if [[ -n "${mgmthost}" ]]&& [[ -n "${mgmtport}" ]]; then > + # log "Notifying oVirt management server: ${mgmthost}:${mgmtport}" > + exec 3<> /dev/tcp/$mgmthost:$mgmtport > + > + connect-to-server > + receive_text > + if [ $REPLY == "HELLO?" ]; then > + logo "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 > - echo "No keytab to retrieve" > + error "Did not get a mode request." > fi > - send-text ACK > else > - error "Did not get a mode request." > + error "Did not get a proper startup marker." > fi > + # log "Disconnecting." > +<&3- > else > - error "Did not get a proper startup marker." > + # log "Missing server information. Failing..." > + return 1 > fi > +} > > - echo "Disconnecting." > +# Override this method to provide support for notifying a management > +# system that the node has started and will be available after > +# system initialization > +start () { > + 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") > + 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 > > - disconnect-from-server > + # log "Completed ovirt-awake: RC=${RC}" > + rm -f $VAR_SUBSYS_NODECONFIG > + return $RC > } > > case "$1" in > start) > - SRV_HOST=$2 > - SRV_PORT=$3 > - KEYTAB_FILE=$4 > - start > - RETVAL=$? > - ;; > + echo -n "Starting ovirt-awake: " > + [ -f "$VAR_SUBSYS_NODECONFIG" ]&& exit 0 > + { > + start > + RETVAL=$? > + log "Completed ovirt-awake: RETVAL=$?" > + }>> $OVIRT_LOGFILE 2>&1 > + test $RETVAL == 0&& success || failure > + ;; > > *) > echo "Usage: $0 start" > RETVAL=2 > - ;; > + ;; > esac > > exit $RETVAL > diff --git a/scripts/ovirt-config-boot-wrapper b/scripts/ovirt-config-boot-wrapper > index 06f1088..89f0fc0 100755 > --- a/scripts/ovirt-config-boot-wrapper > +++ b/scripts/ovirt-config-boot-wrapper > @@ -20,9 +20,9 @@ continuing." > printf "\n" > read -p "Please enter kernel boot arguments (hit return to use the above): " > if [[ -n "$REPLY" ]]; then > - bootparams="${REPLY}" > + bootparams="${REPLY}" > else > - bootparams="${OVIRT_BOOTPARAMS}" > + bootparams="${OVIRT_BOOTPARAMS}" > fi > if ask_yes_or_no "Do you wish to continue ([Y]es/[N]o)?"; then > mount_live \ > diff --git a/scripts/ovirt-early b/scripts/ovirt-early > index 0689bdb..23c4f6e 100755 > --- a/scripts/ovirt-early > +++ b/scripts/ovirt-early > @@ -2,16 +2,22 @@ > # > # ovirt-early Start early ovirt services > # > -# chkconfig: - 01 99 > -# description: ovirt-early services > -# > +### BEGIN INIT INFO > +# Provides: ovirt-early > +# Required-Start: ovirt-awake > +# Default-Start: 2 3 4 5 > +# Dewscription: Managed node early configuration service > +### END INIT INFO > > # Source functions library > . /etc/init.d/functions > . /etc/init.d/ovirt-functions > > prog=ovirt-early > -lockfile=/var/lock/subsys/$prog > +VAR_SUBSYS_OVIRT_EARLY=/var/lock/subsys/$prog > + > +# load the configuration file > +[ -f "$NODE_CONFIG" ]&& . "$NODE_CONFIG" > > BONDING_MODCONF_FILE=/etc/modprobe.d/bonding > AUGTOOL_CONFIG=/var/tmp/augtool-config > @@ -23,16 +29,16 @@ get_mac_addresses() { > 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 > + 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_from_network() { > +configure_ovirt_management_nic() { > DEVICE=$1 > > if [ -n "$DEVICE" ]; then > @@ -62,12 +68,12 @@ configure_from_network() { > if [ $? -eq 0 ]; then > log "Remote configuration bundle retrieved to $cfgdb" > ovirt-process-config $cfgdb $BONDING_MODCONF_FILE $AUGTOOL_CONFIG > - if [ $? -eq 0 ]; then > - log "Remote configuration retrieved and applied" > + if [ $? -eq 0 ]; then > + log "Remote configuration retrieved and applied" > rm $cfgdb > - else > - log "Failure to retrieve or apply remote configuration" > - fi > + else > + log "Failure to retrieve or apply remote configuration" > + fi > else > log "Failed to retrieve configuration bundle" > fi > @@ -88,11 +94,11 @@ configure_from_network() { > 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 > +> /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" > + ONBOOT=yes TYPE=Bridge PEERNTP=yes DELAY=0 \ > +> /etc/sysconfig/network-scripts/ifcfg-$BRIDGE > + log "Default config applied" > fi > } > > @@ -135,9 +141,39 @@ find_disk() { > return 1 > } > > +configure_management_interface() { > + log "Configuring the manangement interface." > + case $OVIRT_RUNTIME_MODE in > + "ovirt") > + configure_ovirt_management_nic $bootif > + if [ -n "$init" ]; then > + 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 > + 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() { > - touch $lockfile > + touch $VAR_SUBSYS_OVIRT_EARLY > # oVirt boot parameters > # BOOTIF=link|eth*| (appended by pxelinux) > # ovirt_init=[usb|scsi[:serial#]|/dev/...] > @@ -351,21 +387,21 @@ start() { > dns=*) > dns=${i#dns=} > ;; > - ntp=*) > - ntp=${i#ntp=} > - ;; > + ntp=*) > + ntp=${i#ntp=} > + ;; > hostname=*) > hostname=${i#hostname=} > ;; > vlan=*) > vlan=${i#vlan=} > ;; > - ssh_pwauth=1 | ssh_pwauth=true) > - ssh_pwauth=true > - ;; > - ssh_pwauth=0 | ssh_pwauth=false) > - ssh_pwauth=false > - ;; > + ssh_pwauth=1 | ssh_pwauth=true) > + ssh_pwauth=true > + ;; > + ssh_pwauth=0 | ssh_pwauth=false) > + ssh_pwauth=false > + ;; > syslog=*) > i=${i#syslog=} > eval $(printf $i|awk -F: '{print "syslog_server="$1; print "syslog_port="$2;}') > @@ -438,22 +474,10 @@ start() { > -e "s/^mech_list: .*gssapi.*/mech_list: digest-md5/" \ > /etc/sasl2/libvirt.conf > else > - configure_from_network $bootif > - if [ -n "$init" ]; then > - 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 > - ovirt-config-boot /live "$bootparams" > - fi > - fi > + configure_manament_interface > fi > > - rm -f $lockfile > + rm -f $VAR_SUBSYS_OVIRT_EARLY > > for hook in $ovirt_early; do > post="$EARLY_DIR/post-$hook" > @@ -465,49 +489,22 @@ start() { > return 0 > } > > -scan_for_swap() { > - # swap partition activation > - # find all of the partitions on the system > - > - # get the system pagesize > - PAGESIZE=`getconf PAGESIZE` > - > - # look first at raw partitions XXX disk/by-id or HAL? (for cciss) > - BLOCKDEVS=`ls /dev/sd? /dev/hd? 2>/dev/null` > - > - # now LVM partitions > - LVMDEVS="$DEVICES `lvscan | awk '{print $2}' | tr -d \"'\"`" > - > - SWAPDEVS="$LVMDEVS" > - for dev in $BLOCKDEVS; do > - SWAPDEVS="$SWAPDEVS `fdisk -l $dev 2>/dev/null | tr '*' ' ' \ > - | awk '$5 ~ /82/ {print $1}'`" > - done > - > - # now check if any of these partitions are swap, and activate if so > - for device in $SWAPDEVS; do > - sig=`dd if=$device bs=1 count=10 skip=$(( $PAGESIZE - 10 )) \ > - 2>/dev/null` > - if [ "$sig" = "SWAPSPACE2" ]; then > - swapon $device > - fi > - done > +stop() { > + echo -n "Stopping ovirt-early: " > + success > } > > case "$1" in > start) > - printf "Starting ovirt-early: " > - > + [ -f "$VAR_SUBSYS_NODE_CONFIG" ]&& exit 0 > + echo -n "Starting ovirt-early: " > { > - start_log > log "Starting ovirt-early" > start > log "Completed ovirt-early" > - stop_log > - } > - > - test $? == 0&& success || failure > - echo > + RETVAL=$? > + }>> $OVIRT_LOGFILE 2>&1 > + test $RETVAL == 0&& success || failure > ;; > status) > status $prog > @@ -521,5 +518,7 @@ case "$1" in > ;; > *) > echo "Usage: ovirt-early {start}" > - exit 2 > + RETVAL=2 > esac > + > +exit $RETVAL > diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions > index bab194b..ff2b016 100644 > --- a/scripts/ovirt-functions > +++ b/scripts/ovirt-functions > @@ -16,6 +16,8 @@ OVIRT_STANDALONE=${OVIRT_STANDALONE:-0} > > OVIRT_BACKUP_DIR=/var/lib/ovirt-backup > > +MANAGEMENT_SCRIPTS_DIR=/etc/node.d > + > OVIRT_CONFIG_FILES="\ > /etc/sysconfig/network-scripts/ifcfg-* \ > /etc/rsyslog.conf \ > diff --git a/scripts/ovirt-post b/scripts/ovirt-post > index 03363cc..951d108 100755 > --- a/scripts/ovirt-post > +++ b/scripts/ovirt-post > @@ -2,34 +2,40 @@ > # > # ovirt Start ovirt services > # > -# chkconfig: - 98 02 > -# description: ovirt-post services > -# > +### BEGIN INIT INFO > +# Provides: ovirt-post > +# Required-Start: ovirt > +# Default-Start: 2 3 4 5 > +# Description: Performs managed node post configuration setup. > +### END INIT INFO > > # Source functions library > . /etc/init.d/functions > . /etc/init.d/ovirt-functions > > prog=ovirt-post > -lockfile=/var/lock/subsys/$prog > +VAR_SUBSYS_OVIRT_POST=/var/lock/subsys/$prog > + > +# load the configuration file > +[ -f "$NODE_CONFIG" ]&& . "$NODE_CONFIG" > > start() { > # wait for libvirt to finish initializing > local count=0 > while true; do > - if [ -r /var/run/libvirt/libvirt-sock ]; 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 $lockfile > - > + if [ -r /var/run/libvirt/libvirt-sock ]; 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 > @@ -38,20 +44,20 @@ start() { > cp -f $BACKUP $ISSUE > hwvirt=$(virsh capabilities) > if [[ $hwvirt =~ kvm ]]; then > - log "Hardware virtualization detected" > + 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 > + 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 > cp -f $ISSUE $ISSUE_NET > > @@ -62,18 +68,27 @@ start() { > # 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* > > - # Removed ovirt-identify-node since it has now > - # been replaced with the matahari qmf agent. > + # perform any post startup operations > + case $OVIRT_RUNTIME_MODE in > + esac > + > + rm -f $VAR_SUBSYS_OVIRT_POST > +} > > - rm -f $lockfile > +stop() { > + echo -n "Stopping ovirt-post: " > + success > } > > case "$1" in > start) > - printf "Starting ovirt-post: " > + [ -f "$VAR_SUBSYS_OVIRT_POST" ]&& exit 0 > + echo -n "Starting ovirt-post: " > > { > log "Starting ovirt-post" > looks sane to me and still boots normal so... ACK From dpierce at redhat.com Fri Feb 12 20:29:06 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Fri, 12 Feb 2010 15:29:06 -0500 Subject: [Ovirt-devel] [PATCH] Makes the managed node boot up process more generic. In-Reply-To: <4B75B6A2.7000903@redhat.com> References: <1265839780-17613-1-git-send-email-dpierce@redhat.com> <1265839780-17613-2-git-send-email-dpierce@redhat.com> <4B75B6A2.7000903@redhat.com> Message-ID: <20100212202906.GA18371@mcpierce-desktop.usersys.redhat.com> On Fri, Feb 12, 2010 at 03:14:26PM -0500, Joey Boggs wrote: > looks sane to me and still boots normal so... ACK Thanks. This is now pushed upstream. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dhuff at redhat.com Fri Feb 12 21:48:15 2010 From: dhuff at redhat.com (David Huff) Date: Fri, 12 Feb 2010 16:48:15 -0500 Subject: [Ovirt-devel] [PATCH] Provides a reference implementation management server. In-Reply-To: <1265910730-2150-1-git-send-email-dpierce@redhat.com> References: <1265910730-2150-1-git-send-email-dpierce@redhat.com> Message-ID: <4B75CC9F.6090201@redhat.com> ACK On 02/11/2010 12:52 PM, Darryl L. Pierce wrote: > The reference implementation server is based on TG2. The majority of the > boiler plate code has been stripped out to focus the server solely on > the functionality necessary for a management server. > > Signed-off-by: Darryl L. Pierce > --- > server/.gitignore | 4 + > server/MANIFEST.in | 4 + > server/README.txt | 24 ++ > server/development.ini | 130 ++++++++++ > server/ez_setup/README.txt | 14 ++ > server/ez_setup/__init__.py | 247 ++++++++++++++++++++ > server/ovirtserver/__init__.py | 18 ++ > server/ovirtserver/config/__init__.py | 16 ++ > server/ovirtserver/config/app_cfg.py | 54 +++++ > server/ovirtserver/config/deployment.ini_tmpl | 104 ++++++++ > server/ovirtserver/config/environment.py | 25 ++ > server/ovirtserver/config/middleware.py | 55 +++++ > server/ovirtserver/controllers/__init__.py | 18 ++ > server/ovirtserver/controllers/controller.template | 36 +++ > server/ovirtserver/controllers/error.py | 46 ++++ > server/ovirtserver/controllers/root.py | 55 +++++ > server/ovirtserver/controllers/secure.py | 21 ++ > server/ovirtserver/controllers/template.py | 51 ++++ > .../ovirtserver/i18n/ru/LC_MESSAGES/ovirtserver.po | 24 ++ > server/ovirtserver/lib/__init__.py | 16 ++ > server/ovirtserver/lib/app_globals.py | 33 +++ > server/ovirtserver/lib/base.py | 44 ++++ > server/ovirtserver/lib/helpers.py | 20 ++ > server/ovirtserver/model/__init__.py | 77 ++++++ > server/ovirtserver/model/auth.py | 27 +++ > server/ovirtserver/model/model.template | 37 +++ > server/ovirtserver/public/favicon.ico | Bin 0 -> 1104 bytes > server/ovirtserver/templates/__init__.py | 18 ++ > server/ovirtserver/templates/error.html | 19 ++ > server/ovirtserver/templates/index.html | 20 ++ > server/ovirtserver/tests/__init__.py | 80 +++++++ > server/ovirtserver/tests/functional/__init__.py | 18 ++ > .../tests/functional/test_authentication.py | 16 ++ > server/ovirtserver/tests/functional/test_root.py | 48 ++++ > server/ovirtserver/tests/models/__init__.py | 68 ++++++ > server/ovirtserver/tests/models/test_auth.py | 22 ++ > server/ovirtserver/websetup.py | 42 ++++ > server/server.egg-info/PKG-INFO | 10 + > server/server.egg-info/SOURCES.txt | 68 ++++++ > server/server.egg-info/dependency_links.txt | 1 + > server/server.egg-info/entry_points.txt | 7 + > server/server.egg-info/paster_plugins.txt | 4 + > server/server.egg-info/requires.txt | 6 + > server/server.egg-info/top_level.txt | 1 + > server/setup.cfg | 32 +++ > server/setup.py | 63 +++++ > server/test.ini | 42 ++++ > 47 files changed, 1785 insertions(+), 0 deletions(-) > create mode 100644 server/.gitignore > create mode 100644 server/MANIFEST.in > create mode 100644 server/README.txt > create mode 100644 server/development.ini > create mode 100644 server/ez_setup/README.txt > create mode 100644 server/ez_setup/__init__.py > create mode 100644 server/ovirtserver/__init__.py > create mode 100644 server/ovirtserver/config/__init__.py > create mode 100644 server/ovirtserver/config/app_cfg.py > create mode 100644 server/ovirtserver/config/deployment.ini_tmpl > create mode 100644 server/ovirtserver/config/environment.py > create mode 100644 server/ovirtserver/config/middleware.py > create mode 100644 server/ovirtserver/controllers/__init__.py > create mode 100644 server/ovirtserver/controllers/controller.template > create mode 100644 server/ovirtserver/controllers/error.py > create mode 100644 server/ovirtserver/controllers/root.py > create mode 100644 server/ovirtserver/controllers/secure.py > create mode 100644 server/ovirtserver/controllers/template.py > create mode 100644 server/ovirtserver/i18n/ru/LC_MESSAGES/ovirtserver.po > create mode 100644 server/ovirtserver/lib/__init__.py > create mode 100644 server/ovirtserver/lib/app_globals.py > create mode 100644 server/ovirtserver/lib/base.py > create mode 100644 server/ovirtserver/lib/helpers.py > create mode 100644 server/ovirtserver/model/__init__.py > create mode 100644 server/ovirtserver/model/auth.py > create mode 100644 server/ovirtserver/model/model.template > create mode 100644 server/ovirtserver/public/favicon.ico > create mode 100644 server/ovirtserver/templates/__init__.py > create mode 100644 server/ovirtserver/templates/error.html > create mode 100644 server/ovirtserver/templates/index.html > create mode 100644 server/ovirtserver/tests/__init__.py > create mode 100644 server/ovirtserver/tests/functional/__init__.py > create mode 100644 server/ovirtserver/tests/functional/test_authentication.py > create mode 100644 server/ovirtserver/tests/functional/test_root.py > create mode 100644 server/ovirtserver/tests/models/__init__.py > create mode 100644 server/ovirtserver/tests/models/test_auth.py > create mode 100644 server/ovirtserver/websetup.py > create mode 100644 server/server.egg-info/PKG-INFO > create mode 100644 server/server.egg-info/SOURCES.txt > create mode 100644 server/server.egg-info/dependency_links.txt > create mode 100644 server/server.egg-info/entry_points.txt > create mode 100644 server/server.egg-info/paster_plugins.txt > create mode 100644 server/server.egg-info/requires.txt > create mode 100644 server/server.egg-info/top_level.txt > create mode 100644 server/setup.cfg > create mode 100644 server/setup.py > create mode 100644 server/test.ini > > diff --git a/server/.gitignore b/server/.gitignore > new file mode 100644 > index 0000000..41bf6ae > --- /dev/null > +++ b/server/.gitignore > @@ -0,0 +1,4 @@ > +build/ > +data/ > +dist/ > +devdata.db > diff --git a/server/MANIFEST.in b/server/MANIFEST.in > new file mode 100644 > index 0000000..e9c47eb > --- /dev/null > +++ b/server/MANIFEST.in > @@ -0,0 +1,4 @@ > +recursive-include ovirtserver/public * > +include ovirtserver/public/favicon.ico > +recursive-include ovirtserver/i18n * > +recursive-include ovirtserver/templates * > diff --git a/server/README.txt b/server/README.txt > new file mode 100644 > index 0000000..809ebf3 > --- /dev/null > +++ b/server/README.txt > @@ -0,0 +1,24 @@ > +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. > diff --git a/server/development.ini b/server/development.ini > new file mode 100644 > index 0000000..2295b25 > --- /dev/null > +++ b/server/development.ini > @@ -0,0 +1,130 @@ > +# 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 > +#email_to = you at yourdomain.com > +smtp_server = localhost > +error_email_from = paste at 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 at hostname:port/databasename > +# sqlalchemy.url=mysql://username:password at 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 > diff --git a/server/ez_setup/README.txt b/server/ez_setup/README.txt > new file mode 100644 > index 0000000..77c986d > --- /dev/null > +++ b/server/ez_setup/README.txt > @@ -0,0 +1,14 @@ > +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. > diff --git a/server/ez_setup/__init__.py b/server/ez_setup/__init__.py > new file mode 100644 > index 0000000..8d35412 > --- /dev/null > +++ b/server/ez_setup/__init__.py > @@ -0,0 +1,247 @@ > +#!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:]) > diff --git a/server/ovirtserver/__init__.py b/server/ovirtserver/__init__.py > new file mode 100644 > index 0000000..1d14a09 > --- /dev/null > +++ b/server/ovirtserver/__init__.py > @@ -0,0 +1,18 @@ > +# 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""" > diff --git a/server/ovirtserver/config/__init__.py b/server/ovirtserver/config/__init__.py > new file mode 100644 > index 0000000..90ca87c > --- /dev/null > +++ b/server/ovirtserver/config/__init__.py > @@ -0,0 +1,16 @@ > +# 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. > diff --git a/server/ovirtserver/config/app_cfg.py b/server/ovirtserver/config/app_cfg.py > new file mode 100644 > index 0000000..8882a6b > --- /dev/null > +++ b/server/ovirtserver/config/app_cfg.py > @@ -0,0 +1,54 @@ > +# 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 > diff --git a/server/ovirtserver/config/deployment.ini_tmpl b/server/ovirtserver/config/deployment.ini_tmpl > new file mode 100644 > index 0000000..7b1403c > --- /dev/null > +++ b/server/ovirtserver/config/deployment.ini_tmpl > @@ -0,0 +1,104 @@ > +# 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 > +email_to = you at yourdomain.com > +smtp_server = localhost > +error_email_from = paste at 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 > diff --git a/server/ovirtserver/config/environment.py b/server/ovirtserver/config/environment.py > new file mode 100644 > index 0000000..01b0275 > --- /dev/null > +++ b/server/ovirtserver/config/environment.py > @@ -0,0 +1,25 @@ > +# 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() > diff --git a/server/ovirtserver/config/middleware.py b/server/ovirtserver/config/middleware.py > new file mode 100644 > index 0000000..b5f47da > --- /dev/null > +++ b/server/ovirtserver/config/middleware.py > @@ -0,0 +1,55 @@ > +# 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 > diff --git a/server/ovirtserver/controllers/__init__.py b/server/ovirtserver/controllers/__init__.py > new file mode 100644 > index 0000000..417d5ed > --- /dev/null > +++ b/server/ovirtserver/controllers/__init__.py > @@ -0,0 +1,18 @@ > +# 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.""" > diff --git a/server/ovirtserver/controllers/controller.template b/server/ovirtserver/controllers/controller.template > new file mode 100644 > index 0000000..2de6832 > --- /dev/null > +++ b/server/ovirtserver/controllers/controller.template > @@ -0,0 +1,36 @@ > +# 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') > diff --git a/server/ovirtserver/controllers/error.py b/server/ovirtserver/controllers/error.py > new file mode 100644 > index 0000000..6a14218 > --- /dev/null > +++ b/server/ovirtserver/controllers/error.py > @@ -0,0 +1,46 @@ > +# 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 = ("

We're sorry but we weren't able to process " > + " this request.

") > + 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 > diff --git a/server/ovirtserver/controllers/root.py b/server/ovirtserver/controllers/root.py > new file mode 100644 > index 0000000..cfd682b > --- /dev/null > +++ b/server/ovirtserver/controllers/root.py > @@ -0,0 +1,55 @@ > +# 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') > diff --git a/server/ovirtserver/controllers/secure.py b/server/ovirtserver/controllers/secure.py > new file mode 100644 > index 0000000..adb98f7 > --- /dev/null > +++ b/server/ovirtserver/controllers/secure.py > @@ -0,0 +1,21 @@ > +# 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. > diff --git a/server/ovirtserver/controllers/template.py b/server/ovirtserver/controllers/template.py > new file mode 100644 > index 0000000..77a1fcb > --- /dev/null > +++ b/server/ovirtserver/controllers/template.py > @@ -0,0 +1,51 @@ > +# 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) > diff --git a/server/ovirtserver/i18n/ru/LC_MESSAGES/ovirtserver.po b/server/ovirtserver/i18n/ru/LC_MESSAGES/ovirtserver.po > new file mode 100644 > index 0000000..36532d4 > --- /dev/null > +++ b/server/ovirtserver/i18n/ru/LC_MESSAGES/ovirtserver.po > @@ -0,0 +1,24 @@ > +# Russian translations for ${package}. > +# Copyright (C) 2008 ORGANIZATION > +# This file is distributed under the same license as the ${package} project. > +# FIRST AUTHOR, 2008. > +# > +msgid "" > +msgstr "" > +"Project-Id-Version: ${package} 0.0.0\n" > +"Report-Msgid-Bugs-To: EMAIL at 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\n" > +"Language-Team: ru\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 "???????? ???????????????????? ?????????????? ????????????????" > + > diff --git a/server/ovirtserver/lib/__init__.py b/server/ovirtserver/lib/__init__.py > new file mode 100644 > index 0000000..90ca87c > --- /dev/null > +++ b/server/ovirtserver/lib/__init__.py > @@ -0,0 +1,16 @@ > +# 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. > diff --git a/server/ovirtserver/lib/app_globals.py b/server/ovirtserver/lib/app_globals.py > new file mode 100644 > index 0000000..d5d2abe > --- /dev/null > +++ b/server/ovirtserver/lib/app_globals.py > @@ -0,0 +1,33 @@ > +# 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 > diff --git a/server/ovirtserver/lib/base.py b/server/ovirtserver/lib/base.py > new file mode 100644 > index 0000000..90772cc > --- /dev/null > +++ b/server/ovirtserver/lib/base.py > @@ -0,0 +1,44 @@ > +# 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) > diff --git a/server/ovirtserver/lib/helpers.py b/server/ovirtserver/lib/helpers.py > new file mode 100644 > index 0000000..88cdc0f > --- /dev/null > +++ b/server/ovirtserver/lib/helpers.py > @@ -0,0 +1,20 @@ > +# 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 > diff --git a/server/ovirtserver/model/__init__.py b/server/ovirtserver/model/__init__.py > new file mode 100644 > index 0000000..1b37524 > --- /dev/null > +++ b/server/ovirtserver/model/__init__.py > @@ -0,0 +1,77 @@ > +# 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. > diff --git a/server/ovirtserver/model/auth.py b/server/ovirtserver/model/auth.py > new file mode 100644 > index 0000000..d7ea74b > --- /dev/null > +++ b/server/ovirtserver/model/auth.py > @@ -0,0 +1,27 @@ > +# 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. > + > +""" > diff --git a/server/ovirtserver/model/model.template b/server/ovirtserver/model/model.template > new file mode 100644 > index 0000000..716807e > --- /dev/null > +++ b/server/ovirtserver/model/model.template > @@ -0,0 +1,37 @@ > +# 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) > + > + #} > diff --git a/server/ovirtserver/public/favicon.ico b/server/ovirtserver/public/favicon.ico > new file mode 100644 > index 0000000000000000000000000000000000000000..840986e4705befe9beb4275e2807fd358a362497 > GIT binary patch > literal 1104 > zcmV-W1h4xaiwFP!000000|7Y%#`{M}MmRZP5C9MW=S=`zU0s?(6{e=9adB~piHWPL > ztMKsf)U_xHB8w!DmPpP!#EEiT>N-OZzotgNilw50s}{OQ-t > z^78VNlas>2!U6&U#KgqR%*?*NzOJsW&d$!SbyBdfu%Muz$;rva#>TX?w3(Ti+uPgs > z&04auvZ$!2y1Kf(y}gex2j}PK(9qCSktL!dMnZf at o5 > z^=WBo?eqTG!L-)a*6Ql&*x1;RX;!tCefaqJQBhIy=HN$1M}|Wt-{0TEn}yfO!GVE+ > zq*N-`-RJ-R|LpASW at ct!U|@4WF3Wo@$oPbyO(IuUSF(ar`tX0OW z>F<|!XSIN1g zviJS}+||(e^zxp*oN8=wl81+Zu}tCS?f9;wnx3WY at bUQZ?!Lp!o}#J1u%hAQ=CZcG > z>F at gA;^d5tjqK&(Vr6Ob_W0=R?)?A%)7RUD!9CjD-;a-v= z#J<3 z-FkyVq=s}IHWu^q^ITtJ{rvj-`uXtl_TAs$6B878czF8w_~-BQg^7>j zPEb=_U}Up0E^mi!IyyR%mYwzO>A}IlqoboyQ&+&&w#&=Qrjm-vP)P6Z at 9ysI`}_OK > z%F4jN!2bUJ`uh6f;^M)^&t_Rs > z^3l at O)Y8(|)Y8MYtj4>w=-kzvNgU77)ZyXb;o{@<_4W4l_V at Pn&CShIQ&aBl?dj?1 > z>+9>x$HQV{Wy{OVfpc@~>*{A`XINNRT3TDkzqtPX{d|9grlg}C92_JgBg at duy1Tij > zr=`o!%gmD1y~4r3mYSg<{uM)VWnpw>WFU8GbZ8({Xk{QrNlj1yEC2ui > z01yBW000R70Gl*n*5r*DAr*v}c{5O;!(~W<1i at wwn?xk>911*^&58pDNEBGHl1-Y! > zV+_iHa4-fQI!I$2baBGqn6V%Zf~2u`ViBH2C-SAi8N`^CG-* z&{0)KTF_7}uEuuy4%&c&K2(ToAH > z@#V*fF*aN?4%eiatvSoO&s7n+hMhu}Fm8LSRK7Cxk>S9DHBxp6v > z^#Ky)%NHQGqX60GqJ}YJ6~YCHVxu;3Bfr8`Fy^oVBqLu=oJjP=2&4)cn?$>?=$ot> > WvS0=+x)9A_Kma>NIMN(B1ONa82$stL > > literal 0 > HcmV?d00001 > > diff --git a/server/ovirtserver/templates/__init__.py b/server/ovirtserver/templates/__init__.py > new file mode 100644 > index 0000000..14d408b > --- /dev/null > +++ b/server/ovirtserver/templates/__init__.py > @@ -0,0 +1,18 @@ > +# 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.""" > diff --git a/server/ovirtserver/templates/error.html b/server/ovirtserver/templates/error.html > new file mode 100644 > index 0000000..001f8f4 > --- /dev/null > +++ b/server/ovirtserver/templates/error.html > @@ -0,0 +1,19 @@ > + + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > + + xmlns:py="http://genshi.edgewall.org/" > + xmlns:xi="http://www.w3.org/2001/XInclude"> > + > + > + > + > + > +A ${code} Error has Occurred > + > + > + > +

Error ${code}

> + > +
${XML(message)}
> + > + > diff --git a/server/ovirtserver/templates/index.html b/server/ovirtserver/templates/index.html > new file mode 100644 > index 0000000..1c2496b > --- /dev/null > +++ b/server/ovirtserver/templates/index.html > @@ -0,0 +1,20 @@ > + + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > + + xmlns:py="http://genshi.edgewall.org/" > + xmlns:xi="http://www.w3.org/2001/XInclude"> > + > + > + > +Welcome to the oVirt management server > + > + > + > +

Welcome To The oVirt Server Reference Implementation

> + > +

> + This server provides a reference implementation for how a management server should interact > + with the oVirt managed node. > +

> + > + > diff --git a/server/ovirtserver/tests/__init__.py b/server/ovirtserver/tests/__init__.py > new file mode 100644 > index 0000000..7c1a4a9 > --- /dev/null > +++ b/server/ovirtserver/tests/__init__.py > @@ -0,0 +1,80 @@ > +# 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() > diff --git a/server/ovirtserver/tests/functional/__init__.py b/server/ovirtserver/tests/functional/__init__.py > new file mode 100644 > index 0000000..be0e5fb > --- /dev/null > +++ b/server/ovirtserver/tests/functional/__init__.py > @@ -0,0 +1,18 @@ > +# 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.""" > diff --git a/server/ovirtserver/tests/functional/test_authentication.py b/server/ovirtserver/tests/functional/test_authentication.py > new file mode 100644 > index 0000000..90ca87c > --- /dev/null > +++ b/server/ovirtserver/tests/functional/test_authentication.py > @@ -0,0 +1,16 @@ > +# 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. > diff --git a/server/ovirtserver/tests/functional/test_root.py b/server/ovirtserver/tests/functional/test_root.py > new file mode 100644 > index 0000000..5a7a55e > --- /dev/null > +++ b/server/ovirtserver/tests/functional/test_root.py > @@ -0,0 +1,48 @@ > +# 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!") > diff --git a/server/ovirtserver/tests/models/__init__.py b/server/ovirtserver/tests/models/__init__.py > new file mode 100644 > index 0000000..354b222 > --- /dev/null > +++ b/server/ovirtserver/tests/models/__init__.py > @@ -0,0 +1,68 @@ > +# 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) > diff --git a/server/ovirtserver/tests/models/test_auth.py b/server/ovirtserver/tests/models/test_auth.py > new file mode 100644 > index 0000000..eb0fce0 > --- /dev/null > +++ b/server/ovirtserver/tests/models/test_auth.py > @@ -0,0 +1,22 @@ > +# 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 > diff --git a/server/ovirtserver/websetup.py b/server/ovirtserver/websetup.py > new file mode 100644 > index 0000000..36e3d8c > --- /dev/null > +++ b/server/ovirtserver/websetup.py > @@ -0,0 +1,42 @@ > +# 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" > diff --git a/server/server.egg-info/PKG-INFO b/server/server.egg-info/PKG-INFO > new file mode 100644 > index 0000000..2ad8b9b > --- /dev/null > +++ b/server/server.egg-info/PKG-INFO > @@ -0,0 +1,10 @@ > +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 > diff --git a/server/server.egg-info/SOURCES.txt b/server/server.egg-info/SOURCES.txt > new file mode 100644 > index 0000000..4632e06 > --- /dev/null > +++ b/server/server.egg-info/SOURCES.txt > @@ -0,0 +1,68 @@ > +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 > diff --git a/server/server.egg-info/dependency_links.txt b/server/server.egg-info/dependency_links.txt > new file mode 100644 > index 0000000..8b13789 > --- /dev/null > +++ b/server/server.egg-info/dependency_links.txt > @@ -0,0 +1 @@ > + > diff --git a/server/server.egg-info/entry_points.txt b/server/server.egg-info/entry_points.txt > new file mode 100644 > index 0000000..da62946 > --- /dev/null > +++ b/server/server.egg-info/entry_points.txt > @@ -0,0 +1,7 @@ > + > + [paste.app_factory] > + main = ovirtserver.config.middleware:make_app > + > + [paste.app_install] > + main = pylons.util:PylonsInstaller > + > \ No newline at end of file > diff --git a/server/server.egg-info/paster_plugins.txt b/server/server.egg-info/paster_plugins.txt > new file mode 100644 > index 0000000..ab508e5 > --- /dev/null > +++ b/server/server.egg-info/paster_plugins.txt > @@ -0,0 +1,4 @@ > +PasteScript > +Pylons > +TurboGears2 > +tg.devtools > diff --git a/server/server.egg-info/requires.txt b/server/server.egg-info/requires.txt > new file mode 100644 > index 0000000..661a57b > --- /dev/null > +++ b/server/server.egg-info/requires.txt > @@ -0,0 +1,6 @@ > +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 > diff --git a/server/server.egg-info/top_level.txt b/server/server.egg-info/top_level.txt > new file mode 100644 > index 0000000..4e4dbeb > --- /dev/null > +++ b/server/server.egg-info/top_level.txt > @@ -0,0 +1 @@ > +ovirtserver > diff --git a/server/setup.cfg b/server/setup.cfg > new file mode 100644 > index 0000000..cb01cf9 > --- /dev/null > +++ b/server/setup.cfg > @@ -0,0 +1,32 @@ > +[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 > diff --git a/server/setup.py b/server/setup.py > new file mode 100644 > index 0000000..bf646ad > --- /dev/null > +++ b/server/setup.py > @@ -0,0 +1,63 @@ > +# 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 > + """, > +) > diff --git a/server/test.ini b/server/test.ini > new file mode 100644 > index 0000000..415fcb0 > --- /dev/null > +++ b/server/test.ini > @@ -0,0 +1,42 @@ > +# 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 > +# email_to = you at yourdomain.com > +smtp_server = localhost > +error_email_from = paste at 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. > > > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel From dpierce at redhat.com Fri Feb 12 22:04:32 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Fri, 12 Feb 2010 17:04:32 -0500 Subject: [Ovirt-devel] [PATCH] Provides a reference implementation management server. In-Reply-To: <4B75CC9F.6090201@redhat.com> References: <1265910730-2150-1-git-send-email-dpierce@redhat.com> <4B75CC9F.6090201@redhat.com> Message-ID: <20100212220432.GB18371@mcpierce-desktop.usersys.redhat.com> On Fri, Feb 12, 2010 at 04:48:15PM -0500, David Huff wrote: > ACK Thanks. This is pushed upstream now. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dhuff at redhat.com Fri Feb 12 22:16:25 2010 From: dhuff at redhat.com (David Huff) Date: Fri, 12 Feb 2010 17:16:25 -0500 Subject: [Ovirt-devel] Fwd: Package: ovirt-node-1.9.0-0.fc12 Tag: dist-f12-updates-candidate Status: complete Built by: huff Message-ID: <4B75D339.7050205@redhat.com> -------- Original Message -------- Subject: Package: ovirt-node-1.9.0-0.fc12 Tag: dist-f12-updates-candidate Status: complete Built by: huff Date: Fri, 12 Feb 2010 22:20:01 +0000 (UTC) From: Koji Build System To: jkeating at fedoraproject.org, alagunambi at fedoraproject.org, huff at fedoraproject.org Package: ovirt-node-1.9.0-0.fc12 Tag: dist-f12-updates-candidate Status: complete Built by: huff ID: 155876 Started: Fri, 12 Feb 2010 22:17:13 UTC Finished: Fri, 12 Feb 2010 22:19:35 UTC Changelog: * Fri Feb 12 2010 David Huff - 1.9.0 - New build * Wed Oct 07 2009 David Huff - 1.0.3-4 - Added ovirt-node-tools subpackage * Tue Jun 23 2009 David Huff - 1.0.3 - Clean up spec for inclusion in Fedora - Removed subpackages, stateful, stateless, logos, and selinux SRPMS: ovirt-node-1.9.0-0.fc12.src.rpm Closed tasks: ------------- Task 1981077 on x86-04.phx2.fedoraproject.org Task Type: buildArch (ovirt-node-1.9.0-0.fc12.src.rpm, x86_64) logs: http://koji.fedoraproject.org/koji/getfile?taskID=1981077&name=build.log http://koji.fedoraproject.org/koji/getfile?taskID=1981077&name=root.log http://koji.fedoraproject.org/koji/getfile?taskID=1981077&name=state.log rpms: http://kojipkgs.fedoraproject.org/packages/ovirt-node/1.9.0/0.fc12/x86_64/ovirt-node-1.9.0-0.fc12.x86_64.rpm http://kojipkgs.fedoraproject.org/packages/ovirt-node/1.9.0/0.fc12/x86_64/ovirt-node-debuginfo-1.9.0-0.fc12.x86_64.rpm http://kojipkgs.fedoraproject.org/packages/ovirt-node/1.9.0/0.fc12/x86_64/ovirt-node-tools-1.9.0-0.fc12.noarch.rpm Task 1981073 on xb-01.phx2.fedoraproject.org Task Type: buildSRPMFromSCM (/cvs/pkgs:rpms/ovirt-node/F-12:ovirt-node-1_9_0-0_fc12) logs: http://koji.fedoraproject.org/koji/getfile?taskID=1981073&name=build.log http://koji.fedoraproject.org/koji/getfile?taskID=1981073&name=checkout.log http://koji.fedoraproject.org/koji/getfile?taskID=1981073&name=root.log http://koji.fedoraproject.org/koji/getfile?taskID=1981073&name=state.log Task 1981086 on ppc07.phx2.fedoraproject.org Task Type: tagBuild (noarch) Task 1981078 on x86-05.phx2.fedoraproject.org Task Type: buildArch (ovirt-node-1.9.0-0.fc12.src.rpm, i686) logs: http://koji.fedoraproject.org/koji/getfile?taskID=1981078&name=build.log http://koji.fedoraproject.org/koji/getfile?taskID=1981078&name=root.log http://koji.fedoraproject.org/koji/getfile?taskID=1981078&name=state.log rpms: http://kojipkgs.fedoraproject.org/packages/ovirt-node/1.9.0/0.fc12/i686/ovirt-node-1.9.0-0.fc12.i686.rpm http://kojipkgs.fedoraproject.org/packages/ovirt-node/1.9.0/0.fc12/i686/ovirt-node-debuginfo-1.9.0-0.fc12.i686.rpm http://kojipkgs.fedoraproject.org/packages/ovirt-node/1.9.0/0.fc12/i686/ovirt-node-tools-1.9.0-0.fc12.noarch.rpm Task Info: http://koji.fedoraproject.org/koji/taskinfo?taskID=1981071 Build Info: http://koji.fedoraproject.org/koji/buildinfo?buildID=155876 From dhuff at redhat.com Fri Feb 12 22:18:58 2010 From: dhuff at redhat.com (David Huff) Date: Fri, 12 Feb 2010 17:18:58 -0500 Subject: [Ovirt-devel] Fwd: [Fedora Update] [new] ovirt-node-1.9.0-0.fc12 Message-ID: <4B75D3D2.9050309@redhat.com> -------- Original Message -------- Subject: [Fedora Update] [new] ovirt-node-1.9.0-0.fc12 Date: Fri, 12 Feb 2010 22:22:57 +0000 From: updates at fedoraproject.org To: huff at redhat.com huff has submitted a new update for Fedora 12 ================================================================================ ovirt-node-1.9.0-0.fc12 ================================================================================ Release: Fedora 12 Status: pending Type: enhancement Karma: 0 Notes: * Wed Feb 12 2010 David Huff - 1.9.0 - New : build Submitter: huff Submitted: 2010-02-12 22:22:57 http://admin.fedoraproject.org/updates/ovirt-node-1.9.0-0.fc12?_csrf_token=3bcae9b38732ee576eaae4b7afe32ffbc828090c From damon at damtek.com Fri Feb 12 22:28:16 2010 From: damon at damtek.com (Damon L. Chesser) Date: Fri, 12 Feb 2010 17:28:16 -0500 Subject: [Ovirt-devel] Speak to Atlanta Linux Enthusiasts Message-ID: <1266013696.5681.1.camel@dam-mobile.gateway.2wire.net> Any of you live in the Atlanta area and willing to put on a demo or a presentation on ovirt to a bunch of Linux enthusiasts? -- Damon damon at damtek.com From mloiseleur at linagora.com Tue Feb 16 15:05:22 2010 From: mloiseleur at linagora.com (Loiseleur Michel) Date: Tue, 16 Feb 2010 16:05:22 +0100 Subject: [Ovirt-devel] [PATCH] Increase timeout for live migration Message-ID: <1266332722-4414-1-git-send-email-mloiseleur@linagora.com> Live migration is an operation which can takes times, like 2 or 3 minutes for heavy vms. Fixing this timeout work around another bug of db-o-matic: the infinite loop where node A has a defined & stopped vm X and node B has a defined & running vm X. I encountered this bug because the live migration has hit the timeout limit. Signed-off-by: Loiseleur Michel --- src/task-omatic/taskomatic.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb index be244c9..c0a56b8 100755 --- a/src/task-omatic/taskomatic.rb +++ b/src/task-omatic/taskomatic.rb @@ -548,7 +548,7 @@ class TaskOmatic dest_uri = "qemu+tcp://" + dest_node.hostname + "/system" @logger.debug("Migrating from #{src_uri} to #{dest_uri}") - result = vm.migrate(dest_uri, Libvirt::Domain::MIGRATE_LIVE, '', '', 0, :timeout => 60 * 10) + result = vm.migrate(dest_uri, Libvirt::Domain::MIGRATE_LIVE, '', '', 0, :timeout => 60 * 50) @logger.error "Error migrating VM: #{result.text}" unless result.status == 0 # undefine can fail, for instance, if we live migrated from A -> B, and -- 1.6.6.1 From jboggs at redhat.com Tue Feb 16 21:14:41 2010 From: jboggs at redhat.com (Joey Boggs) Date: Tue, 16 Feb 2010 16:14:41 -0500 Subject: [Ovirt-devel] [PATCH node] remove secondary gpt header and create drive wiping function Message-ID: <1266354881-20129-1-git-send-email-jboggs@redhat.com> --- scripts/ovirt-config-storage | 6 ++---- scripts/ovirt-config-uninstall | 1 + scripts/ovirt-functions | 11 +++++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index 9c3f773..f4f7e1e 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -415,8 +415,7 @@ perform_partitioning() if [ "$OVIRT_ISCSI_ENABLED" == "y" ]; then log "Partitioning drive: $BOOTDRIVE" - log "Wiping old boot sector" - dd if=/dev/zero of=$BOOTDRIVE bs=1024K count=1 + wipe_partitions $BOOTDRIVE blockdev --rereadpt $BOOTDRIVE partprobe -s $BOOTDRIVE log "Creating boot partition" @@ -434,8 +433,7 @@ perform_partitioning() log "Starting partitioning of $ROOTDRIVE" log "Partitioning drive: $ROOTDRIVE" # FIXME: save a backup copy, just in case? - log "Wiping old boot sector" - dd if=/dev/zero of=$ROOTDRIVE bs=1024K count=1 + wipe_partitions $ROOTDRIVE blockdev --rereadpt $ROOTDRIVE partprobe -s $ROOTDRIVE log "Labeling Drive: $ROOTDRIVE" diff --git a/scripts/ovirt-config-uninstall b/scripts/ovirt-config-uninstall index 820eead..f79d31c 100755 --- a/scripts/ovirt-config-uninstall +++ b/scripts/ovirt-config-uninstall @@ -41,6 +41,7 @@ if ask_yes_or_no "Do you wish to continue and uninstall this node ([Y]es/[N]o)?" parted -s $drive "rm 1" parted -s $drive "rm 2" parted -s $drive "rm 3" + wipe_partitions $drive fi printf "Finished uninstalling node." else diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index fae13e7..3959e85 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -745,6 +745,17 @@ test_ntp_configuration () { service ntpd start } +# Cleans partition tables +wipe_partitions() { + 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 +} + # execute a function if called as a script, e.g. # ovirt-functions ovirt_store_config /etc/hosts -- 1.6.6 From jboggs at redhat.com Tue Feb 16 21:24:58 2010 From: jboggs at redhat.com (Joey Boggs) Date: Tue, 16 Feb 2010 16:24:58 -0500 Subject: [Ovirt-devel] [PATCH node] Save configuration defaults during uninstallation Message-ID: <1266355499-21018-1-git-send-email-jboggs@redhat.com> For use during reinstallation. --- scripts/ovirt-config-uninstall | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/scripts/ovirt-config-uninstall b/scripts/ovirt-config-uninstall index f79d31c..7c05258 100755 --- a/scripts/ovirt-config-uninstall +++ b/scripts/ovirt-config-uninstall @@ -32,6 +32,7 @@ if ask_yes_or_no "Do you wish to continue and uninstall this node ([Y]es/[N]o)?" log "Uninstalling node" log "Detaching logging" unmount_logging + unmount_config /etc/default/ovirt log "Removing volume group" wipe_volume_group "HostVG" partition=$(findfs LABEL=Root) -- 1.6.6 From jboggs at redhat.com Tue Feb 16 21:24:59 2010 From: jboggs at redhat.com (Joey Boggs) Date: Tue, 16 Feb 2010 16:24:59 -0500 Subject: [Ovirt-devel] [PATCH node] store configuration defaults In-Reply-To: <1266355499-21018-1-git-send-email-jboggs@redhat.com> References: <1266355499-21018-1-git-send-email-jboggs@redhat.com> Message-ID: <1266355499-21018-2-git-send-email-jboggs@redhat.com> Store configuration defaults on a automated install --- scripts/ovirt-firstboot | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/scripts/ovirt-firstboot b/scripts/ovirt-firstboot index b992909..288c133 100755 --- a/scripts/ovirt-firstboot +++ b/scripts/ovirt-firstboot @@ -58,6 +58,7 @@ start () mount_live ovirt-config-boot /live "$OVIRT_BOOTPARAMS" no disable_firstboot + ovirt_store_firstboot_config reboot return fi -- 1.6.6 From sdcc2 at theaudiobible.org Wed Feb 17 14:57:45 2010 From: sdcc2 at theaudiobible.org (Steven Patrick) Date: Wed, 17 Feb 2010 22:57:45 +0800 Subject: [Ovirt-devel] edit-livecd Message-ID: <4B7C03E9.1050001@theaudiobible.org> Greetings, I made a Fedora AOS livecd ISO image using fedora-aos.ks (from fedora-kickstarts-0.12.1-1.fc12.noarch) and livecd-tools-031-1.fc12.1.i686. This boots fine with qemu and directly from CD. I used the script from http://lists.fedoraproject.org/pipermail/livecd/attachments/20090922/85647312/attachment.py to edit the ISO image, and, even if I make no changes, I get the following error when booting the edited image: No root device found Boot has failed, sleeping forever. Could you please give me some idea on how to trace the cause of this problem? Many thanks, Steven From dhuff at redhat.com Wed Feb 17 16:46:51 2010 From: dhuff at redhat.com (David Huff) Date: Wed, 17 Feb 2010 11:46:51 -0500 Subject: [Ovirt-devel] edit-livecd In-Reply-To: <4B7C03E9.1050001@theaudiobible.org> References: <4B7C03E9.1050001@theaudiobible.org> Message-ID: <4B7C1D7B.700@redhat.com> On 02/17/2010 09:57 AM, Steven Patrick wrote: > Greetings, > > I made a Fedora AOS livecd ISO image using fedora-aos.ks (from fedora-kickstarts-0.12.1-1.fc12.noarch) and livecd-tools-031-1.fc12.1.i686. > > This boots fine with qemu and directly from CD. > > I used the script from http://lists.fedoraproject.org/pipermail/livecd/attachments/20090922/85647312/attachment.py to edit the ISO image, and, even if I make no changes, I get the following error when booting the edited image: > > No root device found > > Boot has failed, sleeping forever. > > Could you please give me some idea on how to trace the cause of this problem? > > Many thanks, > Steven Steven, thanks for reporting this. It looks like there is a minor bug in the way it stores the image label. I'll figure out whats going on and post a patch soon. Also are you still seeing the size increase? I ran a couple tests this morning and I am still seeing a moderate size increase on some tests. -D From dpierce at redhat.com Wed Feb 17 22:20:11 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 17 Feb 2010 17:20:11 -0500 Subject: [Ovirt-devel] [PATCH] Provides the new node lifecycle events. Message-ID: <1266445211-22678-1-git-send-email-dpierce@redhat.com> Replaced the TurboGears 2 reference implementation with a simpler Django server. This implementation has worked out the server interface for an HTTP awake and config request. Started working on this ready portion, but nothing is ready yet. THIS IS A WORK IN PROGRESS: This patch is solely meant to solicit feedback. Please reply with suggestions and improvement ideas. Thanks. :) Signed-off-by: Darryl L. Pierce --- Makefile.am | 15 ++- management/awake | 109 +++++++++ management/config | 128 ++++++++++ management/node-config | 28 +++ ovirt-node.spec.in | 2 - scripts/node-config | 15 -- scripts/ovirt | 2 +- scripts/ovirt-awake | 7 +- scripts/ovirt-early | 8 +- scripts/ovirt-functions | 2 + scripts/ovirt-post | 2 +- server/.gitignore | 4 - server/MANIFEST.in | 4 - server/README | 5 + server/README.txt | 24 -- server/development.ini | 130 ---------- server/ez_setup/README.txt | 14 -- server/ez_setup/__init__.py | 247 -------------------- server/ovirtserver/__init__.py | 18 -- server/ovirtserver/config/__init__.py | 16 -- server/ovirtserver/config/app_cfg.py | 54 ----- server/ovirtserver/config/deployment.ini_tmpl | 104 -------- server/ovirtserver/config/environment.py | 25 -- server/ovirtserver/config/middleware.py | 55 ----- server/ovirtserver/controllers/__init__.py | 18 -- server/ovirtserver/controllers/controller.template | 36 --- server/ovirtserver/controllers/error.py | 46 ---- server/ovirtserver/controllers/root.py | 55 ----- server/ovirtserver/controllers/secure.py | 21 -- server/ovirtserver/controllers/template.py | 51 ---- .../ovirtserver/i18n/ru/LC_MESSAGES/ovirtserver.po | 23 -- server/ovirtserver/initservice/models.py | 17 ++ server/ovirtserver/initservice/tests.py | 23 ++ server/ovirtserver/initservice/urls.py | 16 ++ server/ovirtserver/initservice/views.py | 116 +++++++++ server/ovirtserver/lib/__init__.py | 16 -- server/ovirtserver/lib/app_globals.py | 33 --- server/ovirtserver/lib/base.py | 44 ---- server/ovirtserver/lib/helpers.py | 20 -- server/ovirtserver/manage.py | 11 + server/ovirtserver/model/__init__.py | 77 ------ server/ovirtserver/model/auth.py | 27 --- server/ovirtserver/model/model.template | 37 --- server/ovirtserver/public/favicon.ico | Bin 1104 -> 0 bytes server/ovirtserver/settings.py | 81 +++++++ server/ovirtserver/templates/__init__.py | 18 -- server/ovirtserver/templates/error.html | 19 -- server/ovirtserver/templates/index.html | 20 -- server/ovirtserver/tests/__init__.py | 80 ------- server/ovirtserver/tests/functional/__init__.py | 18 -- .../tests/functional/test_authentication.py | 16 -- server/ovirtserver/tests/functional/test_root.py | 48 ---- server/ovirtserver/tests/models/__init__.py | 68 ------ server/ovirtserver/tests/models/test_auth.py | 22 -- server/ovirtserver/urls.py | 10 + server/ovirtserver/websetup.py | 42 ---- server/server.egg-info/PKG-INFO | 10 - server/server.egg-info/SOURCES.txt | 68 ------ server/server.egg-info/entry_points.txt | 6 - server/server.egg-info/paster_plugins.txt | 4 - server/server.egg-info/requires.txt | 6 - server/server.egg-info/top_level.txt | 1 - server/setup.cfg | 32 --- server/setup.py | 63 ----- server/test.ini | 42 ---- 65 files changed, 569 insertions(+), 1810 deletions(-) create mode 100755 management/awake create mode 100755 management/config create mode 100644 management/node-config create mode 100644 management/offline create mode 100644 management/ready delete mode 100644 scripts/node-config delete mode 100644 server/.gitignore delete mode 100644 server/MANIFEST.in create mode 100644 server/README delete mode 100644 server/README.txt delete mode 100644 server/development.ini delete mode 100644 server/ez_setup/README.txt delete mode 100644 server/ez_setup/__init__.py mode change 100644 => 100755 server/ovirtserver/__init__.py delete mode 100644 server/ovirtserver/config/__init__.py delete mode 100644 server/ovirtserver/config/app_cfg.py delete mode 100644 server/ovirtserver/config/deployment.ini_tmpl delete mode 100644 server/ovirtserver/config/environment.py delete mode 100644 server/ovirtserver/config/middleware.py delete mode 100644 server/ovirtserver/controllers/__init__.py delete mode 100644 server/ovirtserver/controllers/controller.template delete mode 100644 server/ovirtserver/controllers/error.py delete mode 100644 server/ovirtserver/controllers/root.py delete mode 100644 server/ovirtserver/controllers/secure.py delete mode 100644 server/ovirtserver/controllers/template.py delete mode 100644 server/ovirtserver/i18n/ru/LC_MESSAGES/ovirtserver.po create mode 100755 server/ovirtserver/initservice/__init__.py create mode 100755 server/ovirtserver/initservice/models.py create mode 100755 server/ovirtserver/initservice/tests.py create mode 100755 server/ovirtserver/initservice/urls.py create mode 100755 server/ovirtserver/initservice/views.py delete mode 100644 server/ovirtserver/lib/__init__.py delete mode 100644 server/ovirtserver/lib/app_globals.py delete mode 100644 server/ovirtserver/lib/base.py delete mode 100644 server/ovirtserver/lib/helpers.py create mode 100755 server/ovirtserver/manage.py delete mode 100644 server/ovirtserver/model/__init__.py delete mode 100644 server/ovirtserver/model/auth.py delete mode 100644 server/ovirtserver/model/model.template delete mode 100644 server/ovirtserver/public/favicon.ico create mode 100755 server/ovirtserver/settings.py delete mode 100644 server/ovirtserver/templates/__init__.py delete mode 100644 server/ovirtserver/templates/error.html delete mode 100644 server/ovirtserver/templates/index.html delete mode 100644 server/ovirtserver/tests/__init__.py delete mode 100644 server/ovirtserver/tests/functional/__init__.py delete mode 100644 server/ovirtserver/tests/functional/test_authentication.py delete mode 100644 server/ovirtserver/tests/functional/test_root.py delete mode 100644 server/ovirtserver/tests/models/__init__.py delete mode 100644 server/ovirtserver/tests/models/test_auth.py create mode 100755 server/ovirtserver/urls.py delete mode 100644 server/ovirtserver/websetup.py delete mode 100644 server/server.egg-info/PKG-INFO delete mode 100644 server/server.egg-info/SOURCES.txt delete mode 100644 server/server.egg-info/dependency_links.txt delete mode 100644 server/server.egg-info/entry_points.txt delete mode 100644 server/server.egg-info/paster_plugins.txt delete mode 100644 server/server.egg-info/requires.txt delete mode 100644 server/server.egg-info/top_level.txt delete mode 100644 server/setup.cfg delete mode 100644 server/setup.py delete mode 100644 server/test.ini diff --git a/Makefile.am b/Makefile.am index 7798d09..aa6e360 100644 --- a/Makefile.am +++ b/Makefile.am @@ -68,8 +68,21 @@ EXTRA_DIST = \ nodeadmin/userworker.py \ nodeadmin/utils.py \ nodeadmin/volumeconfig.py \ + management/awake \ + management/config \ + management/ready \ + management/offline \ + management/node-config \ + server/README \ + server/ovirtserver/initservice/__init__.py \ + server/ovirtserver/initservice/models.py \ + server/ovirtserver/initservice/tests.py \ + server/ovirtserver/initservice/urls.py \ + server/ovirtserver/initservice/views.py \ + server/ovirtserver/manage.py \ + server/ovirtserver/settings.py \ + server/ovirtserver/urls.py \ scripts/collectd.conf.in \ - scripts/node-config \ scripts/ovirt \ scripts/ovirt-awake \ scripts/ovirt-config-boot \ diff --git a/management/awake b/management/awake new file mode 100755 index 0000000..3761ec1 --- /dev/null +++ b/management/awake @@ -0,0 +1,109 @@ +#!/bin/bash +# +# Notifies the management server that the node is coming online. + +ME=$(basename "$0") +WORKDIR=$(mktemp -d) + +. /etc/init.d/ovirt-functions + +[ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" + +warn() { printf '%s: %s\n' "$ME" "$*" >&2; } +die() { warn "$*"; exit 1; } +verbose() { if $verbose; then printf "%s\n" "$*"; fi } +debug() { if $debugging; then printf "[DEBUG] %s\n" "$*"; fi } + +trap '__st=$?; cleanup; exit $__st' 1 2 3 13 15 +trap 'cleanup' 0 + +cleanup () { + if ! $preserve; then + debug "Cleaning up" + rm -rf $WORKDIR + fi +} + +hostname=$(hostname) + +servername="" +serverport="" +identifier=$hostname +verbose=false +debugging=false +preserve=false +keytab_file=$NODE_KEYTAB_FILE +awake_endpoint=$NODE_AWAKE_ENDPOINT + +usage () { +cat < $awake_content +node: + identifier: $identifier +EOF + +debug "WORKDIR=$WORKDIR" +debug "preserve=$preserve" +debug "server_url=$server_url" + +debug "Notifying $servername:$serverport that $hostname is awake." + +# get the url for the keytab file +debug "Writing server response to: ${tmpfile}" + +if ! $verbose; then QUIET_ARG="-q"; fi + +wget --output-document="$tmpfile" $QUIET_ARG \ + --no-check-certificate "${server_url}" \ + --post-data="content=\"$(base64 ${awake_content})\"" + +if [ -f $tmpfile ]; then + debug "Extracting the server response from $tmpfile" + keytab_encoded=$(grep "^KEYTAB " $tmpfile|awk '{print $2}') + if [ -n "$keytab_encoded" ]; then + debug "Downloading keytab file from: ${keytab_encoded}" + debug " Decoding keytab file to: ${keytab_file}" + echo $keytab_encoded | base64 -d > $keytab_file + else + die "Missing keytab data in the server response." + fi +else + die "Missing response from the server." +fi diff --git a/management/config b/management/config new file mode 100755 index 0000000..486faf7 --- /dev/null +++ b/management/config @@ -0,0 +1,128 @@ +#!/bin/bash +# +# Contacts the management server and submits the list of +# network interfaces detected on the node. +# +# It then retrieves the configuration for the node, applies +# it and then restarts the networking service. + +ME=$(basename "$0") +WORKDIR=$(mktemp -d) + +. /etc/init.d/ovirt-functions + +[ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" +[ -f "$OVIRT_DEFAULTS" ] && . "$OVIRT_DEFAULTS" + +warn() { printf '%s: %s\n' "$ME" "$*" >&2; } +die() { warn "$*"; exit 1; } +verbose() { if $verbose; then printf "%s\n" "$*"; fi } +debug() { if $debugging; then printf "[DEBUG] %s\n" "$*"; fi } + +trap '__st=$?; cleanup; exit $__st' 1 2 3 13 15 +trap 'cleanup' 0 + +cleanup () { + if ! $preserve; then + debug "Cleaning up" + rm -rf $WORKDIR + fi +} + +usage () { + cat < $config_content +node: + identifier: $identifier + + nics: +EOF + +for udi in $(hal-find-by-capability --capability net.80203); do + name=$(hal-get-property --udi $udi --key net.interface) + address=$(hal-get-property --udi $udi --key net.address) + management=false + + # set this to true if this is the management interface + if [[ $NODE_MANAGEMENT_NIC == "$address" ]]; then + management=true + fi + + cat <> $config_content + - name: $name + address: $address + management: $management +EOF +done + +if ! $verbose; then + QUIET_ARG="-q" +fi + +# submit the config content to the server +wget --output-document="$tmpfile" $QUIET_ARG \ + --no-check-certificate "${server_url}" \ + --post-data="content=\"$(base64 ${config_content})\"" + +debug "response: $?" + +# if we have content, then parse it to create the augeas +# input files and then restart the config service +if [ -f "$tmpfile" ]; then + base64 -d $tmpfile > $decoded + # TODO write a yaml config processor +fi \ No newline at end of file diff --git a/management/node-config b/management/node-config new file mode 100644 index 0000000..874976d --- /dev/null +++ b/management/node-config @@ -0,0 +1,28 @@ +# 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 +NODE_RUNTIME_MODE="none" + +# the management server hostname or address +NODE_MANAGEMENT_SERVER="" + +# the management server port +NODE_MANAGEMENT_PORT="" + +# the management server awake endpoint +NODE_AWAKE_ENDPOINT="/awake" + +# the management server configuration endpoint +NODE_CONFIG_ENDPOINT="/config" + +# The location for the node's keytab file. +NODE_KEYTAB_FILE="/etc/krb5.tab" + +# Specifies the mac address for the node +# management network interface +NODE_MANAGEMENT_NIC=00:11:22:33:44:55 diff --git a/management/offline b/management/offline new file mode 100644 index 0000000..e69de29 diff --git a/management/ready b/management/ready new file mode 100644 index 0000000..e69de29 diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in index 3d8d100..952a49d 100644 --- a/ovirt-node.spec.in +++ b/ovirt-node.spec.in @@ -97,7 +97,6 @@ make install DESTDIR=%{buildroot} %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/logrotate.d %{__install} -d -m0755 %{buildroot}%{python_sitelib}/nodeadmin -%{__install} -p -m0644 scripts/node-config %{buildroot}%{_sysconfdir}/sysconfig %{__install} -p -m0755 scripts/ovirt-config-boot %{buildroot}%{_sbindir} %{__install} -p -m0755 scripts/ovirt-config-boot-wrapper %{buildroot}%{_sbindir} %{__install} -p -m0755 scripts/ovirt-config-collectd %{buildroot}%{_sbindir} @@ -280,7 +279,6 @@ fi %{_sysconfdir}/ovirt-config-boot.d %{_sysconfdir}/ovirt-config-setup.d %config(noreplace) %{_sysconfdir}/collectd.conf.in -%config(noreplace) %{_sysconfdir}/sysconfig/node-config %doc COPYING # should be ifarch i386 diff --git a/scripts/node-config b/scripts/node-config deleted file mode 100644 index 47d42a1..0000000 --- a/scripts/node-config +++ /dev/null @@ -1,15 +0,0 @@ -# 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="" \ No newline at end of file diff --git a/scripts/ovirt b/scripts/ovirt index d8d52cc..eee827c 100755 --- a/scripts/ovirt +++ b/scripts/ovirt @@ -87,7 +87,7 @@ ovirt_start() { start() { touch $VAR_SUBSYS_OVIRT - case $OVIRT_RUNTIME_MODE in + case $NODE_RUNTIME_MODE in "ovirt") ovirt_start ;; diff --git a/scripts/ovirt-awake b/scripts/ovirt-awake index 55db140..938670a 100755 --- a/scripts/ovirt-awake +++ b/scripts/ovirt-awake @@ -33,7 +33,6 @@ . /etc/init.d/ovirt-functions prog=ovirt-early -NODE_CONFIG=/etc/sysconfig/node-config VAR_SUBSYS_NODECONFIG=/var/lock/subsys/node-config # load the configuration file @@ -57,8 +56,8 @@ error () { } ovirt_startup () { - local mgmthost=${OVIRT_MANAGEMENT_SERVER} - local mgmtport=${OVIRT_MANAGEMENT_PORT} + local mgmthost=${NODE_MANAGEMENT_SERVER} + local mgmtport=${NODE_MANAGEMENT_PORT} if [[ -z "${mgmthost}" ]] || [[ -z "${mgmtport}" ]]; then find_srv identify tcp @@ -109,7 +108,7 @@ start () { touch $VAR_SUBSYS_NODECONFIG # log "Starting ovirt-awake." - case "$OVIRT_RUNTIME_MODE" in + case "$NODE_RUNTIME_MODE" in "none") log "Node is operating in unmanaged mode." ;; diff --git a/scripts/ovirt-early b/scripts/ovirt-early index 23c4f6e..2db0e76 100755 --- a/scripts/ovirt-early +++ b/scripts/ovirt-early @@ -143,7 +143,7 @@ find_disk() { configure_management_interface() { log "Configuring the manangement interface." - case $OVIRT_RUNTIME_MODE in + case $NODE_RUNTIME_MODE in "ovirt") configure_ovirt_management_nic $bootif if [ -n "$init" ]; then @@ -160,9 +160,9 @@ configure_management_interface() { 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 + if [ -x $MANAGEMENT_SCRIPTS_DIR/networking ]; then + log "Executing $MANAGEMENT_SCRIPTS_DIR/networking" + $MANAGEMENT_SCRIPTS_DIR/networking else echo "No script to configure management interface found." fi diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index ff2b016..6ad9a56 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -8,6 +8,8 @@ _log_status=1 OVIRT_LABEL=OVIRT # configuration defaults OVIRT_DEFAULTS=/etc/default/ovirt +# global configuration file +NODE_CONFIG=/etc/sysconfig/node-config if [ -f $OVIRT_DEFAULTS ]; then . $OVIRT_DEFAULTS fi diff --git a/scripts/ovirt-post b/scripts/ovirt-post index 951d108..da8557c 100755 --- a/scripts/ovirt-post +++ b/scripts/ovirt-post @@ -74,7 +74,7 @@ start() { /etc/ssh/ssh_host*_key* # perform any post startup operations - case $OVIRT_RUNTIME_MODE in + case $NODE_RUNTIME_MODE in esac rm -f $VAR_SUBSYS_OVIRT_POST diff --git a/server/.gitignore b/server/.gitignore deleted file mode 100644 index 41bf6ae..0000000 --- a/server/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -build/ -data/ -dist/ -devdata.db diff --git a/server/MANIFEST.in b/server/MANIFEST.in deleted file mode 100644 index e9c47eb..0000000 --- a/server/MANIFEST.in +++ /dev/null @@ -1,4 +0,0 @@ -recursive-include ovirtserver/public * -include ovirtserver/public/favicon.ico -recursive-include ovirtserver/i18n * -recursive-include ovirtserver/templates * diff --git a/server/README b/server/README new file mode 100644 index 0000000..48eef4b --- /dev/null +++ b/server/README @@ -0,0 +1,5 @@ +To run the reference implementation management server, do the follow + +1. Go into the ovirtserver directory. +2. Create the database: ./manage.py syncdb +3. Start the management server: ./manage.py runserver diff --git a/server/README.txt b/server/README.txt deleted file mode 100644 index 809ebf3..0000000 --- a/server/README.txt +++ /dev/null @@ -1,24 +0,0 @@ -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. diff --git a/server/development.ini b/server/development.ini deleted file mode 100644 index 2295b25..0000000 --- a/server/development.ini +++ /dev/null @@ -1,130 +0,0 @@ -# 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 -#email_to = you at yourdomain.com -smtp_server = localhost -error_email_from = paste at 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 at hostname:port/databasename -# sqlalchemy.url=mysql://username:password at 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 diff --git a/server/ez_setup/README.txt b/server/ez_setup/README.txt deleted file mode 100644 index 77c986d..0000000 --- a/server/ez_setup/README.txt +++ /dev/null @@ -1,14 +0,0 @@ -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. diff --git a/server/ez_setup/__init__.py b/server/ez_setup/__init__.py deleted file mode 100644 index 8d35412..0000000 --- a/server/ez_setup/__init__.py +++ /dev/null @@ -1,247 +0,0 @@ -#!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:]) diff --git a/server/ovirtserver/__init__.py b/server/ovirtserver/__init__.py old mode 100644 new mode 100755 index 1d14a09..e69de29 --- a/server/ovirtserver/__init__.py +++ b/server/ovirtserver/__init__.py @@ -1,18 +0,0 @@ -# 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""" diff --git a/server/ovirtserver/config/__init__.py b/server/ovirtserver/config/__init__.py deleted file mode 100644 index 90ca87c..0000000 --- a/server/ovirtserver/config/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# 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. diff --git a/server/ovirtserver/config/app_cfg.py b/server/ovirtserver/config/app_cfg.py deleted file mode 100644 index 8882a6b..0000000 --- a/server/ovirtserver/config/app_cfg.py +++ /dev/null @@ -1,54 +0,0 @@ -# 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 diff --git a/server/ovirtserver/config/deployment.ini_tmpl b/server/ovirtserver/config/deployment.ini_tmpl deleted file mode 100644 index 7b1403c..0000000 --- a/server/ovirtserver/config/deployment.ini_tmpl +++ /dev/null @@ -1,104 +0,0 @@ -# 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 -email_to = you at yourdomain.com -smtp_server = localhost -error_email_from = paste at 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 diff --git a/server/ovirtserver/config/environment.py b/server/ovirtserver/config/environment.py deleted file mode 100644 index 01b0275..0000000 --- a/server/ovirtserver/config/environment.py +++ /dev/null @@ -1,25 +0,0 @@ -# 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() diff --git a/server/ovirtserver/config/middleware.py b/server/ovirtserver/config/middleware.py deleted file mode 100644 index b5f47da..0000000 --- a/server/ovirtserver/config/middleware.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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 diff --git a/server/ovirtserver/controllers/__init__.py b/server/ovirtserver/controllers/__init__.py deleted file mode 100644 index 417d5ed..0000000 --- a/server/ovirtserver/controllers/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# 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.""" diff --git a/server/ovirtserver/controllers/controller.template b/server/ovirtserver/controllers/controller.template deleted file mode 100644 index 2de6832..0000000 --- a/server/ovirtserver/controllers/controller.template +++ /dev/null @@ -1,36 +0,0 @@ -# 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') diff --git a/server/ovirtserver/controllers/error.py b/server/ovirtserver/controllers/error.py deleted file mode 100644 index 6a14218..0000000 --- a/server/ovirtserver/controllers/error.py +++ /dev/null @@ -1,46 +0,0 @@ -# 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 = ("

We're sorry but we weren't able to process " - " this request.

") - 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 diff --git a/server/ovirtserver/controllers/root.py b/server/ovirtserver/controllers/root.py deleted file mode 100644 index cfd682b..0000000 --- a/server/ovirtserver/controllers/root.py +++ /dev/null @@ -1,55 +0,0 @@ -# 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') diff --git a/server/ovirtserver/controllers/secure.py b/server/ovirtserver/controllers/secure.py deleted file mode 100644 index adb98f7..0000000 --- a/server/ovirtserver/controllers/secure.py +++ /dev/null @@ -1,21 +0,0 @@ -# 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. diff --git a/server/ovirtserver/controllers/template.py b/server/ovirtserver/controllers/template.py deleted file mode 100644 index 77a1fcb..0000000 --- a/server/ovirtserver/controllers/template.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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) diff --git a/server/ovirtserver/i18n/ru/LC_MESSAGES/ovirtserver.po b/server/ovirtserver/i18n/ru/LC_MESSAGES/ovirtserver.po deleted file mode 100644 index 29ff9bc..0000000 --- a/server/ovirtserver/i18n/ru/LC_MESSAGES/ovirtserver.po +++ /dev/null @@ -1,23 +0,0 @@ -# Russian translations for ${package}. -# Copyright (C) 2008 ORGANIZATION -# This file is distributed under the same license as the ${package} project. -# FIRST AUTHOR , 2008. -# -msgid "" -msgstr "" -"Project-Id-Version: ${package} 0.0.0\n" -"Report-Msgid-Bugs-To: EMAIL at 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 \n" -"Language-Team: ru \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 "???????? ???????????????????? ?????????????? ????????????????" diff --git a/server/ovirtserver/initservice/__init__.py b/server/ovirtserver/initservice/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/server/ovirtserver/initservice/models.py b/server/ovirtserver/initservice/models.py new file mode 100755 index 0000000..f54f205 --- /dev/null +++ b/server/ovirtserver/initservice/models.py @@ -0,0 +1,17 @@ +from django.db import models + + +class Node(models.Model): + """ + Node which will save to the database. + """ + udi = models.CharField(max_length=128, unique=True) + state = models.IntegerField(default=0) + created = models.DateTimeField(auto_now_add=True) + last_update = models.DateTimeField(auto_now=True) + + def __unicode__(self): + """ + Unicode representation of this instance. + """ + return unicode(self.udi) diff --git a/server/ovirtserver/initservice/tests.py b/server/ovirtserver/initservice/tests.py new file mode 100755 index 0000000..2247054 --- /dev/null +++ b/server/ovirtserver/initservice/tests.py @@ -0,0 +1,23 @@ +""" +This file demonstrates two different styles of tests (one doctest and one +unittest). These will both pass when you run "manage.py test". + +Replace these with more appropriate tests for your application. +""" + +from django.test import TestCase + +class SimpleTest(TestCase): + def test_basic_addition(self): + """ + Tests that 1 + 1 always equals 2. + """ + self.failUnlessEqual(1 + 1, 2) + +__test__ = {"doctest": """ +Another way to test that 1 + 1 is equal to 2. + +>>> 1 + 1 == 2 +True +"""} + diff --git a/server/ovirtserver/initservice/urls.py b/server/ovirtserver/initservice/urls.py new file mode 100755 index 0000000..5f0869a --- /dev/null +++ b/server/ovirtserver/initservice/urls.py @@ -0,0 +1,16 @@ +from django.conf.urls.defaults import * + +urlpatterns = patterns('', + # Map the url locations to our views! To make it simple let's use the same + # names. + (r'awake$', 'initservice.views.awake'), + (r'config$', 'initservice.views.config'), + (r'ready$', 'initservice.views.ready'), + (r'offline$', 'initservice.views.offline'), + # NOTES + # HTTP GET udi=UNIQ ID /awake/ (update db, grab and return keytab) --> keytab + # HTTPS POST YAML /network (updates yaml info to return) -> netconfig + # HTTPS /config -> thankeesa + # HTTPS /ready ---> ok + +) diff --git a/server/ovirtserver/initservice/views.py b/server/ovirtserver/initservice/views.py new file mode 100755 index 0000000..2152423 --- /dev/null +++ b/server/ovirtserver/initservice/views.py @@ -0,0 +1,116 @@ +import yaml +import base64 + +from django.http import HttpResponse, HttpResponseServerError +from django.shortcuts import get_object_or_404 + +from initservice.models import Node + +def awake(request): + """ + The awake view. + """ + if 'content' not in request.POST.keys(): + return HttpResponseServerError('No data posted') + try: + raw = request.POST['content'] + content = yaml.load(base64.decodestring(raw)) + udi = content['node']['identifier'] + except Exception, error: + print str(error) + return HttpResponseServerError('Missing required parameter: identifier') + + current_node, created = Node.objects.get_or_create(udi=udi) + current_node.state = 1 + current_node.save() + + # encode a keytab and return it + keytab = base64.encodestring("farkle") + + return HttpResponse("KEYTAB %s" % keytab) + +def config(request): + """ + The network view. Requires yaml to be posted. Note that currently the + POST key is expected to be 'content'. + """ + print "1" + if 'content' not in request.POST.keys(): + print "2" + return HttpResponseServerError('No data posted') + try: + print "3" + raw = request.POST['content'] + print "4" + content = yaml.load(base64.decodestring(raw)) + print "5" + udi = content['node']['identifier'] + except Exception, error: + print str(error) + return HttpResponseServerError('Missing requested parameter: identifier') + + print "6" + current_node = get_object_or_404(Node, udi=udi) + + print "7" + print "current_node: %s" % current_node + + # TODO update the list of network interfaces for the node + # TODO encode the networks for the response + + # Load the yaml content so that it is now a first class python type + yaml_data = yaml.load("""networking: + eth0: + hwaddress: 00:11:22:33:44:55 + onboot: yes + ipv4: + - bootproto: static + address: 192.168.1.17 + netmask: 255.255.255.0 + gateway: 192.168.1.1 + dns: [192.168.1.7, 192.168.1.8] + + eth1: + hwaddress: 11:22:33:44:55:66 + onboot: yes + bridge: breth1 + + breth1: + onboot: yes + ipv4: + - bootproto: dhcp""") + + return HttpResponse(base64.encodestring(yaml.dump(yaml_data))) + +def ready(request): + """ + The config view. Accepts the configuration information from the client. + """ + # Get the current node from the database. Note that we get since no nodes + # should be created at this point! If the node doesn't exist then 404 + current_node = get_object_or_404(Node, udi=request.GET['udi']) + # Hey! You can't come here unless you came from config (or already ready)! + if current_node.state != 3 and current_node.state != 4: + return HttpResponseServerError('Last state must be 3') + current_node.state = 4 + current_node.save() + return HttpResponse('Rock and/or roll.') + +def offline(request): + """ + Sets the state of the node to 0:offline + """ + if 'content' not in request.POST.keys(): + return HttpResponseServerError('No data posted') + + yaml_data = yaml.load(request.POST['content']) + try: + udi = yaml_data['identifier'] + except Exception, error: + return HttpResponseServerError('Missing required parameter: identifier') + + current_node = get_object_or_404(Node, udi=udi) + current_node.state = 20 + current_node.save() + + return HttpResponse('ACK') diff --git a/server/ovirtserver/lib/__init__.py b/server/ovirtserver/lib/__init__.py deleted file mode 100644 index 90ca87c..0000000 --- a/server/ovirtserver/lib/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# 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. diff --git a/server/ovirtserver/lib/app_globals.py b/server/ovirtserver/lib/app_globals.py deleted file mode 100644 index d5d2abe..0000000 --- a/server/ovirtserver/lib/app_globals.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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 diff --git a/server/ovirtserver/lib/base.py b/server/ovirtserver/lib/base.py deleted file mode 100644 index 90772cc..0000000 --- a/server/ovirtserver/lib/base.py +++ /dev/null @@ -1,44 +0,0 @@ -# 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) diff --git a/server/ovirtserver/lib/helpers.py b/server/ovirtserver/lib/helpers.py deleted file mode 100644 index 88cdc0f..0000000 --- a/server/ovirtserver/lib/helpers.py +++ /dev/null @@ -1,20 +0,0 @@ -# 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 diff --git a/server/ovirtserver/manage.py b/server/ovirtserver/manage.py new file mode 100755 index 0000000..5e78ea9 --- /dev/null +++ b/server/ovirtserver/manage.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python +from django.core.management import execute_manager +try: + import settings # Assumed to be in the same directory. +except ImportError: + import sys + sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) + sys.exit(1) + +if __name__ == "__main__": + execute_manager(settings) diff --git a/server/ovirtserver/model/__init__.py b/server/ovirtserver/model/__init__.py deleted file mode 100644 index 1b37524..0000000 --- a/server/ovirtserver/model/__init__.py +++ /dev/null @@ -1,77 +0,0 @@ -# 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. diff --git a/server/ovirtserver/model/auth.py b/server/ovirtserver/model/auth.py deleted file mode 100644 index d7ea74b..0000000 --- a/server/ovirtserver/model/auth.py +++ /dev/null @@ -1,27 +0,0 @@ -# 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. - -""" diff --git a/server/ovirtserver/model/model.template b/server/ovirtserver/model/model.template deleted file mode 100644 index 716807e..0000000 --- a/server/ovirtserver/model/model.template +++ /dev/null @@ -1,37 +0,0 @@ -# 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) - - #} diff --git a/server/ovirtserver/public/favicon.ico b/server/ovirtserver/public/favicon.ico deleted file mode 100644 index 840986e4705befe9beb4275e2807fd358a362497..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1104 zcmV-W1h4xaiwFP!000000|7Y%#`{M}MmRZP5C9MW=S=`zU0s?(6{e=9adB~piHWPL ztMKsf)U_xHB8w!DmPpP!#EEiT>N-OZzotgNilw50s}{OQ-t z^78VNlas>2!U6&U#KgqR%*?*NzOJsW&d$!SbyBdfu%Muz$;rva#>TX?w3(Ti+uPgs z&04auvZ$!2y1Kf(y}gex2j}PK(9qCSktL!dMnZf at o5 z^=WBo?eqTG!L-)a*6Ql&*x1;RX;!tCefaqJQBhIy=HN$1M}|Wt-{0TEn}yfO!GVE+ zq*N-`-RJ-R|LpASW at ct!U|@4WF3Wo@$oPbyO(IuUSF(ar`tX0OWF<|!XSIN1gF at gA;^d5tjqK&(Vr6Ob_W0=R?)?A%)7RUD!9CjD-;a-v=jA}IlqoboyQ&+&&w#&=Qrjm-vP)P6Z at 9ysI`}_OK z%F4jN!2bUJ`uh6f;^M)^&t_Rs z^3l at O)Y8(|)Y8MYtj4>w=-kzvNgU77)ZyXb;o{@<_4W4l_V at Pn&CShIQ&aBl?dj?1 z>+9>x$HQV{Wy{OVfpc@~>*{A`XINNRT3TDkzqtPX{d|9grlg}C92_JgBg at duy1Tij zr=`o!%gmD1y~4r3mYSg<{uM)VWnpw>WFU8GbZ8({Xk{QrNlj1yEC2ui z01yBW000R70Gl*n*5r*DAr*v}c{5O;!(~W<1i at wwn?xk>911*^&58pDNEBGHl1-Y! zV+_iHa4-fQI!I$2baBGqn6V%Zf~2u`ViBH2C-SAi8N`^CG-*}uEuuy4%&c&K2(ToAH z@#V*fF*aN?4%eiatvSoO&s7n+hMhu}Fm8LSRK7Cxk>S9DHBxp6v z^#Ky)%NHQGqX60GqJ}YJ6~YCHVxu;3Bfr8`Fy^oVBqLu=oJjP=2&4)cn?$>?=$ot> WvS0=+x)9A_Kma>NIMN(B1ONa82$stL diff --git a/server/ovirtserver/settings.py b/server/ovirtserver/settings.py new file mode 100755 index 0000000..05c8929 --- /dev/null +++ b/server/ovirtserver/settings.py @@ -0,0 +1,81 @@ +# Django settings for ovirt management server ref impl project. + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +ADMINS = ( + # ('Your Name', 'your_email at domain.com'), +) + +MANAGERS = ADMINS + +DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. +DATABASE_NAME = '/tmp/database.db' # Or path to database file if using sqlite3. +DATABASE_USER = '' # Not used with sqlite3. +DATABASE_PASSWORD = '' # Not used with sqlite3. +DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. +DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. + +# Local time zone for this installation. Choices can be found here: +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name +# although not all choices may be available on all operating systems. +# If running in a Windows environment this must be set to the same as your +# system time zone. +TIME_ZONE = 'America/New_York' + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE = 'en-us' + +SITE_ID = 1 + +# If you set this to False, Django will make some optimizations so as not +# to load the internationalization machinery. +USE_I18N = True + +# Absolute path to the directory that holds media. +# Example: "/home/media/media.lawrence.com/" +MEDIA_ROOT = '' + +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +# trailing slash if there is a path component (optional in other cases). +# Examples: "http://media.lawrence.com", "http://example.com/media/" +MEDIA_URL = '' + +# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a +# trailing slash. +# Examples: "http://foo.com/media/", "/media/". +ADMIN_MEDIA_PREFIX = '/media/' + +# Make this unique, and don't share it with anybody. +SECRET_KEY = '9z)tl1sd!xg7ca^n51zf*0z5k##ztg-bz!@g^+5gnec&cx5jo_' + +# List of callables that know how to import templates from various sources. +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.load_template_source', + 'django.template.loaders.app_directories.load_template_source', +# 'django.template.loaders.eggs.load_template_source', +) + +MIDDLEWARE_CLASSES = ( + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', +) + +ROOT_URLCONF = 'ovirtserver.urls' + +TEMPLATE_DIRS = ( + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. +) + +INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + # WE MUST HAVE THE APPLICATION LISTED TO BE USED!!! + 'initservice', +) diff --git a/server/ovirtserver/templates/__init__.py b/server/ovirtserver/templates/__init__.py deleted file mode 100644 index 14d408b..0000000 --- a/server/ovirtserver/templates/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# 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.""" diff --git a/server/ovirtserver/templates/error.html b/server/ovirtserver/templates/error.html deleted file mode 100644 index 001f8f4..0000000 --- a/server/ovirtserver/templates/error.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - A ${code} Error has Occurred - - - -

Error ${code}

- -
${XML(message)}
- - diff --git a/server/ovirtserver/templates/index.html b/server/ovirtserver/templates/index.html deleted file mode 100644 index 1c2496b..0000000 --- a/server/ovirtserver/templates/index.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - Welcome to the oVirt management server - - - -

Welcome To The oVirt Server Reference Implementation

- -

- This server provides a reference implementation for how a management server should interact - with the oVirt managed node. -

- - diff --git a/server/ovirtserver/tests/__init__.py b/server/ovirtserver/tests/__init__.py deleted file mode 100644 index 7c1a4a9..0000000 --- a/server/ovirtserver/tests/__init__.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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() diff --git a/server/ovirtserver/tests/functional/__init__.py b/server/ovirtserver/tests/functional/__init__.py deleted file mode 100644 index be0e5fb..0000000 --- a/server/ovirtserver/tests/functional/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# 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.""" diff --git a/server/ovirtserver/tests/functional/test_authentication.py b/server/ovirtserver/tests/functional/test_authentication.py deleted file mode 100644 index 90ca87c..0000000 --- a/server/ovirtserver/tests/functional/test_authentication.py +++ /dev/null @@ -1,16 +0,0 @@ -# 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. diff --git a/server/ovirtserver/tests/functional/test_root.py b/server/ovirtserver/tests/functional/test_root.py deleted file mode 100644 index 5a7a55e..0000000 --- a/server/ovirtserver/tests/functional/test_root.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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!") diff --git a/server/ovirtserver/tests/models/__init__.py b/server/ovirtserver/tests/models/__init__.py deleted file mode 100644 index 354b222..0000000 --- a/server/ovirtserver/tests/models/__init__.py +++ /dev/null @@ -1,68 +0,0 @@ -# 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) diff --git a/server/ovirtserver/tests/models/test_auth.py b/server/ovirtserver/tests/models/test_auth.py deleted file mode 100644 index eb0fce0..0000000 --- a/server/ovirtserver/tests/models/test_auth.py +++ /dev/null @@ -1,22 +0,0 @@ -# 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 diff --git a/server/ovirtserver/urls.py b/server/ovirtserver/urls.py new file mode 100755 index 0000000..a578df7 --- /dev/null +++ b/server/ovirtserver/urls.py @@ -0,0 +1,10 @@ +from django.conf.urls.defaults import * + +# Since there is only one application and it should take care of all of the +# URL contexts just pass everything to the initservice url mapper +urlpatterns = patterns('', + # The format is (r'regex', include('name.of.package.to.pass.to')), + # or you can map to a view directly with ... + # (r'regex', 'name.of.package.to.the.view.function'), + (r'', include('ovirtserver.initservice.urls')), +) diff --git a/server/ovirtserver/websetup.py b/server/ovirtserver/websetup.py deleted file mode 100644 index 36e3d8c..0000000 --- a/server/ovirtserver/websetup.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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" diff --git a/server/server.egg-info/PKG-INFO b/server/server.egg-info/PKG-INFO deleted file mode 100644 index 2ad8b9b..0000000 --- a/server/server.egg-info/PKG-INFO +++ /dev/null @@ -1,10 +0,0 @@ -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 diff --git a/server/server.egg-info/SOURCES.txt b/server/server.egg-info/SOURCES.txt deleted file mode 100644 index 4632e06..0000000 --- a/server/server.egg-info/SOURCES.txt +++ /dev/null @@ -1,68 +0,0 @@ -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 diff --git a/server/server.egg-info/dependency_links.txt b/server/server.egg-info/dependency_links.txt deleted file mode 100644 index e69de29..0000000 diff --git a/server/server.egg-info/entry_points.txt b/server/server.egg-info/entry_points.txt deleted file mode 100644 index bf84380..0000000 --- a/server/server.egg-info/entry_points.txt +++ /dev/null @@ -1,6 +0,0 @@ - - [paste.app_factory] - main = ovirtserver.config.middleware:make_app - - [paste.app_install] - main = pylons.util:PylonsInstaller diff --git a/server/server.egg-info/paster_plugins.txt b/server/server.egg-info/paster_plugins.txt deleted file mode 100644 index ab508e5..0000000 --- a/server/server.egg-info/paster_plugins.txt +++ /dev/null @@ -1,4 +0,0 @@ -PasteScript -Pylons -TurboGears2 -tg.devtools diff --git a/server/server.egg-info/requires.txt b/server/server.egg-info/requires.txt deleted file mode 100644 index 661a57b..0000000 --- a/server/server.egg-info/requires.txt +++ /dev/null @@ -1,6 +0,0 @@ -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 diff --git a/server/server.egg-info/top_level.txt b/server/server.egg-info/top_level.txt deleted file mode 100644 index 4e4dbeb..0000000 --- a/server/server.egg-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -ovirtserver diff --git a/server/setup.cfg b/server/setup.cfg deleted file mode 100644 index cb01cf9..0000000 --- a/server/setup.cfg +++ /dev/null @@ -1,32 +0,0 @@ -[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 diff --git a/server/setup.py b/server/setup.py deleted file mode 100644 index bf646ad..0000000 --- a/server/setup.py +++ /dev/null @@ -1,63 +0,0 @@ -# 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 - """, -) diff --git a/server/test.ini b/server/test.ini deleted file mode 100644 index 415fcb0..0000000 --- a/server/test.ini +++ /dev/null @@ -1,42 +0,0 @@ -# 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 -# email_to = you at yourdomain.com -smtp_server = localhost -error_email_from = paste at 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. -- 1.6.6 From sdcc2 at theaudiobible.org Thu Feb 18 00:25:32 2010 From: sdcc2 at theaudiobible.org (Steven Patrick) Date: Thu, 18 Feb 2010 08:25:32 +0800 Subject: [Ovirt-devel] edit-livecd In-Reply-To: <4B7C1D7B.700@redhat.com> References: <4B7C03E9.1050001@theaudiobible.org> <4B7C1D7B.700@redhat.com> Message-ID: <4B7C88FC.5090100@theaudiobible.org> On 02/18/2010 12:46 AM, David Huff wrote: > On 02/17/2010 09:57 AM, Steven Patrick wrote: >> Greetings, >> >> I made a Fedora AOS livecd ISO image using fedora-aos.ks (from >> fedora-kickstarts-0.12.1-1.fc12.noarch) and >> livecd-tools-031-1.fc12.1.i686. >> >> This boots fine with qemu and directly from CD. >> >> I used the script from >> http://lists.fedoraproject.org/pipermail/livecd/attachments/20090922/85647312/attachment.py >> to edit the ISO image, and, even if I make no changes, I get the >> following error when booting the edited image: >> >> No root device found >> >> Boot has failed, sleeping forever. >> >> Could you please give me some idea on how to trace the cause of this >> problem? >> >> Many thanks, >> Steven > > Steven, thanks for reporting this. It looks like there is a minor bug in > the way it stores the image label. I'll figure out whats going on and > post a patch soon. Also are you still seeing the size increase? I ran a > couple tests this morning and I am still seeing a moderate size increase > on some tests. > > -D Thanks for your feedback, David. Yes, there is a size increase: -rw-r--r-- 1 root root 154140672 2010-02-17 10:43 Fedora12-AOS.iso -rw-r--r-- 1 root root 168820736 2010-02-17 16:07 Fedora12-AOS.iso.edited.iso Kind regards, Steven From alessandro.lorenzi at gmail.com Thu Feb 18 16:55:07 2010 From: alessandro.lorenzi at gmail.com (Lorenzi Alessandro) Date: Thu, 18 Feb 2010 17:55:07 +0100 Subject: [Ovirt-devel] ovirt-installer and mod_ssl Message-ID: <1266512107.2175.4.camel@diabolus> Hi, I'm installing ovirt. I've give this command: # ovirt-installer --help This installer will configure the ovirt installation based on a series [..] mod_ssl package must be removed prior to installing, to remove run: rpm -e mod_ssl ... but ... # rpm -e mod_ssl errore: il pacchetto mod_ssl non ? stato installato [error: the pakage mod_ssl isn't installed] Is there a way to ignore the check of mod_ssl? Ale -- o/ Alessandro "NeRON" Lorenzi /S ------------------------------------ // http://alessandrolorenzi.netsons.org -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 490 bytes Desc: This is a digitally signed message part URL: From jboggs at redhat.com Thu Feb 18 17:05:15 2010 From: jboggs at redhat.com (Joey Boggs) Date: Thu, 18 Feb 2010 12:05:15 -0500 Subject: [Ovirt-devel] ovirt-installer and mod_ssl In-Reply-To: <1266512107.2175.4.camel@diabolus> References: <1266512107.2175.4.camel@diabolus> Message-ID: <4B7D734B.9060805@redhat.com> On 02/18/2010 11:55 AM, Lorenzi Alessandro wrote: > Hi, I'm installing ovirt. I've give this command: > > # ovirt-installer --help > > This installer will configure the ovirt installation based on a series > [..] > > mod_ssl package must be removed prior to installing, to remove run: rpm > -e mod_ssl > > ... but ... > > # rpm -e mod_ssl > errore: il pacchetto mod_ssl non ? stato installato > [error: the pakage mod_ssl isn't installed] > > > Is there a way to ignore the check of mod_ssl? > > Ale > > > > > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel > There should've been a language check in there before running to check for mod_ssl. In /usr/sbin/ovirt-installer comment out the following lines and you can get past it. 127 modssl_check = `rpm -q mod_ssl` 128 if modssl_check !~ /(not installed)/ 129 puts "\nmod_ssl package must be removed prior to installing, to remove run: rpm -e mod_ssl\n\n" 130 exit 131 end -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmialon at linagora.com Thu Feb 18 22:30:35 2010 From: pmialon at linagora.com (Pierre-Gilles Mialon) Date: Thu, 18 Feb 2010 23:30:35 +0100 Subject: [Ovirt-devel] ovirt-installer and mod_ssl In-Reply-To: <4B7D734B.9060805@redhat.com> References: <1266512107.2175.4.camel@diabolus> <4B7D734B.9060805@redhat.com> Message-ID: <201002182330.35843.pmialon@linagora.com> Le jeudi 18 f?vrier 2010 18:05:15, Joey Boggs a ?crit : > On 02/18/2010 11:55 AM, Lorenzi Alessandro wrote: > > Hi, I'm installing ovirt. I've give this command: > > > > # ovirt-installer --help > > > > This installer will configure the ovirt installation based on a series > > [..] > > > > mod_ssl package must be removed prior to installing, to remove run: rpm > > -e mod_ssl > > > > ... but ... > > > > # rpm -e mod_ssl > > errore: il pacchetto mod_ssl non ? stato installato > > [error: the pakage mod_ssl isn't installed] > > > > > > Is there a way to ignore the check of mod_ssl? > > > > Ale > > > > > > > > > > > > _______________________________________________ > > Ovirt-devel mailing list > > Ovirt-devel at redhat.com > > https://www.redhat.com/mailman/listinfo/ovirt-devel > > There should've been a language check in there before running to check > for mod_ssl. > > In /usr/sbin/ovirt-installer comment out the following lines and you can > get past it. > > 127 modssl_check = `rpm -q mod_ssl` > 128 if modssl_check !~ /(not installed)/ > 129 puts "\nmod_ssl package must be removed prior to installing, > to remove run: rpm -e mod_ssl\n\n" > 130 exit > 131 end You can try : # LANG=C ovirt-installer French meet the same feature :-) -- Pierre-Gilles Mialon Linagora :: http://www.linagora.com Responsable h?bergement :: Head of Hosting services pmialon at linagora.com :: +33.1 58 18 65 46 From jboggs at redhat.com Fri Feb 19 01:48:00 2010 From: jboggs at redhat.com (Joey Boggs) Date: Thu, 18 Feb 2010 20:48:00 -0500 Subject: [Ovirt-devel] ovirt-installer and mod_ssl In-Reply-To: <201002182330.35843.pmialon@linagora.com> References: <1266512107.2175.4.camel@diabolus> <4B7D734B.9060805@redhat.com> <201002182330.35843.pmialon@linagora.com> Message-ID: <4B7DEDD0.3020308@redhat.com> On 02/18/2010 05:30 PM, Pierre-Gilles Mialon wrote: > Le jeudi 18 f?vrier 2010 18:05:15, Joey Boggs a ?crit : > >> On 02/18/2010 11:55 AM, Lorenzi Alessandro wrote: >> >>> Hi, I'm installing ovirt. I've give this command: >>> >>> # ovirt-installer --help >>> >>> This installer will configure the ovirt installation based on a series >>> [..] >>> >>> mod_ssl package must be removed prior to installing, to remove run: rpm >>> -e mod_ssl >>> >>> ... but ... >>> >>> # rpm -e mod_ssl >>> errore: il pacchetto mod_ssl non ? stato installato >>> [error: the pakage mod_ssl isn't installed] >>> >>> >>> Is there a way to ignore the check of mod_ssl? >>> >>> Ale >>> >>> >>> >>> >>> >>> _______________________________________________ >>> Ovirt-devel mailing list >>> Ovirt-devel at redhat.com >>> https://www.redhat.com/mailman/listinfo/ovirt-devel >>> >> There should've been a language check in there before running to check >> for mod_ssl. >> >> In /usr/sbin/ovirt-installer comment out the following lines and you can >> get past it. >> >> 127 modssl_check = `rpm -q mod_ssl` >> 128 if modssl_check !~ /(not installed)/ >> 129 puts "\nmod_ssl package must be removed prior to installing, >> to remove run: rpm -e mod_ssl\n\n" >> 130 exit >> 131 end >> > You can try : > # LANG=C ovirt-installer > > French meet the same feature :-) > > > Yeah that works, I could've swore I added that in months ago, mustve gotten lost in the list somewhere From jboggs at redhat.com Fri Feb 19 19:25:06 2010 From: jboggs at redhat.com (Joey Boggs) Date: Fri, 19 Feb 2010 14:25:06 -0500 Subject: [Ovirt-devel] [PATCH] Help reduce size of iso by symlinking initrd's from isolinux/ and EFI/boot if md5's match Message-ID: <1266607506-23936-1-git-send-email-jboggs@redhat.com> 116M ovirt-node-image/ovirt-node-image.iso 119M ovirt-node-image.iso.edited.iso --- edit-livecd.py | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletions(-) diff --git a/edit-livecd.py b/edit-livecd.py index 279b225..ebcb7a6 100644 --- a/edit-livecd.py +++ b/edit-livecd.py @@ -26,7 +26,7 @@ import shutil import subprocess import optparse import logging - +import hashlib from imgcreate.debug import * from imgcreate.fs import * from imgcreate.live import * @@ -310,6 +310,28 @@ def main(): print "Launching shell. Exit to continue." print "----------------------------------" editor.launch_shell() + # reduce iso size by symlinking initrd's if they match + efi_initrd = "%s/EFI/boot/initrd0.img" % editor._LiveImageCreatorBase__isodir + isolinux_initrd = "%s/isolinux/initrd0.img" % editor._LiveImageCreatorBase__isodir + + def initrd_check(initrd_file): + m = hashlib.md5() + f = open(initrd_file,"r") + while 1: + chunk = f.read(65536) + if not chunk: + break + m.update(chunk) + checksum = m.hexdigest() + return checksum + try: + efi_initrd_csum = initrd_check(efi_initrd) + isolinux_initrd_csum = initrd_check(isolinux_initrd) + if efi_initrd_csum == isolinux_initrd_csum: + os.remove(efi_initrd) + os.symlink(isolinux_initrd,efi_initrd) + except: + pass editor.unmount() editor.package(output) except CreatorError, e: -- 1.6.6 From dpierce at redhat.com Mon Feb 22 16:26:10 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 22 Feb 2010 11:26:10 -0500 Subject: [Ovirt-devel] [PATCH] Moves all ovirt-config-* scripts to /usr/libexec. Message-ID: <1266855970-13449-1-git-send-email-dpierce@redhat.com> This is to reinforce with the user that the scripts are not meant to be used at the commandline individually. Signed-off-by: Darryl L. Pierce --- scripts/ovirt-config-boot-wrapper | 2 +- scripts/ovirt-early | 4 ++-- scripts/ovirt-firstboot | 16 ++++++++-------- scripts/ovirt-functions | 1 + 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/scripts/ovirt-config-boot-wrapper b/scripts/ovirt-config-boot-wrapper index 89f0fc0..f6a28b5 100755 --- a/scripts/ovirt-config-boot-wrapper +++ b/scripts/ovirt-config-boot-wrapper @@ -26,7 +26,7 @@ continuing." fi if ask_yes_or_no "Do you wish to continue ([Y]es/[N]o)?"; then mount_live \ - && /usr/sbin/ovirt-config-boot /live "${bootparams}" + && $OVIRT_EXECDIR/ovirt-config-boot /live "${bootparams}" rc=$? break else diff --git a/scripts/ovirt-early b/scripts/ovirt-early index 23c4f6e..921aaa8 100755 --- a/scripts/ovirt-early +++ b/scripts/ovirt-early @@ -147,7 +147,7 @@ configure_management_interface() { "ovirt") configure_ovirt_management_nic $bootif if [ -n "$init" ]; then - ovirt-config-storage AUTO + $OVIRT_EXECDIR/ovirt-config-storage AUTO # initial configuration storage, after /config creation ovirt_store_config \ /etc/sysconfig/network-scripts/ifcfg-* \ @@ -155,7 +155,7 @@ configure_management_interface() { if [ $upgrade = 1 ]; then # local disk installation for managed mode mount_live - ovirt-config-boot /live "$bootparams" + $OVIRT_EXECDIR/ovirt-config-boot /live "$bootparams" fi fi ;; diff --git a/scripts/ovirt-firstboot b/scripts/ovirt-firstboot index b992909..dae252b 100755 --- a/scripts/ovirt-firstboot +++ b/scripts/ovirt-firstboot @@ -46,17 +46,17 @@ start () chkconfig collectd off if is_auto_install; then - ovirt-config-storage AUTO - ovirt-config-hostname AUTO - ovirt-config-networking AUTO - ovirt-config-logging AUTO - ovirt-config-collectd AUTO - ovirt-config-password AUTO + $OVIRT_EXECDIR/ovirt-config-storage AUTO + $OVIRT_EXECDIR/ovirt-config-hostname AUTO + $OVIRT_EXECDIR/ovirt-config-networking AUTO + $OVIRT_EXECDIR/ovirt-config-logging AUTO + $OVIRT_EXECDIR/ovirt-config-collectd AUTO + $OVIRT_EXECDIR/ovirt-config-password AUTO fi if is_upgrade; then mount_live - ovirt-config-boot /live "$OVIRT_BOOTPARAMS" no + $OVIRT_EXECDIR/ovirt-config-boot /live "$OVIRT_BOOTPARAMS" no disable_firstboot reboot return @@ -65,7 +65,7 @@ start () if is_firstboot; then plymouth --hide-splash - ovirt-config-setup -x < /dev/console + $OVIRT_EXECDIR/ovirt-config-setup -x < /dev/console plymouth --show-splash fi diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index ff2b016..730c06a 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -1,5 +1,6 @@ # -*-Shell-script-*- +OVIRT_EXECDIR=/usr/libexec OVIRT_LOGFILE=/var/log/ovirt.log OVIRT_TMP_LOGFILE=/tmp/ovirt.log _log_status=1 -- 1.6.6 From aclement at linagora.com Tue Feb 23 13:49:14 2010 From: aclement at linagora.com (Arthur CLEMENT) Date: Tue, 23 Feb 2010 14:49:14 +0100 Subject: [Ovirt-devel] [PATCH] Typo in ovirt-early Message-ID: <201002231449.14142.aclement@linagora.com> There is a typo in ovirt-early : /etc/rc3.d/S51ovirt-early: line 477: configure_manament_interface: command not found >From 92c2d705007644fad52f839a5272ab5332d707fa Mon Sep 17 00:00:00 2001 From: Arthur CLEMENT Date: Tue, 23 Feb 2010 13:44:30 +0000 Subject: [PATCH node] Fixed typo in ovirt-early (configure_management_interface) Signed-off-by: Arthur CLEMENT --- scripts/ovirt-early | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ovirt-early b/scripts/ovirt-early index 23c4f6e..69cfa3e 100755 --- a/scripts/ovirt-early +++ b/scripts/ovirt-early @@ -474,8 +474,8 @@ start() { -e "s/^mech_list: .*gssapi.*/mech_list: digest-md5/" \ /etc/sasl2/libvirt.conf else - configure_manament_interface - fi + configure_management_interface + fi rm -f $VAR_SUBSYS_OVIRT_EARLY -- 1.6.6 -- Arthur CLEMENT Linagora Paris From dpierce at redhat.com Tue Feb 23 14:14:16 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 23 Feb 2010 09:14:16 -0500 Subject: [Ovirt-devel] [PATCH] Typo in ovirt-early In-Reply-To: <201002231449.14142.aclement@linagora.com> References: <201002231449.14142.aclement@linagora.com> Message-ID: <20100223141412.GA2736@mcpierce-desktop.usersys.redhat.com> On Tue, Feb 23, 2010 at 02:49:14PM +0100, Arthur CLEMENT wrote: > There is a typo in ovirt-early : > /etc/rc3.d/S51ovirt-early: line 477: configure_manament_interface: command not > found > > > > > >From 92c2d705007644fad52f839a5272ab5332d707fa Mon Sep 17 00:00:00 2001 > From: Arthur CLEMENT > Date: Tue, 23 Feb 2010 13:44:30 +0000 > Subject: [PATCH node] Fixed typo in ovirt-early > (configure_management_interface) > > > Signed-off-by: Arthur CLEMENT > --- > scripts/ovirt-early | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/scripts/ovirt-early b/scripts/ovirt-early > index 23c4f6e..69cfa3e 100755 > --- a/scripts/ovirt-early > +++ b/scripts/ovirt-early > @@ -474,8 +474,8 @@ start() { > -e "s/^mech_list: .*gssapi.*/mech_list: digest-md5/" \ > /etc/sasl2/libvirt.conf > else > - configure_manament_interface > - fi > + configure_management_interface > + fi > > rm -f $VAR_SUBSYS_OVIRT_EARLY > > -- > 1.6.6 ACK. Good catch. I'll push this patch upstream this morning. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Tue Feb 23 14:52:34 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 23 Feb 2010 09:52:34 -0500 Subject: [Ovirt-devel] More complete patch... Message-ID: <1266936755-20615-1-git-send-email-dpierce@redhat.com> This patch supercedes the previous one by moving the functionality for relocating files into the make system. From dpierce at redhat.com Tue Feb 23 14:52:35 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 23 Feb 2010 09:52:35 -0500 Subject: [Ovirt-devel] [PATCH] Moves all ovirt-config-* scripts to /usr/libexec. In-Reply-To: <1266936755-20615-1-git-send-email-dpierce@redhat.com> References: <1266936755-20615-1-git-send-email-dpierce@redhat.com> Message-ID: <1266936755-20615-2-git-send-email-dpierce@redhat.com> This is to reinforce with the user that the scripts are not meant to be used at the commandline individually. The spec file and Makefile are both fixed to change the installation location. The ovirt-functions file now contains a variable which points to the installation directory, which is used inside of all scripts which call out to other scripts. Updates the make system to use makefiles and to install the files there. Signed-off-by: Darryl L. Pierce --- Makefile.am | 97 +++++---------------------------- configure.ac | 6 ++ images/Makefile.am | 20 +++++++ kinit/Makefile.am | 20 +++++++ nodeadmin/Makefile.am | 61 +++++++++++++++++++++ ovirt-node.spec.in | 83 +++++++++++------------------ scripts/Makefile.am | 46 ++++++++++++++++ scripts/ovirt | 2 +- scripts/ovirt-awake | 2 +- scripts/ovirt-config-boot | 2 +- scripts/ovirt-config-boot-wrapper | 4 +- scripts/ovirt-config-collectd | 2 +- scripts/ovirt-config-hostname | 2 +- scripts/ovirt-config-iscsi | 2 +- scripts/ovirt-config-logging | 2 +- scripts/ovirt-config-networking | 2 +- scripts/ovirt-config-password | 2 +- scripts/ovirt-config-setup | 2 +- scripts/ovirt-config-storage | 2 +- scripts/ovirt-config-uninstall | 2 +- scripts/ovirt-config-view-logs | 2 +- scripts/ovirt-early | 6 +- scripts/ovirt-firstboot | 18 +++--- scripts/ovirt-install-node-stateful | 2 +- scripts/ovirt-install-node-stateless | 2 +- scripts/ovirt-post | 2 +- scripts/ovirt-process-config | 2 +- scripts/ovirt-uninstall-node-stateful | 2 +- scripts/persist | 4 +- scripts/unpersist | 4 +- tools/Makefile.am | 23 ++++++++ 31 files changed, 256 insertions(+), 172 deletions(-) create mode 100644 images/Makefile.am create mode 100644 kinit/Makefile.am create mode 100644 nodeadmin/Makefile.am create mode 100644 scripts/Makefile.am create mode 100644 tools/Makefile.am diff --git a/Makefile.am b/Makefile.am index 7798d09..da992ab 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,90 +17,19 @@ OVIRT_CACHE_DIR ?= $(HOME)/ovirt-cache -SUBDIRS = \ - gptsync \ - recipe - -EXTRA_DIST = \ - .gitignore \ - ovirt-node.spec \ - ovirt-node.spec.in \ - images/grub-splash.xpm.gz \ - images/syslinux-vesa-splash.jpg \ - nodeadmin/__init__.py \ - nodeadmin/adddomain.py \ - nodeadmin/addhost.py \ - nodeadmin/addpool.py \ - nodeadmin/addvolume.py \ - nodeadmin/changehost.py \ - nodeadmin/configscreen.py \ - nodeadmin/createmeter.py \ - nodeadmin/createnetwork.py \ - nodeadmin/createuser.py \ - nodeadmin/definenet.py \ - nodeadmin/destroynetwork.py \ - nodeadmin/domainconfig.py \ - nodeadmin/halworker.py \ - nodeadmin/hostconnect.py \ - nodeadmin/hostmenu.py \ - nodeadmin/libvirtworker.py \ - nodeadmin/listdomains.py \ - nodeadmin/listnetworks.py \ - nodeadmin/listpools.py \ - nodeadmin/mainmenu.py \ - nodeadmin/menuscreen.py \ - nodeadmin/migratedomain.py \ - nodeadmin/networkconfig.py \ - nodeadmin/netmenu.py \ - nodeadmin/nodeadmin.py \ - nodeadmin/nodemenu.py \ - nodeadmin/poolconfig.py \ - nodeadmin/removedomain.py \ - nodeadmin/removehost.py \ - nodeadmin/removepool.py \ - nodeadmin/removevolume.py \ - nodeadmin/startdomain.py \ - nodeadmin/startpool.py \ - nodeadmin/stopdomain.py \ - nodeadmin/stoppool.py \ - nodeadmin/storagemenu.py \ - nodeadmin/undefinenetwork.py \ - nodeadmin/userworker.py \ - nodeadmin/utils.py \ - nodeadmin/volumeconfig.py \ - scripts/collectd.conf.in \ - scripts/node-config \ - scripts/ovirt \ - scripts/ovirt-awake \ - scripts/ovirt-config-boot \ - scripts/ovirt-config-boot-wrapper \ - scripts/ovirt-config-collectd \ - scripts/ovirt-config-hostname \ - scripts/ovirt-config-iscsi \ - scripts/ovirt-config-logging \ - scripts/ovirt-config-networking \ - scripts/ovirt-config-password \ - scripts/ovirt-config-setup \ - scripts/ovirt-config-storage \ - scripts/ovirt-config-uninstall \ - scripts/ovirt-config-view-logs \ - scripts/ovirt-early \ - scripts/ovirt-firstboot \ - scripts/ovirt-functions \ - scripts/ovirt-install-node-stateful \ - scripts/ovirt-install-node-stateless \ - scripts/persist \ - scripts/unpersist \ - scripts/ovirt-post \ - scripts/ovirt-process-config \ - scripts/ovirt-uninstall-node-stateful \ - tools/create-ovirt-iso-nodes \ - tools/edit-livecd \ - tools/livecd-iso-to-iscsi \ - tools/livecd-rpms \ - tools/livecd-setauth \ - kinit/ovirt-kinit \ - logrotate/ovirt-logrotate \ +SUBDIRS = \ + gptsync \ + images \ + kinit \ + nodeadmin \ + recipe \ + scripts \ + tools + +EXTRA_DIST = \ + ovirt-node.spec \ + ovirt-node.spec.in \ + logrotate/ovirt-logrotate \ logrotate/ovirt-logrotate.conf DISTCLEANFILES = $(PACKAGE)-$(VERSION).tar.gz diff --git a/configure.ac b/configure.ac index 7786d26..551dafc 100644 --- a/configure.ac +++ b/configure.ac @@ -8,6 +8,12 @@ test x"$ac_ct_CC:$CFLAGS" = 'xgcc:-g -O2' \ && CFLAGS="$CFLAGS -Wshadow -Wall -Werror" AC_CONFIG_FILES([Makefile + images/Makefile + kinit/Makefile + nodeadmin/Makefile + scripts/Makefile + tools/Makefile + scripts/collectd.conf nodeadmin/setup.py gptsync/Makefile recipe/Makefile diff --git a/images/Makefile.am b/images/Makefile.am new file mode 100644 index 0000000..60347a8 --- /dev/null +++ b/images/Makefile.am @@ -0,0 +1,20 @@ +# 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 = \ + grub-splash.xpm.gz \ + syslinux-vesa-splash.jpg diff --git a/kinit/Makefile.am b/kinit/Makefile.am new file mode 100644 index 0000000..2ac6ca2 --- /dev/null +++ b/kinit/Makefile.am @@ -0,0 +1,20 @@ +# 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 + diff --git a/nodeadmin/Makefile.am b/nodeadmin/Makefile.am new file mode 100644 index 0000000..11c7e91 --- /dev/null +++ b/nodeadmin/Makefile.am @@ -0,0 +1,61 @@ +# 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 = \ + adddomain.py \ + addhost.py \ + addpool.py \ + addvolume.py \ + changehost.py \ + configscreen.py \ + createmeter.py \ + createnetwork.py \ + createuser.py \ + definenet.py \ + destroynetwork.py \ + domainconfig.py \ + halworker.py \ + hostconnect.py \ + hostmenu.py \ + __init__.py \ + libvirtworker.py \ + listdomains.py \ + listnetworks.py \ + listpools.py \ + mainmenu.py \ + menuscreen.py \ + migratedomain.py \ + netmenu.py \ + networkconfig.py \ + nodeadmin.py \ + nodemenu.py \ + poolconfig.py \ + removedomain.py \ + removehost.py \ + removepool.py \ + removevolume.py \ + setup.py \ + startdomain.py \ + startpool.py \ + stopdomain.py \ + stoppool.py \ + storagemenu.py \ + undefinenetwork.py \ + userworker.py \ + utils.py \ + volumeconfig.py + diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in index 3d8d100..d67b089 100644 --- a/ovirt-node.spec.in +++ b/ovirt-node.spec.in @@ -53,9 +53,7 @@ ExclusiveArch: %{ix86} x86_64 %define app_root %{_datadir}/%{name} %description -Provides a series of daemons and support utilities to allow an -oVirt Node to interact with the oVirt Server. This package -should only be installed on the oVirt Node machine. +Provides a series of daemons and support utilities for hypervisor distribution. %package tools Summary: oVirt Node tools for building and running an oVirt Node image @@ -84,37 +82,17 @@ make %{?ovirt_cache_dir: OVIRT_CACHE_DIR=%{ovirt_cache_dir}} \ %install %{__rm} -rf %{buildroot} make install DESTDIR=%{buildroot} -# FIXME move all installs into makefile -%{__install} -d -m0755 %{buildroot}%{_sbindir} +%{__install} -d -m0755 %{buildroot}%{app_root} +%{__install} -d -m0755 %{buildroot}%{_initrddir} +%{__install} -d -m0755 %{buildroot}%{_libexecdir} %{__install} -d -m0755 %{buildroot}%{_sysconfdir} -%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/chkconfig.d +%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/cron.hourly %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/sysconfig %{__install} -d -m0755 %{buildroot}%{mgmt_scripts_dir} -%{__install} -d -m0755 %{buildroot}%{_initrddir} -%{__install} -d -m0755 %{buildroot}%{app_root} %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/cron.d -%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/cron.hourly %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/logrotate.d %{__install} -d -m0755 %{buildroot}%{python_sitelib}/nodeadmin -%{__install} -p -m0644 scripts/node-config %{buildroot}%{_sysconfdir}/sysconfig -%{__install} -p -m0755 scripts/ovirt-config-boot %{buildroot}%{_sbindir} -%{__install} -p -m0755 scripts/ovirt-config-boot-wrapper %{buildroot}%{_sbindir} -%{__install} -p -m0755 scripts/ovirt-config-collectd %{buildroot}%{_sbindir} -%{__install} -p -m0755 scripts/ovirt-config-hostname %{buildroot}%{_sbindir} -%{__install} -p -m0755 scripts/ovirt-config-iscsi %{buildroot}%{_sbindir} -%{__install} -p -m0755 scripts/ovirt-config-logging %{buildroot}%{_sbindir} -%{__install} -p -m0755 scripts/ovirt-config-networking %{buildroot}%{_sbindir} -%{__install} -p -m0755 scripts/ovirt-config-password %{buildroot}%{_sbindir} -%{__install} -p -m0755 scripts/ovirt-config-setup %{buildroot}%{_sbindir} -%{__install} -p -m0755 scripts/ovirt-config-storage %{buildroot}%{_sbindir} -%{__install} -p -m0755 scripts/ovirt-config-uninstall %{buildroot}%{_sbindir} -%{__install} -p -m0755 scripts/ovirt-process-config %{buildroot}%{_sbindir} -%{__install} -D -m0755 scripts/ovirt-install-node-stateless %{buildroot}%{_sbindir} -%{__install} -D -m0755 scripts/ovirt-config-view-logs %{buildroot}%{_sbindir} -%{__install} -p -m0755 scripts/persist %{buildroot}%{_sbindir} -%{__install} -p -m0755 scripts/unpersist %{buildroot}%{_sbindir} - %{__install} -p -m0644 nodeadmin/__init__.py %{buildroot}%{python_sitelib}/nodeadmin %{__install} -p -m0644 nodeadmin/configscreen.py %{buildroot}%{python_sitelib}/nodeadmin %{__install} -p -m0644 nodeadmin/menuscreen.py %{buildroot}%{python_sitelib}/nodeadmin @@ -155,12 +133,13 @@ make install DESTDIR=%{buildroot} #%{__install} -p -m0755 gptsync/showpart %{buildroot}%{_sbindir} # in Makefile now -%{__install} -p -m0755 scripts/ovirt-functions %{buildroot}%{_initrddir} +%{__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-firstboot %{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 scripts/collectd.conf.in %{buildroot}%{_sysconfdir} @@ -200,16 +179,16 @@ ln -s ovirt-release %{buildroot}/etc/system-release # default ovirt-config-setup menu options %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/ovirt-config-setup.d -%{__ln_s} ../..%{_sbindir}/ovirt-config-storage %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"00_Disk Partitioning" -%{__ln_s} ../..%{_sbindir}/ovirt-config-password %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"05_Administrator Password" -%{__ln_s} ../..%{_sbindir}/ovirt-config-hostname %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"10_Set Hostname" -%{__ln_s} ../..%{_sbindir}/ovirt-config-iscsi %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"12_iSCSI Initiator Setup" -%{__ln_s} ../..%{_sbindir}/ovirt-config-networking %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"15_Networking Setup" -%{__ln_s} ../..%{_sbindir}/ovirt-config-logging %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"30_Logging Setup" -%{__ln_s} ../..%{_sbindir}/ovirt-config-collectd %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"35_Collectd Setup" -%{__ln_s} ../..%{_sbindir}/ovirt-config-view-logs %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"90_View logs" -%{__ln_s} ../..%{_sbindir}/ovirt-config-boot-wrapper %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"98_Local install and reboot" -%{__ln_s} ../..%{_sbindir}/ovirt-config-uninstall %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"99_Uninstall node" +%{__ln_s} ../..%{_libexecdir}/ovirt-config-storage %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"00_Disk Partitioning" +%{__ln_s} ../..%{_libexecdir}/ovirt-config-password %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"05_Administrator Password" +%{__ln_s} ../..%{_libexecdir}/ovirt-config-hostname %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"10_Set Hostname" +%{__ln_s} ../..%{_libexecdir}/ovirt-config-iscsi %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"12_iSCSI Initiator Setup" +%{__ln_s} ../..%{_libexecdir}/ovirt-config-networking %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"15_Networking Setup" +%{__ln_s} ../..%{_libexecdir}/ovirt-config-logging %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"30_Logging Setup" +%{__ln_s} ../..%{_libexecdir}/ovirt-config-collectd %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"35_Collectd Setup" +%{__ln_s} ../..%{_libexecdir}/ovirt-config-view-logs %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"90_View logs" +%{__ln_s} ../..%{_libexecdir}/ovirt-config-boot-wrapper %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"98_Local install and reboot" +%{__ln_s} ../..%{_libexecdir}/ovirt-config-uninstall %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"99_Uninstall node" # ovirt-early vendor hook dir %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/ovirt-early.d @@ -288,18 +267,19 @@ fi # end i386 bits %{app_root}/syslinux-vesa-splash.jpg -%{_sbindir}/ovirt-config-boot -%{_sbindir}/ovirt-config-boot-wrapper -%{_sbindir}/ovirt-config-collectd -%{_sbindir}/ovirt-config-iscsi -%{_sbindir}/ovirt-config-hostname -%{_sbindir}/ovirt-config-logging -%{_sbindir}/ovirt-config-networking -%{_sbindir}/ovirt-config-password -%{_sbindir}/ovirt-config-setup -%{_sbindir}/ovirt-config-storage -%{_sbindir}/ovirt-config-uninstall -%{_sbindir}/ovirt-config-view-logs +%{_libexecdir}/ovirt-functions +%{_libexecdir}/ovirt-config-boot +%{_libexecdir}/ovirt-config-boot-wrapper +%{_libexecdir}/ovirt-config-collectd +%{_libexecdir}/ovirt-config-iscsi +%{_libexecdir}/ovirt-config-hostname +%{_libexecdir}/ovirt-config-logging +%{_libexecdir}/ovirt-config-networking +%{_libexecdir}/ovirt-config-password +%{_libexecdir}/ovirt-config-setup +%{_libexecdir}/ovirt-config-storage +%{_libexecdir}/ovirt-config-uninstall +%{_libexecdir}/ovirt-config-view-logs %{_sbindir}/ovirt-process-config %{_sbindir}/ovirt-install-node-stateless %{_sbindir}/gptsync @@ -312,7 +292,6 @@ fi %{_initrddir}/ovirt-firstboot %{_initrddir}/ovirt %{_initrddir}/ovirt-post -%attr(0644,root,root) %{_initrddir}/ovirt-functions %config %{_sysconfdir}/cron.hourly/ovirt-kinit %{_sysconfdir}/ovirt-early.d diff --git a/scripts/Makefile.am b/scripts/Makefile.am new file mode 100644 index 0000000..daf512c --- /dev/null +++ b/scripts/Makefile.am @@ -0,0 +1,46 @@ +# 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 + +dist_sbin_SCRIPTS = \ + ovirt-install-node-stateless \ + ovirt-process-config \ + persist \ + unpersist + +dist_libexec_SCRIPTS = \ + ovirt-functions \ + ovirt-config-boot \ + ovirt-config-boot-wrapper \ + ovirt-config-collectd \ + ovirt-config-hostname \ + ovirt-config-iscsi \ + ovirt-config-logging \ + ovirt-config-networking \ + ovirt-config-password \ + ovirt-config-setup \ + ovirt-config-storage \ + ovirt-config-uninstall \ + ovirt-config-view-logs + diff --git a/scripts/ovirt b/scripts/ovirt index d8d52cc..25b9860 100755 --- a/scripts/ovirt +++ b/scripts/ovirt @@ -11,7 +11,7 @@ # Source functions library . /etc/init.d/functions -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions prog=ovirt VAR_SUBSYS_OVIRT=/var/lock/subsys/$prog diff --git a/scripts/ovirt-awake b/scripts/ovirt-awake index 55db140..edef186 100755 --- a/scripts/ovirt-awake +++ b/scripts/ovirt-awake @@ -30,7 +30,7 @@ # config: /etc/sysconfig/node-config . /etc/init.d/functions -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions prog=ovirt-early NODE_CONFIG=/etc/sysconfig/node-config diff --git a/scripts/ovirt-config-boot b/scripts/ovirt-config-boot index fb956f3..d13dad2 100755 --- a/scripts/ovirt-config-boot +++ b/scripts/ovirt-config-boot @@ -17,7 +17,7 @@ # Source functions library . /etc/init.d/functions -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions trap '__st=$?; stop_log; exit $__st' 0 trap 'exit $?' 1 2 13 15 diff --git a/scripts/ovirt-config-boot-wrapper b/scripts/ovirt-config-boot-wrapper index 89f0fc0..118c59b 100755 --- a/scripts/ovirt-config-boot-wrapper +++ b/scripts/ovirt-config-boot-wrapper @@ -3,7 +3,7 @@ # Wrapper function to make sure the user wishes to continue before # rebooting the system -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions rc=0 while true; do @@ -26,7 +26,7 @@ continuing." fi if ask_yes_or_no "Do you wish to continue ([Y]es/[N]o)?"; then mount_live \ - && /usr/sbin/ovirt-config-boot /live "${bootparams}" + && /usr/libexec/ovirt-config-boot /live "${bootparams}" rc=$? break else diff --git a/scripts/ovirt-config-collectd b/scripts/ovirt-config-collectd index 1474bf5..af0770c 100755 --- a/scripts/ovirt-config-collectd +++ b/scripts/ovirt-config-collectd @@ -3,7 +3,7 @@ # Configures the collectd daemon. # Source functions library . /etc/init.d/functions -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions trap '__st=$?; stop_log; exit $__st' 0 trap 'exit $?' 1 2 13 15 diff --git a/scripts/ovirt-config-hostname b/scripts/ovirt-config-hostname index deb81bd..00d4214 100755 --- a/scripts/ovirt-config-hostname +++ b/scripts/ovirt-config-hostname @@ -3,7 +3,7 @@ # Configures the hostname file based on kernel cmdline or user prompt # Source functions library . /etc/init.d/functions -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions trap '__st=$?; stop_log; exit $__st' 0 trap 'exit $?' 1 2 13 15 diff --git a/scripts/ovirt-config-iscsi b/scripts/ovirt-config-iscsi index 8e1bbaf..621729e 100755 --- a/scripts/ovirt-config-iscsi +++ b/scripts/ovirt-config-iscsi @@ -3,7 +3,7 @@ # Configures the hostname file based on kernel cmdline or user prompt # Source functions library . /etc/init.d/functions -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions trap '__st=$?; stop_log; exit $__st' 0 trap 'exit $?' 1 2 13 15 diff --git a/scripts/ovirt-config-logging b/scripts/ovirt-config-logging index d8e5c95..f0f4040 100755 --- a/scripts/ovirt-config-logging +++ b/scripts/ovirt-config-logging @@ -3,7 +3,7 @@ # Configures the rsyslog daemon. # Source functions library . /etc/init.d/functions -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions trap '__st=$?; stop_log; exit $__st' 0 trap 'exit $?' 1 2 13 15 diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index ec154c2..18234c8 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -3,7 +3,7 @@ # Iterates over the list of network devices on the node and prompts the user # to configure each. -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions ME=$(basename "$0") warn() { printf '%s: %s\n' "$ME" "$*" >&2; } diff --git a/scripts/ovirt-config-password b/scripts/ovirt-config-password index e9789f8..cc45413 100755 --- a/scripts/ovirt-config-password +++ b/scripts/ovirt-config-password @@ -3,7 +3,7 @@ # Set the root password and others # Source functions library . /etc/init.d/functions -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions trap '__st=$?; stop_log; exit $__st' 0 trap 'exit $?' 1 2 13 15 diff --git a/scripts/ovirt-config-setup b/scripts/ovirt-config-setup index 4010828..145e568 100755 --- a/scripts/ovirt-config-setup +++ b/scripts/ovirt-config-setup @@ -3,7 +3,7 @@ # Entry point for configuring an oVirt node when running in standalone mode. -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions # symlinked scripts for menu options, link name is menu label CONFIG_DIR=/etc/ovirt-config-setup.d diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index be22ef6..529a5f4 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -6,7 +6,7 @@ # All sizes are in megabytes # -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions ME=$(basename "$0") warn() { printf '%s: %s\n' "$ME" "$*" >&2; } diff --git a/scripts/ovirt-config-uninstall b/scripts/ovirt-config-uninstall index 820eead..b8faa7b 100755 --- a/scripts/ovirt-config-uninstall +++ b/scripts/ovirt-config-uninstall @@ -6,7 +6,7 @@ # Destroys the HostVG volume group and logical volumes. # -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions ME=$(basename "$0") warn() { printf '%s: %s\n' "$ME" "$*" >&2; } diff --git a/scripts/ovirt-config-view-logs b/scripts/ovirt-config-view-logs index 70c5229..2faa92e 100755 --- a/scripts/ovirt-config-view-logs +++ b/scripts/ovirt-config-view-logs @@ -1,7 +1,7 @@ #!/bin/bash # -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions ME=$(basename "$0") warn() { printf '%s: %s\n' "$ME" "$*" >&2; } diff --git a/scripts/ovirt-early b/scripts/ovirt-early index 23c4f6e..d901afb 100755 --- a/scripts/ovirt-early +++ b/scripts/ovirt-early @@ -11,7 +11,7 @@ # Source functions library . /etc/init.d/functions -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions prog=ovirt-early VAR_SUBSYS_OVIRT_EARLY=/var/lock/subsys/$prog @@ -147,7 +147,7 @@ configure_management_interface() { "ovirt") configure_ovirt_management_nic $bootif if [ -n "$init" ]; then - ovirt-config-storage AUTO + /usr/libexec/ovirt-config-storage AUTO # initial configuration storage, after /config creation ovirt_store_config \ /etc/sysconfig/network-scripts/ifcfg-* \ @@ -155,7 +155,7 @@ configure_management_interface() { if [ $upgrade = 1 ]; then # local disk installation for managed mode mount_live - ovirt-config-boot /live "$bootparams" + /usr/libexec/ovirt-config-boot /live "$bootparams" fi fi ;; diff --git a/scripts/ovirt-firstboot b/scripts/ovirt-firstboot index b992909..fe8564c 100755 --- a/scripts/ovirt-firstboot +++ b/scripts/ovirt-firstboot @@ -25,7 +25,7 @@ ## Source functions library . /etc/init.d/functions -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions prog=ovirt-firstboot lockfile=/var/lock/subsys/$prog @@ -46,17 +46,17 @@ start () chkconfig collectd off if is_auto_install; then - ovirt-config-storage AUTO - ovirt-config-hostname AUTO - ovirt-config-networking AUTO - ovirt-config-logging AUTO - ovirt-config-collectd AUTO - ovirt-config-password AUTO + /usr/libexec/ovirt-config-storage AUTO + /usr/libexec/ovirt-config-hostname AUTO + /usr/libexec/ovirt-config-networking AUTO + /usr/libexec/ovirt-config-logging AUTO + /usr/libexec/ovirt-config-collectd AUTO + /usr/libexec/ovirt-config-password AUTO fi if is_upgrade; then mount_live - ovirt-config-boot /live "$OVIRT_BOOTPARAMS" no + /usr/libexec/ovirt-config-boot /live "$OVIRT_BOOTPARAMS" no disable_firstboot reboot return @@ -65,7 +65,7 @@ start () if is_firstboot; then plymouth --hide-splash - ovirt-config-setup -x < /dev/console + /usr/libexec/ovirt-config-setup -x < /dev/console plymouth --show-splash fi diff --git a/scripts/ovirt-install-node-stateful b/scripts/ovirt-install-node-stateful index d16b42d..3c123ef 100755 --- a/scripts/ovirt-install-node-stateful +++ b/scripts/ovirt-install-node-stateful @@ -3,7 +3,7 @@ PHYS_HOST=physical.priv.ovirt.org MGMT_HOST=management.priv.ovirt.org -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions PATH=$PATH:/sbin:/usr/sbin ME=$(basename "$0") diff --git a/scripts/ovirt-install-node-stateless b/scripts/ovirt-install-node-stateless index cceb048..d58820c 100755 --- a/scripts/ovirt-install-node-stateless +++ b/scripts/ovirt-install-node-stateless @@ -1,6 +1,6 @@ #!/bin/bash -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions PATH=$PATH:/sbin:/usr/sbin ME=$(basename "$0") diff --git a/scripts/ovirt-post b/scripts/ovirt-post index 951d108..70ed3c4 100755 --- a/scripts/ovirt-post +++ b/scripts/ovirt-post @@ -11,7 +11,7 @@ # Source functions library . /etc/init.d/functions -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions prog=ovirt-post VAR_SUBSYS_OVIRT_POST=/var/lock/subsys/$prog diff --git a/scripts/ovirt-process-config b/scripts/ovirt-process-config index 877c412..6011cd7 100755 --- a/scripts/ovirt-process-config +++ b/scripts/ovirt-process-config @@ -5,7 +5,7 @@ # configuration file. It then restarts the networking service # and saves the configuration files. -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions ME=$(basename "$0") warn() { printf '%s: %s\n' "$ME" "$*" >&2; } diff --git a/scripts/ovirt-uninstall-node-stateful b/scripts/ovirt-uninstall-node-stateful index 5dd03ba..ca5b50f 100755 --- a/scripts/ovirt-uninstall-node-stateful +++ b/scripts/ovirt-uninstall-node-stateful @@ -1,6 +1,6 @@ #!/bin/bash -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions PATH=$PATH:/sbin:/usr/sbin ME=$(basename "$0") diff --git a/scripts/persist b/scripts/persist index 85a022e..a6818da 100755 --- a/scripts/persist +++ b/scripts/persist @@ -19,9 +19,9 @@ # also available at http://www.gnu.org/copyleft/gpl.html. # # Convenience wrapper to give access to the ovirt_store_config -# function in /etc/init.d/ovirt-functions +# function in /usr/libexec/ovirt-functions -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions ME=$(basename "$0") warn() { printf '%s: %s\n' "$ME" "$*" >&2; } diff --git a/scripts/unpersist b/scripts/unpersist index b0df524..62ed87d 100755 --- a/scripts/unpersist +++ b/scripts/unpersist @@ -19,9 +19,9 @@ # also available at http://www.gnu.org/copyleft/gpl.html. # # Convenience wrapper to give access to the ovirt_store_config -# function in /etc/init.d/ovirt-functions +# function in /usr/libexec/ovirt-functions -. /etc/init.d/ovirt-functions +. /usr/libexec/ovirt-functions ME=$(basename "$0") warn() { printf '%s: %s\n' "$ME" "$*" >&2; } diff --git a/tools/Makefile.am b/tools/Makefile.am new file mode 100644 index 0000000..1b4e427 --- /dev/null +++ b/tools/Makefile.am @@ -0,0 +1,23 @@ +# 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 -- 1.6.6 From dpierce at redhat.com Tue Feb 23 15:15:43 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 23 Feb 2010 10:15:43 -0500 Subject: [Ovirt-devel] Thinking about a more generic node... Message-ID: <20100223151543.GB2736@mcpierce-desktop.usersys.redhat.com> So in working on making the node more generic, I've initially taken on the startup processes. Right now I have patches that I'm finishing which will give a more generic way of performing the following functions: * AWAKE - notify the management system the node is awake * READY - notify the management system the node is ready to perform tasks and run VMS * OFFLINE - notify the management system the node is going offline What are other points we need to consider regarding the node's state and lifecycle? I'm looking to explore what should be our initial set of generic APIs that a management system would want to have available on a node to make use of it. Ideas? -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Tue Feb 23 15:33:07 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 23 Feb 2010 10:33:07 -0500 Subject: [Ovirt-devel] [PATCH] Supports setting the OVIRT_RUNTIME_MODE value from the kernel cmdline. Message-ID: <1266939187-24432-1-git-send-email-dpierce@redhat.com> This argument should override what is defined in the /etc/sysconfig/node-config file if the karg is present. Signed-off-by: Darryl L. Pierce --- scripts/ovirt-early | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-early b/scripts/ovirt-early index c3befdc..977d058 100755 --- a/scripts/ovirt-early +++ b/scripts/ovirt-early @@ -182,6 +182,7 @@ start() { # ovirt_upgrade # ovirt_standalone # ovirt_firstboot + # ovirt_runtime_mode # rescue # pxelinux format: ip=::: # anaconda format: ip= netmask= gateway= @@ -243,6 +244,10 @@ start() { # in auto-install mode, overwrite the disk chosen by ovirt_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= @@ -362,6 +367,11 @@ start() { ovirt_firstboot*) firstboot=1 ;; + + ovirt_runtime_mode*) + ovirt_runtime_mode=i=${i#ovirt_runtime_mode=} + ;; + rescue) rescue=1 ;; @@ -434,7 +444,7 @@ start() { ip_gateway=$gateway fi # save boot parameters as defaults for ovirt-config-* - params="bootif init vol_boot_size vol_swap_size vol_root_size vol_config_size vol_logging_size vol_data_size 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" + params="bootif init vol_boot_size vol_swap_size vol_root_size vol_config_size vol_logging_size vol_data_size 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 runtime_mode" # mount /config unless firstboot is forced if [ "$firstboot" != "1" ]; then mount_config -- 1.6.6 From dpierce at redhat.com Tue Feb 23 17:07:56 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 23 Feb 2010 12:07:56 -0500 Subject: [Ovirt-devel] Freezing Rails in ovirt-server... Message-ID: <20100223170756.GE2736@mcpierce-desktop.usersys.redhat.com> The ovirt-server package has started to slip behind the curve WRT Ruby on Rails development; i.e., the current version of ovirt-server is not quite runnable as is on F12. And with F13 coming, the gap's only going to widen. So I'm considering the idea of freezing the version of Rails on the ovirt-server project for the time being. I'll check with the Fedora packaging team to see if there are any issues. Thoughts? -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Tue Feb 23 19:38:25 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 23 Feb 2010 14:38:25 -0500 Subject: [Ovirt-devel] Updated patch... Message-ID: <1266953906-14624-1-git-send-email-dpierce@redhat.com> Fixes a typo found by aclement. From dpierce at redhat.com Tue Feb 23 19:38:26 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Tue, 23 Feb 2010 14:38:26 -0500 Subject: [Ovirt-devel] [PATCH] Supports setting the OVIRT_RUNTIME_MODE value from the kernel cmdline. In-Reply-To: <1266953906-14624-1-git-send-email-dpierce@redhat.com> References: <1266953906-14624-1-git-send-email-dpierce@redhat.com> Message-ID: <1266953906-14624-2-git-send-email-dpierce@redhat.com> This argument should override what is defined in the /etc/sysconfig/node-config file if the karg is present. Signed-off-by: Darryl L. Pierce --- scripts/ovirt-early | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-early b/scripts/ovirt-early index c3befdc..71d5a0c 100755 --- a/scripts/ovirt-early +++ b/scripts/ovirt-early @@ -182,6 +182,7 @@ start() { # ovirt_upgrade # ovirt_standalone # ovirt_firstboot + # ovirt_runtime_mode # rescue # pxelinux format: ip=::: # anaconda format: ip= netmask= gateway= @@ -243,6 +244,10 @@ start() { # in auto-install mode, overwrite the disk chosen by ovirt_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= @@ -362,6 +367,11 @@ start() { ovirt_firstboot*) firstboot=1 ;; + + runtime_mode*) + runtime_mode=${i#runtime_mode=} + ;; + rescue) rescue=1 ;; @@ -434,7 +444,7 @@ start() { ip_gateway=$gateway fi # save boot parameters as defaults for ovirt-config-* - params="bootif init vol_boot_size vol_swap_size vol_root_size vol_config_size vol_logging_size vol_data_size 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" + params="bootif init vol_boot_size vol_swap_size vol_root_size vol_config_size vol_logging_size vol_data_size 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 runtime_mode" # mount /config unless firstboot is forced if [ "$firstboot" != "1" ]; then mount_config -- 1.6.6 From pmialon at linagora.com Wed Feb 24 09:10:59 2010 From: pmialon at linagora.com (Pierre-Gilles Mialon) Date: Wed, 24 Feb 2010 10:10:59 +0100 Subject: [Ovirt-devel] Freezing Rails in ovirt-server... In-Reply-To: <20100223170756.GE2736@mcpierce-desktop.usersys.redhat.com> References: <20100223170756.GE2736@mcpierce-desktop.usersys.redhat.com> Message-ID: <201002241010.59853.pmialon@linagora.com> Le mardi 23 f?vrier 2010 18:07:56 Darryl L. Pierce, vous avez ?crit : > The ovirt-server package has started to slip behind the curve WRT Ruby > on Rails development; i.e., the current version of ovirt-server is not > quite runnable as is on F12. And with F13 coming, the gap's only going > to widen. Do you have an idea of the time needed to make the ovirt-server following F12 or F13 (both case). We would help on this subject, please could you precise the difficulty that you see. > So I'm considering the idea of freezing the version of Rails on the > ovirt-server project for the time being. I'll check with the Fedora > packaging team to see if there are any issues. > > Thoughts? :-( a project that stop to run, never win the race ... -- Pierre-Gilles Mialon Responsable h?bergement :: Head of Hosting services pmialon at linagora.com :: +33.1 58 18 65 46 Linagora :: http://www.linagora.com 27 rue de Berri :: 75008 PARIS -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From dpierce at redhat.com Wed Feb 24 13:08:28 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 24 Feb 2010 08:08:28 -0500 Subject: [Ovirt-devel] Freezing Rails in ovirt-server... In-Reply-To: <201002241010.59853.pmialon@linagora.com> References: <20100223170756.GE2736@mcpierce-desktop.usersys.redhat.com> <201002241010.59853.pmialon@linagora.com> Message-ID: <20100224130828.GD11720@mcpierce-desktop.usersys.redhat.com> On Wed, Feb 24, 2010 at 10:10:59AM +0100, Pierre-Gilles Mialon wrote: > Do you have an idea of the time needed to make the ovirt-server following F12 > or F13 (both case). > We would help on this subject, please could you precise the difficulty that > you see. I'd estimate the upgrade the ovirt-server to F12 would be about one man-week of effort to complete. > > So I'm considering the idea of freezing the version of Rails on the > > ovirt-server project for the time being. I'll check with the Fedora > > packaging team to see if there are any issues. > > > > Thoughts? > > :-( a project that stop to run, never win the race ... Very true. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From pmialon at linagora.com Wed Feb 24 13:15:48 2010 From: pmialon at linagora.com (Pierre-Gilles Mialon) Date: Wed, 24 Feb 2010 14:15:48 +0100 Subject: [Ovirt-devel] Freezing Rails in ovirt-server... In-Reply-To: <20100224130828.GD11720@mcpierce-desktop.usersys.redhat.com> References: <20100223170756.GE2736@mcpierce-desktop.usersys.redhat.com> <201002241010.59853.pmialon@linagora.com> <20100224130828.GD11720@mcpierce-desktop.usersys.redhat.com> Message-ID: <201002241417.26835.pmialon@linagora.com> Le mercredi 24 f?vrier 2010 14:08:28 Darryl L. Pierce, vous avez ?crit : > On Wed, Feb 24, 2010 at 10:10:59AM +0100, Pierre-Gilles Mialon wrote: > > Do you have an idea of the time needed to make the ovirt-server following > > F12 or F13 (both case). > > We would help on this subject, please could you precise the difficulty > > that you see. > > I'd estimate the upgrade the ovirt-server to F12 would be about one > man-week of effort to complete. And for F13 is it the same ? We have already started on this subject but the node are today our main target. Since F13 is frozen, would it be preferable to focus on it ? > > > So I'm considering the idea of freezing the version of Rails on the > > > ovirt-server project for the time being. I'll check with the Fedora > > > packaging team to see if there are any issues. > > > > > > Thoughts? -- Pierre-Gilles Mialon Responsable h?bergement :: Head of Hosting services pmialon at linagora.com :: +33.1 58 18 65 46 Linagora :: http://www.linagora.com 27 rue de Berri :: 75008 PARIS -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. URL: From dpierce at redhat.com Wed Feb 24 13:38:03 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 24 Feb 2010 08:38:03 -0500 Subject: [Ovirt-devel] Freezing Rails in ovirt-server... In-Reply-To: <201002241417.26835.pmialon@linagora.com> References: <20100223170756.GE2736@mcpierce-desktop.usersys.redhat.com> <201002241010.59853.pmialon@linagora.com> <20100224130828.GD11720@mcpierce-desktop.usersys.redhat.com> <201002241417.26835.pmialon@linagora.com> Message-ID: <20100224133802.GE11720@mcpierce-desktop.usersys.redhat.com> On Wed, Feb 24, 2010 at 02:15:48PM +0100, Pierre-Gilles Mialon wrote: > > > Do you have an idea of the time needed to make the ovirt-server following > > > F12 or F13 (both case). > > > We would help on this subject, please could you precise the difficulty > > > that you see. > > > > I'd estimate the upgrade the ovirt-server to F12 would be about one > > man-week of effort to complete. > > And for F13 is it the same ? I'm not sure. I haven't looked at what version of Rails is in Rawhide, nor what differences there are between 2.3.4 and that version. > We have already started on this subject but the node are today our main > target. > > Since F13 is frozen, would it be preferable to focus on it ? Well, we _should_ try to support F12 as well as F13, but for progress I'd be happier with targeting F13 and then backporting things to F12 as needed. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Wed Feb 24 15:36:45 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 24 Feb 2010 10:36:45 -0500 Subject: [Ovirt-devel] Replacement patch... Message-ID: <1267025806-15893-1-git-send-email-dpierce@redhat.com> This patch supercedes the previous patch by refactoring how defaults and then kernel argument values are loaded during startup. From dpierce at redhat.com Wed Feb 24 15:36:46 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 24 Feb 2010 10:36:46 -0500 Subject: [Ovirt-devel] [PATCH] Supports setting the OVIRT_RUNTIME_MODE value from the kernel cmdline. In-Reply-To: <1267025806-15893-1-git-send-email-dpierce@redhat.com> References: <1267025806-15893-1-git-send-email-dpierce@redhat.com> Message-ID: <1267025806-15893-2-git-send-email-dpierce@redhat.com> This argument should override what is defined in the /etc/sysconfig/node-config file if the karg is present. Refactored how the node default configuration and kernel argument overrides are loaded as well. Signed-off-by: Darryl L. Pierce --- scripts/ovirt | 3 --- scripts/ovirt-awake | 4 ---- scripts/ovirt-early | 15 +++++++++++---- scripts/ovirt-functions | 13 +++++++++---- scripts/ovirt-post | 3 --- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/scripts/ovirt b/scripts/ovirt index d8d52cc..38ea7ac 100755 --- a/scripts/ovirt +++ b/scripts/ovirt @@ -16,9 +16,6 @@ prog=ovirt VAR_SUBSYS_OVIRT=/var/lock/subsys/$prog -# load the configuration file -[ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" - ovirt_start() { if is_standalone; then return 0 diff --git a/scripts/ovirt-awake b/scripts/ovirt-awake index 55db140..dd03160 100755 --- a/scripts/ovirt-awake +++ b/scripts/ovirt-awake @@ -33,12 +33,8 @@ . /etc/init.d/ovirt-functions prog=ovirt-early -NODE_CONFIG=/etc/sysconfig/node-config VAR_SUBSYS_NODECONFIG=/var/lock/subsys/node-config -# load the configuration file -[ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" - send_text () { local text=${1} diff --git a/scripts/ovirt-early b/scripts/ovirt-early index c3befdc..066ce38 100755 --- a/scripts/ovirt-early +++ b/scripts/ovirt-early @@ -16,9 +16,6 @@ prog=ovirt-early VAR_SUBSYS_OVIRT_EARLY=/var/lock/subsys/$prog -# load the configuration file -[ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" - BONDING_MODCONF_FILE=/etc/modprobe.d/bonding AUGTOOL_CONFIG=/var/tmp/augtool-config EARLY_DIR=/etc/ovirt-early.d @@ -182,6 +179,7 @@ start() { # ovirt_upgrade # ovirt_standalone # ovirt_firstboot + # ovirt_runtime_mode # rescue # pxelinux format: ip=::: # anaconda format: ip= netmask= gateway= @@ -243,6 +241,10 @@ start() { # in auto-install mode, overwrite the disk chosen by ovirt_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= @@ -362,6 +364,11 @@ start() { ovirt_firstboot*) firstboot=1 ;; + + runtime_mode*) + runtime_mode=${i#runtime_mode=} + ;; + rescue) rescue=1 ;; @@ -434,7 +441,7 @@ start() { ip_gateway=$gateway fi # save boot parameters as defaults for ovirt-config-* - params="bootif init vol_boot_size vol_swap_size vol_root_size vol_config_size vol_logging_size vol_data_size 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" + params="bootif init vol_boot_size vol_swap_size vol_root_size vol_config_size vol_logging_size vol_data_size 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 runtime_mode" # mount /config unless firstboot is forced if [ "$firstboot" != "1" ]; then mount_config diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index ff2b016..30987fe 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -6,11 +6,16 @@ _log_status=1 # label of the oVirt partition OVIRT_LABEL=OVIRT -# configuration defaults + +# 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 $OVIRT_DEFAULTS ]; then - . $OVIRT_DEFAULTS -fi + +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} diff --git a/scripts/ovirt-post b/scripts/ovirt-post index 951d108..2f1a23e 100755 --- a/scripts/ovirt-post +++ b/scripts/ovirt-post @@ -16,9 +16,6 @@ prog=ovirt-post VAR_SUBSYS_OVIRT_POST=/var/lock/subsys/$prog -# load the configuration file -[ -f "$NODE_CONFIG" ] && . "$NODE_CONFIG" - start() { # wait for libvirt to finish initializing local count=0 -- 1.6.6 From mburns at redhat.com Wed Feb 24 17:43:55 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Feb 2010 12:43:55 -0500 Subject: [Ovirt-devel] New Storage related patches Message-ID: <1267033435.3262.4.camel@localhost.localdomain> This set of patches introduces support for multipath devices for storage. Comments and suggestions are appreciated. Mike From dpierce at redhat.com Wed Feb 24 17:47:21 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 24 Feb 2010 12:47:21 -0500 Subject: [Ovirt-devel] Freezing Rails in ovirt-server... In-Reply-To: <20100223170756.GE2736@mcpierce-desktop.usersys.redhat.com> References: <20100223170756.GE2736@mcpierce-desktop.usersys.redhat.com> Message-ID: <20100224174721.GM2736@mcpierce-desktop.usersys.redhat.com> On Tue, Feb 23, 2010 at 12:07:56PM -0500, Darryl L. Pierce wrote: > The ovirt-server package has started to slip behind the curve WRT Ruby > on Rails development; i.e., the current version of ovirt-server is not > quite runnable as is on F12. And with F13 coming, the gap's only going > to widen. F13 will be based on Rails 2.3.5. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From mburns at redhat.com Wed Feb 24 17:47:47 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Feb 2010 12:47:47 -0500 Subject: [Ovirt-devel] [PATCH node 1/5] Initial multipath stuff In-Reply-To: <1267033435.3262.4.camel@localhost.localdomain> References: <1267033435.3262.4.camel@localhost.localdomain> Message-ID: <1267033671-25516-1-git-send-email-mburns@redhat.com> Includes choosing device to install to ovirt-node-image stuff fix autoinstall to translate ovirt_init param Add manual device option Signed-off-by: Mike Burns --- recipe/common-install.ks | 4 + recipe/common-post.ks | 11 +++ scripts/ovirt-config-storage | 171 ++++++++++++++++++++++++++++++++++++++---- scripts/ovirt-functions | 6 +- 4 files changed, 174 insertions(+), 18 deletions(-) diff --git a/recipe/common-install.ks b/recipe/common-install.ks index f3443b6..5c1e239 100644 --- a/recipe/common-install.ks +++ b/recipe/common-install.ks @@ -18,3 +18,7 @@ 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 diff --git a/recipe/common-post.ks b/recipe/common-post.ks index 0f09581..293c341 100644 --- a/recipe/common-post.ks +++ b/recipe/common-post.ks @@ -152,6 +152,7 @@ rm -f /etc/cron.daily/logrotate touch /var/lib/random-seed mkdir /live mkdir /boot +mkdir -p /var/cache/multipathd sed -i '/^files \/etc*/ s/^/#/' /etc/rwtab cat > /etc/rwtab.d/ovirt < /etc/multipath.conf + +#lvm.conf should use /dev/mapper and /dev/sdX devices +# and not /dev/dm-X devices +sed -i 's/preferred_names = \[ \]/preferred_names = [ "^\/dev\/mapper", "^\/dev\/[hsv]d" ]/g' /etc/lvm/lvm.conf diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index be22ef6..c3715fb 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -34,6 +34,68 @@ logging_min_size=5 data_min_size=5 swap_min_size=5 +# return sd name for given #:# identifier +get_sd_name() { + local id=$1 + local device_var=$2 + for device in $(ls /sys/block) + do + if [[ $id = $(cat /sys/block/$device/dev) ]]; then + eval $device_var=$device + return + fi + done + eval $device_var=1 +} + +# gets the dependent block devices for multipath devices +get_multipath_devices() { + local mpath_device=mpath-$(basename $1) + local deplist_var=$2 + local deplist="" + + #get dependencies for multipath device + local deps=$(dmsetup deps -u $mpath_device \ + | sed -r 's/\(([0-9]+), ([0-9]+)\)/\1:\2/g' \ + | sed 's/ /\n/g' | grep [0-9]:[0-9] ) + + local device="" + for dep in $deps + do + local device="" + get_sd_name $dep device + if [[ ! $device = 1 ]]; then + if [[ $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 mpath_var=$2 + + local basedev=$(basename $dev) + + local mpath_device=$(multipath -ll $dev |grep -n . | \ + grep "^1:" |awk '{print $1}' | sed 's/^1:/\/dev\/mapper\//g') + + if [ -z "$mpath_device" ]; then + mpath_device=$dev + fi + + eval $mpath_var=$mpath_device +} + + get_drive_size() { local drive=$1 @@ -53,8 +115,12 @@ get_drive_size() fi if [ -z "$udi" ]; then # If hal didn't find the device, it could be a virtio block device + # or a multipath device # In this case, use sfdisk -s to get the size - size=$(sfdisk -s $drive) + size=$(sfdisk -s $drive 2>/dev/null) + if [ -z "$size" ]; then + size=0 + fi size=$(echo "scale=0; $size * 1024" | bc -l) else size=$(hal-get-property --udi "$udi" --key storage.size) @@ -69,7 +135,7 @@ get_drive_size() size=$(echo "scale=0; $size / (1024 * 1024)" | bc -l) echo "$drive ($size MB)" - echo "Disk Identifier: $(basename "$udi")" + test -z "$udi" || echo "Disk Identifier: $(basename "$udi")" if [ -n "$space_var" ]; then eval $space_var=$size fi @@ -151,6 +217,29 @@ check_partition_sizes() return $rc } +manual_input() +{ + local manual_device + local return_var=$1 + while true; do + read -rp "Enter disk device path: " manual_device + if [ -z "$device" ]; then + return 1 + fi + translate_multipath_device $manual_device manual_device + eval $return_var="$manual_device" + if [ -n "$manual_device" ]; then + if [ -b "$(readlink -f $device)" ]; then + return 0 + fi + else + echo "Aborting." + 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). @@ -161,7 +250,7 @@ check_partition_sizes() get_dev_name() { local udi_list=$(hal-find-by-capability --capability storage) - local byid_list=$(find /dev/disk/by-id -mindepth 1 -not -name '*-part*') + local byid_list=$(find /dev/disk/by-id -mindepth 1 -not -name '*-part*' 2>/dev/null) if test -z "$udi_list" -a -z "$byid_list"; then warn "ERROR: no usable storage devices detected" return 1 @@ -193,7 +282,33 @@ get_dev_name() # FIXME: workaround for detecting virtio block devices devices="$devices $(ls /dev/vd? 2> /dev/null | xargs)" - devices=$(echo $devices | tr ' ' '\n' | sort -u | xargs) + + # FIXME: workaround for detecting cciss devices + for dev in $(ls /dev/cciss 2>/dev/null); do + if [[ ! $dev =~ p[0-9]+\$ ]]; then + devices="$devices /dev/cciss/dev" + fi + done + + # Include mulitpath devices + local devs_to_remove + for dev in $(dmsetup ls --target=multipath | awk '{print $1}'); do + devices="$devices /dev/mapper/$dev" + local sd_devs="" + get_multipath_devices $dev sd_devs + devs_to_remove="${devs_to_remove} ${sd_devs}" + done + + # Remove /dev/sd* devices that are part of a multipath device + local dev_list + for dev in $devices + do + if [[ ! "$devs_to_remove" =~ "$(basename $dev)" ]]; then + dev_list="$dev_list $dev" + fi + done + + devices=$(echo $dev_list | tr ' ' '\n' | sort -u | xargs) local num_devices=$(echo "$devices" | wc -w) # If there's only one device, use it. @@ -209,9 +324,10 @@ get_dev_name() get_drive_size $d >&2 done local choices="$devices Abort" - select device in $choices + select device in $choices "Manual Selection" do test "$device" = Abort && return 1 + test "$device" = "Manual selection" && manual_input device test -z "$device" && continue echo "$device" return 0 @@ -375,6 +491,17 @@ wipe_lvm_on_disk() done } + +reread_partitions() +{ + local drive=$1 + if [[ $drive =~ "^/dev/mapper" ]]; then + kpartx -a -p p $drive + else + blockdev --rereadpt $drive + fi +} + perform_partitioning() { if [[ -z "$HOSTVGDRIVE" && "$OVIRT_ISCSI_ENABLED" != "y" ]]; then @@ -404,15 +531,20 @@ perform_partitioning() log "Partitioning drive: $BOOTDRIVE" log "Wiping old boot sector" dd if=/dev/zero of=$BOOTDRIVE bs=1024K count=1 - blockdev --rereadpt $BOOTDRIVE + reread_partitions $BOOTDRIVE partprobe -s $BOOTDRIVE log "Creating boot partition" parted $BOOTDRIVE -s "mklabel ${LABEL_TYPE}" parted $BOOTDRIVE -s "mkpartfs primary ext2 0M ${boot_size_si}M" + reread_partitions $BOOTDRIVE + partboot=$BOOTDRIVE1 + if [ ! -e $partboot ]; then + partboot=${BOOTDRIVE}p1 + fi # sleep to ensure filesystems are created before continuing sleep 10 - mke2fs ${BOOTDRIVE}1 -L Boot - tune2fs -c 0 -i 0 ${BOOTDRIVE}1 + mke2fs ${partboot} -L Boot + tune2fs -c 0 -i 0 ${partboot} log "Completed!" return fi @@ -422,7 +554,7 @@ perform_partitioning() # FIXME: save a backup copy, just in case? log "Wiping old boot sector" dd if=/dev/zero of=$ROOTDRIVE bs=1024K count=1 - blockdev --rereadpt $ROOTDRIVE + reread_partitions $ROOTDRIVE partprobe -s $ROOTDRIVE log "Labeling Drive: $ROOTDRIVE" parted $ROOTDRIVE -s "mklabel ${LABEL_TYPE}" @@ -435,12 +567,19 @@ perform_partitioning() let RootBackup_end=${ROOT_SIZE}*2 parted $ROOTDRIVE -s "mkpart primary ext2 0M ${ROOT_SIZE}M" parted $ROOTDRIVE -s "mkpart primary ext2 ${ROOT_SIZE}M ${RootBackup_end}M" + reread_partitions $ROOTDRIVE + partroot=${ROOTDRIVE}1 + partrootbackup=${ROOTDRIVE}2 + if [ ! -e $partroot ]; then + partroot=${ROOTDRIVE}p1 + partrootbackup=${ROOTDRIVE}p2 + fi # sleep to ensure filesystems are created before continuing sleep 10 - mke2fs ${ROOTDRIVE}1 -L Root - mke2fs ${ROOTDRIVE}2 -L RootBackup - tune2fs -c 0 -i 0 ${ROOTDRIVE}1 - tune2fs -c 0 -i 0 ${ROOTDRIVE}2 + mke2fs ${partroot} -L Root + mke2fs ${partrootbackup} -L RootBackup + tune2fs -c 0 -i 0 ${partroot} + tune2fs -c 0 -i 0 ${partrootbackup} log "Creating LVM partition" if [ $ROOTDRIVE == $HOSTVGDRIVE ]; then @@ -454,6 +593,7 @@ perform_partitioning() parted $HOSTVGDRIVE -s "set $hostvgpart lvm on" parted $ROOTDRIVE -s "print" udevadm settle 2> /dev/null || udevsettle + reread_partitions $HOSTVGDRIVE # sync GPT to the legacy MBR partitions if [ "gpt" == "$LABEL_TYPE" ]; then @@ -702,8 +842,9 @@ DATA_SIZE=${OVIRT_VOL_DATA_SIZE:-$default_data_size} if [ -n "$OVIRT_INIT" ]; then # if present, use the drive selected with 'ovirt_init' boot parameter # setting these the same until kernel cmdline argument implemented - ROOTDRIVE=$OVIRT_INIT - HOSTVGDRIVE=$OVIRT_INIT + translate_multipath_device $OVIRT_INIT DRIVE + ROOTDRIVE=$DRIVE + HOSTVGDRIVE=$DRIVE get_drive_size $ROOTDRIVE ROOTDRIVESPACE fi diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index ff2b016..4027613 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -332,7 +332,7 @@ unmount_logging_services() { cd /etc/init.d for prg in $(lsof -Fc +D /var/log|grep ^c|sort -u); do srv=$(grep -l ${prg#c}$ *) - service $srv stop + service $srv stop 6>&- 7>&- services="$services $srv" done # debugging help @@ -364,7 +364,7 @@ mount_logging() { rmdir $log2 restorecon -rv /var/log for srv in $services; do - service $srv start + service $srv start 6>&- 7>&- done return 0 @@ -392,7 +392,7 @@ unmount_logging() { return $rc fi for srv in $services; do - service $srv start + service $srv start 6>&- 7>&- done return 0 -- 1.6.6.1 From mburns at redhat.com Wed Feb 24 17:47:48 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Feb 2010 12:47:48 -0500 Subject: [Ovirt-devel] [PATCH node 2/5] Check for negative data partition with default storage config In-Reply-To: <1267033435.3262.4.camel@localhost.localdomain> References: <1267033435.3262.4.camel@localhost.localdomain> Message-ID: <1267033671-25516-2-git-send-email-mburns@redhat.com> If the data partition is a negative size, don't offer default sizes. Instead force the user to enter partition sizes Signed-off-by: Mike Burns --- scripts/ovirt-config-storage | 28 ++++++++++++++++++---------- 1 files changed, 18 insertions(+), 10 deletions(-) diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index c3715fb..a16126c 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -17,7 +17,7 @@ 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 local storage." + die "You cannot configure storage on a running system. Please boot from CD/USB to configure storage." fi default_overcommit=0.5 @@ -361,9 +361,12 @@ do_configure() 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" - do_review - if ask_yes_or_no "Use these default values ([Y]es/[N]o)?"; then - return + 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 @@ -438,8 +441,9 @@ do_review() { if [[ -z "$ROOTDRIVE" && "$OVIRT_ISCSI_ENABLED" != "y" ]]; then printf "\nNo Root storage device selected.\n" - return + return 1 fi + local is_negative=0 if [ "$OVIRT_ISCSI_ENABLED" != "y" ]; then local data_size_display="$DATA_SIZE MB" @@ -448,15 +452,17 @@ do_review() 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 cat < References: <1267033435.3262.4.camel@localhost.localdomain> Message-ID: <1267033671-25516-5-git-send-email-mburns@redhat.com> Don't try to kill plymouth if it's already dead Signed-off-by: Mike Burns --- scripts/ovirt-functions | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions index 4027613..1db89ae 100644 --- a/scripts/ovirt-functions +++ b/scripts/ovirt-functions @@ -382,8 +382,9 @@ unmount_logging() { log "Unmounting log partition" # plymouthd keeps /var/log/boot.log - plymouth --quit - plymouth --wait + if plymouth --ping ; then + plymouth --quit + fi unmount_logging_services umount /var/log -- 1.6.6.1 From mburns at redhat.com Wed Feb 24 17:47:50 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Feb 2010 12:47:50 -0500 Subject: [Ovirt-devel] [PATCH node 4/5] update uninstall steps to handle multipath In-Reply-To: <1267033435.3262.4.camel@localhost.localdomain> References: <1267033435.3262.4.camel@localhost.localdomain> Message-ID: <1267033671-25516-4-git-send-email-mburns@redhat.com> Signed-off-by: Mike Burns --- scripts/ovirt-config-uninstall | 51 +++++++++++++++++++++++++++------------ 1 files changed, 35 insertions(+), 16 deletions(-) diff --git a/scripts/ovirt-config-uninstall b/scripts/ovirt-config-uninstall index 820eead..a2c9b3c 100755 --- a/scripts/ovirt-config-uninstall +++ b/scripts/ovirt-config-uninstall @@ -29,24 +29,43 @@ EOF if ask_yes_or_no "Do you wish to continue and uninstall this node ([Y]es/[N]o)?"; then if [ -d /dev/HostVG ]; then - log "Uninstalling node" - log "Detaching logging" - unmount_logging - log "Removing volume group" - wipe_volume_group "HostVG" - partition=$(findfs LABEL=Root) - if [ -n "$partition" ]; then - log "Removing partitions" - drive=$(echo $partition | awk '{ print substr($0, 1, length($0) - 1) }') - parted -s $drive "rm 1" - parted -s $drive "rm 2" + 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 + log "Removing volume group" + wipe_volume_group "HostVG" + partition=$(readlink -f $(findfs LABEL=Root)) + if [ -n "$partition" ]; then + log "Removing partitions" + eval $(echo $partition | awk ' { + print "drive=" substr($0,1,length($1)-1); + print "drive2=" substr($0,1,length($1)-2); + }') + if [ ! -e "$drive" ]; then + drive="$drive2" + partpv="$drive}p2" + else + partpv="${drive}2" + fi + parted -s $drive "rm 1" + pvremove ${partpv} + parted -s $drive "rm 2" parted -s $drive "rm 3" - fi - printf "Finished uninstalling node." + fi + #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 + log "There is no installed node instance to remove." + log "Aborting" + exit 1 fi else log "Aborted" -- 1.6.6.1 From mburns at redhat.com Wed Feb 24 17:47:49 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Feb 2010 12:47:49 -0500 Subject: [Ovirt-devel] [PATCH node 3/5] Handle existing HostVGs on the storage In-Reply-To: <1267033435.3262.4.camel@localhost.localdomain> References: <1267033435.3262.4.camel@localhost.localdomain> Message-ID: <1267033671-25516-3-git-send-email-mburns@redhat.com> Allow the user to install on a device that already contains HostVG. Fail install if HostVG exists on a different drive. Signed-off-by: Mike Burns --- scripts/ovirt-config-storage | 81 +++++++++++++++++++++++++++++++++++++---- 1 files changed, 73 insertions(+), 8 deletions(-) diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index a16126c..44389f3 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -349,6 +349,24 @@ do_configure() printf "\n\nPlease select the disk to use for the HostVG.\n\n" HOSTVGDRIVE=$(get_dev_name) || return 0 + local skipped=false + if check_existing_hostvg $HOSTVGDRIVE devs; then + 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 + return 1 + fi + stop_log + else + skipped=true + fi + done + fi + $skipped && printf "Installation cannot proceed with existing HostVG.\n" && return 0 get_drive_size $HOSTVGDRIVE HOSTVGDRIVESPACE echo $HOSTVGDRIVESPACE fi @@ -488,15 +506,59 @@ EOF return ${is_negative-0} } +#Check for an existing HostVG on any device on the system. +# Return 0 if then is a HostVG found, unless only one found is on $1 +# Return 1 if no HostVG found or only found on $1 +check_existing_hostvg() +{ + local install_dev=$1 + local devices_var=$2 + if [ -z "$install_dev" ]; then + devices="$(pvs -o pv_name,vg_name --noheadings | \ + grep "HostVG" | awk '{print $1}' )" + else + devices="$(pvs -o pv_name,vg_name --noheadings | \ + grep -v ${install_dev} | grep "HostVG" | awk '{print $1}' )" + fi + rc=1 + if [ -n "$devices" ]; then + printf "\n" + printf "There appears to already be an installation on another device:\n" + for device in $devices; do + get_multipath_devices ${device%p[0-9]} sd_dev + sd_dev=$(echo $sd_dev | awk '{print $1}') + udi=$(hal-find-by-property --key block.device --string /dev/${sd_dev}) + printf "\t$device ($(basename "$udi"))\n" + done + 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 -z $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 dev=${1-$HOSTVGDRIVE} unmount_logging for vg in $(pvs -o vg_name --noheadings $HOSTVGDRIVE* 2>/dev/null|sort -u); do + if pvs -o pv_name,vg_name --noheadings | \ + grep $vg | grep -v -q $dev* 2>/dev/null; then + log "The volume group \"$vg\" spans multiple disks." + log "This operation cannot complete. Please manullay" + log "cleanup the storage using standard linux tools." + return 1 + fi wipe_volume_group $vg done + return 0 } @@ -867,19 +929,22 @@ if [ "$1" == "AUTO" ]; then log "Beginning automatic disk partitioning.\n" if [ -n "$OVIRT_INIT" ]; then # do not format if HostVG exists on selected disk... - pvs -o vg_name --noheadings $HOSTVGDRIVE* 2>/dev/null|grep -q -m1 "HostVG" - existingHostVG=$? + check_existing_hostvg $HOSTVGDRIVE + existingHostVG=$? # ... unless overridden by ovirt_firstboot parameter - if is_firstboot || [ $existingHostVG -ne 0 ]; then + if is_firstboot || [ $existingHostVG -ne 0 ]; then if check_partition_sizes; then - log "Partitioning hard disk..." - perform_partitioning + log "Partitioning hard disk..." + perform_partitioning + exit $? fi - else + else log "Skip disk partitioning, HostVG exists" - fi + exit 1 + fi else - log "Missing device parameter: unable to partition any disk" + 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\"" -- 1.6.6.1 From mburns at redhat.com Wed Feb 24 17:56:30 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Feb 2010 12:56:30 -0500 Subject: [Ovirt-devel] [PATCH node] ovirt-post needs to wait on libvirtd to start Message-ID: <1267034190-25794-1-git-send-email-mburns@redhat.com> Ovirt-post wasn't dependent on libvirtd being started. Signed-off-by: Mike Burns --- scripts/ovirt-post | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-post b/scripts/ovirt-post index 951d108..326c0b8 100755 --- a/scripts/ovirt-post +++ b/scripts/ovirt-post @@ -4,7 +4,7 @@ # ### BEGIN INIT INFO # Provides: ovirt-post -# Required-Start: ovirt +# Required-Start: ovirt libvirtd # Default-Start: 2 3 4 5 # Description: Performs managed node post configuration setup. ### END INIT INFO -- 1.6.6.1 From dpierce at redhat.com Wed Feb 24 19:05:18 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 24 Feb 2010 14:05:18 -0500 Subject: [Ovirt-devel] [PATCH node] ovirt-post needs to wait on libvirtd to start In-Reply-To: <1267034190-25794-1-git-send-email-mburns@redhat.com> References: <1267034190-25794-1-git-send-email-mburns@redhat.com> Message-ID: <20100224190518.GN2736@mcpierce-desktop.usersys.redhat.com> On Wed, Feb 24, 2010 at 12:56:30PM -0500, Mike Burns wrote: > Ovirt-post wasn't dependent on libvirtd being started. > > Signed-off-by: Mike Burns > --- > scripts/ovirt-post | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/scripts/ovirt-post b/scripts/ovirt-post > index 951d108..326c0b8 100755 > --- a/scripts/ovirt-post > +++ b/scripts/ovirt-post > @@ -4,7 +4,7 @@ > # > ### BEGIN INIT INFO > # Provides: ovirt-post > -# Required-Start: ovirt > +# Required-Start: ovirt libvirtd > # Default-Start: 2 3 4 5 > # Description: Performs managed node post configuration setup. > ### END INIT INFO > -- > 1.6.6.1 ACK. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From mburns at redhat.com Wed Feb 24 19:20:54 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Feb 2010 14:20:54 -0500 Subject: [Ovirt-devel] [PATCH node] ovirt-post needs to wait on libvirtd to start In-Reply-To: <20100224190518.GN2736@mcpierce-desktop.usersys.redhat.com> References: <1267034190-25794-1-git-send-email-mburns@redhat.com> <20100224190518.GN2736@mcpierce-desktop.usersys.redhat.com> Message-ID: <1267039254.3262.5.camel@localhost.localdomain> On Wed, 2010-02-24 at 14:05 -0500, Darryl L. Pierce wrote: > On Wed, Feb 24, 2010 at 12:56:30PM -0500, Mike Burns wrote: > > Ovirt-post wasn't dependent on libvirtd being started. > > > > Signed-off-by: Mike Burns > > --- > > scripts/ovirt-post | 2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/scripts/ovirt-post b/scripts/ovirt-post > > index 951d108..326c0b8 100755 > > --- a/scripts/ovirt-post > > +++ b/scripts/ovirt-post > > @@ -4,7 +4,7 @@ > > # > > ### BEGIN INIT INFO > > # Provides: ovirt-post > > -# Required-Start: ovirt > > +# Required-Start: ovirt libvirtd > > # Default-Start: 2 3 4 5 > > # Description: Performs managed node post configuration setup. > > ### END INIT INFO > > -- > > 1.6.6.1 > > ACK. > Pushed. Thanks > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel From mburns at redhat.com Wed Feb 24 19:49:32 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Feb 2010 14:49:32 -0500 Subject: [Ovirt-devel] [PATCH node] fix ntp setup file Message-ID: <1267040972-26480-1-git-send-email-mburns@redhat.com> If not specifying an ntp server, the conf file for ntp was incorrect. It resulted in a failure in augtool and caused networking to never start. This allows us to workaround augeas bug https://bugzilla.redhat.com/show_bug.cgi?id=566844 Signed-off-by: Mike Burns --- scripts/ovirt-config-networking | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking index ec154c2..ee64c98 100755 --- a/scripts/ovirt-config-networking +++ b/scripts/ovirt-config-networking @@ -431,7 +431,7 @@ function save_ntp_configuration local ntproot="/files/etc/ntp.conf" printf "\ -rm ${ntproot}\n\n +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\ -- 1.6.6.1 From mburns at redhat.com Wed Feb 24 19:51:48 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Feb 2010 14:51:48 -0500 Subject: [Ovirt-devel] Couple issues found working on ovirt-node Message-ID: <1267041108.3262.27.camel@localhost.localdomain> I've hit an issue that people on this list should be aware of that affect the ovirt-node functionality. The issues are filed in bugzilla. 566455 - sed doesn't support -c/--copy option For the sed issue, there is a patched version in the repo on ovirt.org. To use this package in the node, you need to edit the repos.ks file in /usr/share/ovirt-node-tools to include this line: repo --name=ovirt-org --baseurl=http://ovirt.org/repos/ovirt/12/x86_64 Without the updated package, networking cannot be configured. There are probably other areas that will face this issue as well. Mike From jboggs at redhat.com Wed Feb 24 21:02:03 2010 From: jboggs at redhat.com (Joey Boggs) Date: Wed, 24 Feb 2010 16:02:03 -0500 Subject: [Ovirt-devel] [PATCH] Moves all ovirt-config-* scripts to /usr/libexec. In-Reply-To: <1266936755-20615-2-git-send-email-dpierce@redhat.com> References: <1266936755-20615-1-git-send-email-dpierce@redhat.com> <1266936755-20615-2-git-send-email-dpierce@redhat.com> Message-ID: <4B8593CB.5060409@redhat.com> On 02/23/2010 09:52 AM, Darryl L. Pierce wrote: > This is to reinforce with the user that the scripts are not meant to be > used at the commandline individually. > > The spec file and Makefile are both fixed to change the installation > location. The ovirt-functions file now contains a variable which points > to the installation directory, which is used inside of all scripts which > call out to other scripts. > > Updates the make system to use makefiles and to install the files there. > > Signed-off-by: Darryl L. Pierce > --- > Makefile.am | 97 +++++---------------------------- > configure.ac | 6 ++ > images/Makefile.am | 20 +++++++ > kinit/Makefile.am | 20 +++++++ > nodeadmin/Makefile.am | 61 +++++++++++++++++++++ > ovirt-node.spec.in | 83 +++++++++++------------------ > scripts/Makefile.am | 46 ++++++++++++++++ > scripts/ovirt | 2 +- > scripts/ovirt-awake | 2 +- > scripts/ovirt-config-boot | 2 +- > scripts/ovirt-config-boot-wrapper | 4 +- > scripts/ovirt-config-collectd | 2 +- > scripts/ovirt-config-hostname | 2 +- > scripts/ovirt-config-iscsi | 2 +- > scripts/ovirt-config-logging | 2 +- > scripts/ovirt-config-networking | 2 +- > scripts/ovirt-config-password | 2 +- > scripts/ovirt-config-setup | 2 +- > scripts/ovirt-config-storage | 2 +- > scripts/ovirt-config-uninstall | 2 +- > scripts/ovirt-config-view-logs | 2 +- > scripts/ovirt-early | 6 +- > scripts/ovirt-firstboot | 18 +++--- > scripts/ovirt-install-node-stateful | 2 +- > scripts/ovirt-install-node-stateless | 2 +- > scripts/ovirt-post | 2 +- > scripts/ovirt-process-config | 2 +- > scripts/ovirt-uninstall-node-stateful | 2 +- > scripts/persist | 4 +- > scripts/unpersist | 4 +- > tools/Makefile.am | 23 ++++++++ > 31 files changed, 256 insertions(+), 172 deletions(-) > create mode 100644 images/Makefile.am > create mode 100644 kinit/Makefile.am > create mode 100644 nodeadmin/Makefile.am > create mode 100644 scripts/Makefile.am > create mode 100644 tools/Makefile.am > > diff --git a/Makefile.am b/Makefile.am > index 7798d09..da992ab 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -17,90 +17,19 @@ > > OVIRT_CACHE_DIR ?= $(HOME)/ovirt-cache > > -SUBDIRS = \ > - gptsync \ > - recipe > - > -EXTRA_DIST = \ > - .gitignore \ > - ovirt-node.spec \ > - ovirt-node.spec.in \ > - images/grub-splash.xpm.gz \ > - images/syslinux-vesa-splash.jpg \ > - nodeadmin/__init__.py \ > - nodeadmin/adddomain.py \ > - nodeadmin/addhost.py \ > - nodeadmin/addpool.py \ > - nodeadmin/addvolume.py \ > - nodeadmin/changehost.py \ > - nodeadmin/configscreen.py \ > - nodeadmin/createmeter.py \ > - nodeadmin/createnetwork.py \ > - nodeadmin/createuser.py \ > - nodeadmin/definenet.py \ > - nodeadmin/destroynetwork.py \ > - nodeadmin/domainconfig.py \ > - nodeadmin/halworker.py \ > - nodeadmin/hostconnect.py \ > - nodeadmin/hostmenu.py \ > - nodeadmin/libvirtworker.py \ > - nodeadmin/listdomains.py \ > - nodeadmin/listnetworks.py \ > - nodeadmin/listpools.py \ > - nodeadmin/mainmenu.py \ > - nodeadmin/menuscreen.py \ > - nodeadmin/migratedomain.py \ > - nodeadmin/networkconfig.py \ > - nodeadmin/netmenu.py \ > - nodeadmin/nodeadmin.py \ > - nodeadmin/nodemenu.py \ > - nodeadmin/poolconfig.py \ > - nodeadmin/removedomain.py \ > - nodeadmin/removehost.py \ > - nodeadmin/removepool.py \ > - nodeadmin/removevolume.py \ > - nodeadmin/startdomain.py \ > - nodeadmin/startpool.py \ > - nodeadmin/stopdomain.py \ > - nodeadmin/stoppool.py \ > - nodeadmin/storagemenu.py \ > - nodeadmin/undefinenetwork.py \ > - nodeadmin/userworker.py \ > - nodeadmin/utils.py \ > - nodeadmin/volumeconfig.py \ > - scripts/collectd.conf.in \ > - scripts/node-config \ > - scripts/ovirt \ > - scripts/ovirt-awake \ > - scripts/ovirt-config-boot \ > - scripts/ovirt-config-boot-wrapper \ > - scripts/ovirt-config-collectd \ > - scripts/ovirt-config-hostname \ > - scripts/ovirt-config-iscsi \ > - scripts/ovirt-config-logging \ > - scripts/ovirt-config-networking \ > - scripts/ovirt-config-password \ > - scripts/ovirt-config-setup \ > - scripts/ovirt-config-storage \ > - scripts/ovirt-config-uninstall \ > - scripts/ovirt-config-view-logs \ > - scripts/ovirt-early \ > - scripts/ovirt-firstboot \ > - scripts/ovirt-functions \ > - scripts/ovirt-install-node-stateful \ > - scripts/ovirt-install-node-stateless \ > - scripts/persist \ > - scripts/unpersist \ > - scripts/ovirt-post \ > - scripts/ovirt-process-config \ > - scripts/ovirt-uninstall-node-stateful \ > - tools/create-ovirt-iso-nodes \ > - tools/edit-livecd \ > - tools/livecd-iso-to-iscsi \ > - tools/livecd-rpms \ > - tools/livecd-setauth \ > - kinit/ovirt-kinit \ > - logrotate/ovirt-logrotate \ > +SUBDIRS = \ > + gptsync \ > + images \ > + kinit \ > + nodeadmin \ > + recipe \ > + scripts \ > + tools > + > +EXTRA_DIST = \ > + ovirt-node.spec \ > + ovirt-node.spec.in \ > + logrotate/ovirt-logrotate \ > logrotate/ovirt-logrotate.conf > > DISTCLEANFILES = $(PACKAGE)-$(VERSION).tar.gz > diff --git a/configure.ac b/configure.ac > index 7786d26..551dafc 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -8,6 +8,12 @@ test x"$ac_ct_CC:$CFLAGS" = 'xgcc:-g -O2' \ > && CFLAGS="$CFLAGS -Wshadow -Wall -Werror" > > AC_CONFIG_FILES([Makefile > + images/Makefile > + kinit/Makefile > + nodeadmin/Makefile > + scripts/Makefile > + tools/Makefile > + scripts/collectd.conf > nodeadmin/setup.py > gptsync/Makefile > recipe/Makefile > diff --git a/images/Makefile.am b/images/Makefile.am > new file mode 100644 > index 0000000..60347a8 > --- /dev/null > +++ b/images/Makefile.am > @@ -0,0 +1,20 @@ > +# 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 = \ > + grub-splash.xpm.gz \ > + syslinux-vesa-splash.jpg > diff --git a/kinit/Makefile.am b/kinit/Makefile.am > new file mode 100644 > index 0000000..2ac6ca2 > --- /dev/null > +++ b/kinit/Makefile.am > @@ -0,0 +1,20 @@ > +# 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 > + > diff --git a/nodeadmin/Makefile.am b/nodeadmin/Makefile.am > new file mode 100644 > index 0000000..11c7e91 > --- /dev/null > +++ b/nodeadmin/Makefile.am > @@ -0,0 +1,61 @@ > +# 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 = \ > + adddomain.py \ > + addhost.py \ > + addpool.py \ > + addvolume.py \ > + changehost.py \ > + configscreen.py \ > + createmeter.py \ > + createnetwork.py \ > + createuser.py \ > + definenet.py \ > + destroynetwork.py \ > + domainconfig.py \ > + halworker.py \ > + hostconnect.py \ > + hostmenu.py \ > + __init__.py \ > + libvirtworker.py \ > + listdomains.py \ > + listnetworks.py \ > + listpools.py \ > + mainmenu.py \ > + menuscreen.py \ > + migratedomain.py \ > + netmenu.py \ > + networkconfig.py \ > + nodeadmin.py \ > + nodemenu.py \ > + poolconfig.py \ > + removedomain.py \ > + removehost.py \ > + removepool.py \ > + removevolume.py \ > + setup.py \ > + startdomain.py \ > + startpool.py \ > + stopdomain.py \ > + stoppool.py \ > + storagemenu.py \ > + undefinenetwork.py \ > + userworker.py \ > + utils.py \ > + volumeconfig.py > + > diff --git a/ovirt-node.spec.in b/ovirt-node.spec.in > index 3d8d100..d67b089 100644 > --- a/ovirt-node.spec.in > +++ b/ovirt-node.spec.in > @@ -53,9 +53,7 @@ ExclusiveArch: %{ix86} x86_64 > %define app_root %{_datadir}/%{name} > > %description > -Provides a series of daemons and support utilities to allow an > -oVirt Node to interact with the oVirt Server. This package > -should only be installed on the oVirt Node machine. > +Provides a series of daemons and support utilities for hypervisor distribution. > > %package tools > Summary: oVirt Node tools for building and running an oVirt Node image > @@ -84,37 +82,17 @@ make %{?ovirt_cache_dir: OVIRT_CACHE_DIR=%{ovirt_cache_dir}} \ > %install > %{__rm} -rf %{buildroot} > make install DESTDIR=%{buildroot} > -# FIXME move all installs into makefile > -%{__install} -d -m0755 %{buildroot}%{_sbindir} > +%{__install} -d -m0755 %{buildroot}%{app_root} > +%{__install} -d -m0755 %{buildroot}%{_initrddir} > +%{__install} -d -m0755 %{buildroot}%{_libexecdir} > %{__install} -d -m0755 %{buildroot}%{_sysconfdir} > -%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/chkconfig.d > +%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/cron.hourly > %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/sysconfig > %{__install} -d -m0755 %{buildroot}%{mgmt_scripts_dir} > -%{__install} -d -m0755 %{buildroot}%{_initrddir} > -%{__install} -d -m0755 %{buildroot}%{app_root} > %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/cron.d > -%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/cron.hourly > %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/logrotate.d > %{__install} -d -m0755 %{buildroot}%{python_sitelib}/nodeadmin > > -%{__install} -p -m0644 scripts/node-config %{buildroot}%{_sysconfdir}/sysconfig > -%{__install} -p -m0755 scripts/ovirt-config-boot %{buildroot}%{_sbindir} > -%{__install} -p -m0755 scripts/ovirt-config-boot-wrapper %{buildroot}%{_sbindir} > -%{__install} -p -m0755 scripts/ovirt-config-collectd %{buildroot}%{_sbindir} > -%{__install} -p -m0755 scripts/ovirt-config-hostname %{buildroot}%{_sbindir} > -%{__install} -p -m0755 scripts/ovirt-config-iscsi %{buildroot}%{_sbindir} > -%{__install} -p -m0755 scripts/ovirt-config-logging %{buildroot}%{_sbindir} > -%{__install} -p -m0755 scripts/ovirt-config-networking %{buildroot}%{_sbindir} > -%{__install} -p -m0755 scripts/ovirt-config-password %{buildroot}%{_sbindir} > -%{__install} -p -m0755 scripts/ovirt-config-setup %{buildroot}%{_sbindir} > -%{__install} -p -m0755 scripts/ovirt-config-storage %{buildroot}%{_sbindir} > -%{__install} -p -m0755 scripts/ovirt-config-uninstall %{buildroot}%{_sbindir} > -%{__install} -p -m0755 scripts/ovirt-process-config %{buildroot}%{_sbindir} > -%{__install} -D -m0755 scripts/ovirt-install-node-stateless %{buildroot}%{_sbindir} > -%{__install} -D -m0755 scripts/ovirt-config-view-logs %{buildroot}%{_sbindir} > -%{__install} -p -m0755 scripts/persist %{buildroot}%{_sbindir} > -%{__install} -p -m0755 scripts/unpersist %{buildroot}%{_sbindir} > - > %{__install} -p -m0644 nodeadmin/__init__.py %{buildroot}%{python_sitelib}/nodeadmin > %{__install} -p -m0644 nodeadmin/configscreen.py %{buildroot}%{python_sitelib}/nodeadmin > %{__install} -p -m0644 nodeadmin/menuscreen.py %{buildroot}%{python_sitelib}/nodeadmin > @@ -155,12 +133,13 @@ make install DESTDIR=%{buildroot} > #%{__install} -p -m0755 gptsync/showpart %{buildroot}%{_sbindir} > # in Makefile now > > -%{__install} -p -m0755 scripts/ovirt-functions %{buildroot}%{_initrddir} > +%{__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-firstboot %{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 scripts/collectd.conf.in %{buildroot}%{_sysconfdir} > > @@ -200,16 +179,16 @@ ln -s ovirt-release %{buildroot}/etc/system-release > > # default ovirt-config-setup menu options > %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/ovirt-config-setup.d > -%{__ln_s} ../..%{_sbindir}/ovirt-config-storage %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"00_Disk Partitioning" > -%{__ln_s} ../..%{_sbindir}/ovirt-config-password %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"05_Administrator Password" > -%{__ln_s} ../..%{_sbindir}/ovirt-config-hostname %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"10_Set Hostname" > -%{__ln_s} ../..%{_sbindir}/ovirt-config-iscsi %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"12_iSCSI Initiator Setup" > -%{__ln_s} ../..%{_sbindir}/ovirt-config-networking %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"15_Networking Setup" > -%{__ln_s} ../..%{_sbindir}/ovirt-config-logging %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"30_Logging Setup" > -%{__ln_s} ../..%{_sbindir}/ovirt-config-collectd %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"35_Collectd Setup" > -%{__ln_s} ../..%{_sbindir}/ovirt-config-view-logs %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"90_View logs" > -%{__ln_s} ../..%{_sbindir}/ovirt-config-boot-wrapper %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"98_Local install and reboot" > -%{__ln_s} ../..%{_sbindir}/ovirt-config-uninstall %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"99_Uninstall node" > +%{__ln_s} ../..%{_libexecdir}/ovirt-config-storage %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"00_Disk Partitioning" > +%{__ln_s} ../..%{_libexecdir}/ovirt-config-password %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"05_Administrator Password" > +%{__ln_s} ../..%{_libexecdir}/ovirt-config-hostname %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"10_Set Hostname" > +%{__ln_s} ../..%{_libexecdir}/ovirt-config-iscsi %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"12_iSCSI Initiator Setup" > +%{__ln_s} ../..%{_libexecdir}/ovirt-config-networking %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"15_Networking Setup" > +%{__ln_s} ../..%{_libexecdir}/ovirt-config-logging %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"30_Logging Setup" > +%{__ln_s} ../..%{_libexecdir}/ovirt-config-collectd %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"35_Collectd Setup" > +%{__ln_s} ../..%{_libexecdir}/ovirt-config-view-logs %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"90_View logs" > +%{__ln_s} ../..%{_libexecdir}/ovirt-config-boot-wrapper %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"98_Local install and reboot" > +%{__ln_s} ../..%{_libexecdir}/ovirt-config-uninstall %{buildroot}%{_sysconfdir}/ovirt-config-setup.d/"99_Uninstall node" > > # ovirt-early vendor hook dir > %{__install} -d -m0755 %{buildroot}%{_sysconfdir}/ovirt-early.d > @@ -288,18 +267,19 @@ fi > # end i386 bits > %{app_root}/syslinux-vesa-splash.jpg > > -%{_sbindir}/ovirt-config-boot > -%{_sbindir}/ovirt-config-boot-wrapper > -%{_sbindir}/ovirt-config-collectd > -%{_sbindir}/ovirt-config-iscsi > -%{_sbindir}/ovirt-config-hostname > -%{_sbindir}/ovirt-config-logging > -%{_sbindir}/ovirt-config-networking > -%{_sbindir}/ovirt-config-password > -%{_sbindir}/ovirt-config-setup > -%{_sbindir}/ovirt-config-storage > -%{_sbindir}/ovirt-config-uninstall > -%{_sbindir}/ovirt-config-view-logs > +%{_libexecdir}/ovirt-functions > +%{_libexecdir}/ovirt-config-boot > +%{_libexecdir}/ovirt-config-boot-wrapper > +%{_libexecdir}/ovirt-config-collectd > +%{_libexecdir}/ovirt-config-iscsi > +%{_libexecdir}/ovirt-config-hostname > +%{_libexecdir}/ovirt-config-logging > +%{_libexecdir}/ovirt-config-networking > +%{_libexecdir}/ovirt-config-password > +%{_libexecdir}/ovirt-config-setup > +%{_libexecdir}/ovirt-config-storage > +%{_libexecdir}/ovirt-config-uninstall > +%{_libexecdir}/ovirt-config-view-logs > %{_sbindir}/ovirt-process-config > %{_sbindir}/ovirt-install-node-stateless > %{_sbindir}/gptsync > @@ -312,7 +292,6 @@ fi > %{_initrddir}/ovirt-firstboot > %{_initrddir}/ovirt > %{_initrddir}/ovirt-post > -%attr(0644,root,root) %{_initrddir}/ovirt-functions > %config %{_sysconfdir}/cron.hourly/ovirt-kinit > %{_sysconfdir}/ovirt-early.d > > diff --git a/scripts/Makefile.am b/scripts/Makefile.am > new file mode 100644 > index 0000000..daf512c > --- /dev/null > +++ b/scripts/Makefile.am > @@ -0,0 +1,46 @@ > +# 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 > + > +dist_sbin_SCRIPTS = \ > + ovirt-install-node-stateless \ > + ovirt-process-config \ > + persist \ > + unpersist > + > +dist_libexec_SCRIPTS = \ > + ovirt-functions \ > + ovirt-config-boot \ > + ovirt-config-boot-wrapper \ > + ovirt-config-collectd \ > + ovirt-config-hostname \ > + ovirt-config-iscsi \ > + ovirt-config-logging \ > + ovirt-config-networking \ > + ovirt-config-password \ > + ovirt-config-setup \ > + ovirt-config-storage \ > + ovirt-config-uninstall \ > + ovirt-config-view-logs > + > diff --git a/scripts/ovirt b/scripts/ovirt > index d8d52cc..25b9860 100755 > --- a/scripts/ovirt > +++ b/scripts/ovirt > @@ -11,7 +11,7 @@ > > # Source functions library > . /etc/init.d/functions > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > prog=ovirt > VAR_SUBSYS_OVIRT=/var/lock/subsys/$prog > diff --git a/scripts/ovirt-awake b/scripts/ovirt-awake > index 55db140..edef186 100755 > --- a/scripts/ovirt-awake > +++ b/scripts/ovirt-awake > @@ -30,7 +30,7 @@ > # config: /etc/sysconfig/node-config > > . /etc/init.d/functions > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > prog=ovirt-early > NODE_CONFIG=/etc/sysconfig/node-config > diff --git a/scripts/ovirt-config-boot b/scripts/ovirt-config-boot > index fb956f3..d13dad2 100755 > --- a/scripts/ovirt-config-boot > +++ b/scripts/ovirt-config-boot > @@ -17,7 +17,7 @@ > > # Source functions library > . /etc/init.d/functions > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > trap '__st=$?; stop_log; exit $__st' 0 > trap 'exit $?' 1 2 13 15 > diff --git a/scripts/ovirt-config-boot-wrapper b/scripts/ovirt-config-boot-wrapper > index 89f0fc0..118c59b 100755 > --- a/scripts/ovirt-config-boot-wrapper > +++ b/scripts/ovirt-config-boot-wrapper > @@ -3,7 +3,7 @@ > # Wrapper function to make sure the user wishes to continue before > # rebooting the system > > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > rc=0 > while true; do > @@ -26,7 +26,7 @@ continuing." > fi > if ask_yes_or_no "Do you wish to continue ([Y]es/[N]o)?"; then > mount_live \ > -&& /usr/sbin/ovirt-config-boot /live "${bootparams}" > +&& /usr/libexec/ovirt-config-boot /live "${bootparams}" > rc=$? > break > else > diff --git a/scripts/ovirt-config-collectd b/scripts/ovirt-config-collectd > index 1474bf5..af0770c 100755 > --- a/scripts/ovirt-config-collectd > +++ b/scripts/ovirt-config-collectd > @@ -3,7 +3,7 @@ > # Configures the collectd daemon. > # Source functions library > . /etc/init.d/functions > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > trap '__st=$?; stop_log; exit $__st' 0 > trap 'exit $?' 1 2 13 15 > diff --git a/scripts/ovirt-config-hostname b/scripts/ovirt-config-hostname > index deb81bd..00d4214 100755 > --- a/scripts/ovirt-config-hostname > +++ b/scripts/ovirt-config-hostname > @@ -3,7 +3,7 @@ > # Configures the hostname file based on kernel cmdline or user prompt > # Source functions library > . /etc/init.d/functions > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > trap '__st=$?; stop_log; exit $__st' 0 > trap 'exit $?' 1 2 13 15 > diff --git a/scripts/ovirt-config-iscsi b/scripts/ovirt-config-iscsi > index 8e1bbaf..621729e 100755 > --- a/scripts/ovirt-config-iscsi > +++ b/scripts/ovirt-config-iscsi > @@ -3,7 +3,7 @@ > # Configures the hostname file based on kernel cmdline or user prompt > # Source functions library > . /etc/init.d/functions > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > trap '__st=$?; stop_log; exit $__st' 0 > trap 'exit $?' 1 2 13 15 > diff --git a/scripts/ovirt-config-logging b/scripts/ovirt-config-logging > index d8e5c95..f0f4040 100755 > --- a/scripts/ovirt-config-logging > +++ b/scripts/ovirt-config-logging > @@ -3,7 +3,7 @@ > # Configures the rsyslog daemon. > # Source functions library > . /etc/init.d/functions > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > trap '__st=$?; stop_log; exit $__st' 0 > trap 'exit $?' 1 2 13 15 > diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking > index ec154c2..18234c8 100755 > --- a/scripts/ovirt-config-networking > +++ b/scripts/ovirt-config-networking > @@ -3,7 +3,7 @@ > # Iterates over the list of network devices on the node and prompts the user > # to configure each. > > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > ME=$(basename "$0") > warn() { printf '%s: %s\n' "$ME" "$*">&2; } > diff --git a/scripts/ovirt-config-password b/scripts/ovirt-config-password > index e9789f8..cc45413 100755 > --- a/scripts/ovirt-config-password > +++ b/scripts/ovirt-config-password > @@ -3,7 +3,7 @@ > # Set the root password and others > # Source functions library > . /etc/init.d/functions > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > trap '__st=$?; stop_log; exit $__st' 0 > trap 'exit $?' 1 2 13 15 > diff --git a/scripts/ovirt-config-setup b/scripts/ovirt-config-setup > index 4010828..145e568 100755 > --- a/scripts/ovirt-config-setup > +++ b/scripts/ovirt-config-setup > @@ -3,7 +3,7 @@ > # Entry point for configuring an oVirt node when running in standalone mode. > > > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > # symlinked scripts for menu options, link name is menu label > CONFIG_DIR=/etc/ovirt-config-setup.d > diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage > index be22ef6..529a5f4 100755 > --- a/scripts/ovirt-config-storage > +++ b/scripts/ovirt-config-storage > @@ -6,7 +6,7 @@ > # All sizes are in megabytes > # > > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > ME=$(basename "$0") > warn() { printf '%s: %s\n' "$ME" "$*">&2; } > diff --git a/scripts/ovirt-config-uninstall b/scripts/ovirt-config-uninstall > index 820eead..b8faa7b 100755 > --- a/scripts/ovirt-config-uninstall > +++ b/scripts/ovirt-config-uninstall > @@ -6,7 +6,7 @@ > # Destroys the HostVG volume group and logical volumes. > # > > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > ME=$(basename "$0") > warn() { printf '%s: %s\n' "$ME" "$*">&2; } > diff --git a/scripts/ovirt-config-view-logs b/scripts/ovirt-config-view-logs > index 70c5229..2faa92e 100755 > --- a/scripts/ovirt-config-view-logs > +++ b/scripts/ovirt-config-view-logs > @@ -1,7 +1,7 @@ > #!/bin/bash > # > > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > ME=$(basename "$0") > warn() { printf '%s: %s\n' "$ME" "$*">&2; } > diff --git a/scripts/ovirt-early b/scripts/ovirt-early > index 23c4f6e..d901afb 100755 > --- a/scripts/ovirt-early > +++ b/scripts/ovirt-early > @@ -11,7 +11,7 @@ > > # Source functions library > . /etc/init.d/functions > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > prog=ovirt-early > VAR_SUBSYS_OVIRT_EARLY=/var/lock/subsys/$prog > @@ -147,7 +147,7 @@ configure_management_interface() { > "ovirt") > configure_ovirt_management_nic $bootif > if [ -n "$init" ]; then > - ovirt-config-storage AUTO > + /usr/libexec/ovirt-config-storage AUTO > # initial configuration storage, after /config creation > ovirt_store_config \ > /etc/sysconfig/network-scripts/ifcfg-* \ > @@ -155,7 +155,7 @@ configure_management_interface() { > if [ $upgrade = 1 ]; then > # local disk installation for managed mode > mount_live > - ovirt-config-boot /live "$bootparams" > + /usr/libexec/ovirt-config-boot /live "$bootparams" > fi > fi > ;; > diff --git a/scripts/ovirt-firstboot b/scripts/ovirt-firstboot > index b992909..fe8564c 100755 > --- a/scripts/ovirt-firstboot > +++ b/scripts/ovirt-firstboot > @@ -25,7 +25,7 @@ > > ## Source functions library > . /etc/init.d/functions > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > prog=ovirt-firstboot > lockfile=/var/lock/subsys/$prog > @@ -46,17 +46,17 @@ start () > chkconfig collectd off > > if is_auto_install; then > - ovirt-config-storage AUTO > - ovirt-config-hostname AUTO > - ovirt-config-networking AUTO > - ovirt-config-logging AUTO > - ovirt-config-collectd AUTO > - ovirt-config-password AUTO > + /usr/libexec/ovirt-config-storage AUTO > + /usr/libexec/ovirt-config-hostname AUTO > + /usr/libexec/ovirt-config-networking AUTO > + /usr/libexec/ovirt-config-logging AUTO > + /usr/libexec/ovirt-config-collectd AUTO > + /usr/libexec/ovirt-config-password AUTO > fi > > if is_upgrade; then > mount_live > - ovirt-config-boot /live "$OVIRT_BOOTPARAMS" no > + /usr/libexec/ovirt-config-boot /live "$OVIRT_BOOTPARAMS" no > disable_firstboot > reboot > return > @@ -65,7 +65,7 @@ start () > if is_firstboot; then > plymouth --hide-splash > > - ovirt-config-setup -x< /dev/console > + /usr/libexec/ovirt-config-setup -x< /dev/console > > plymouth --show-splash > fi > diff --git a/scripts/ovirt-install-node-stateful b/scripts/ovirt-install-node-stateful > index d16b42d..3c123ef 100755 > --- a/scripts/ovirt-install-node-stateful > +++ b/scripts/ovirt-install-node-stateful > @@ -3,7 +3,7 @@ > PHYS_HOST=physical.priv.ovirt.org > MGMT_HOST=management.priv.ovirt.org > > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > PATH=$PATH:/sbin:/usr/sbin > ME=$(basename "$0") > diff --git a/scripts/ovirt-install-node-stateless b/scripts/ovirt-install-node-stateless > index cceb048..d58820c 100755 > --- a/scripts/ovirt-install-node-stateless > +++ b/scripts/ovirt-install-node-stateless > @@ -1,6 +1,6 @@ > #!/bin/bash > > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > PATH=$PATH:/sbin:/usr/sbin > ME=$(basename "$0") > diff --git a/scripts/ovirt-post b/scripts/ovirt-post > index 951d108..70ed3c4 100755 > --- a/scripts/ovirt-post > +++ b/scripts/ovirt-post > @@ -11,7 +11,7 @@ > > # Source functions library > . /etc/init.d/functions > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > prog=ovirt-post > VAR_SUBSYS_OVIRT_POST=/var/lock/subsys/$prog > diff --git a/scripts/ovirt-process-config b/scripts/ovirt-process-config > index 877c412..6011cd7 100755 > --- a/scripts/ovirt-process-config > +++ b/scripts/ovirt-process-config > @@ -5,7 +5,7 @@ > # configuration file. It then restarts the networking service > # and saves the configuration files. > > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > ME=$(basename "$0") > warn() { printf '%s: %s\n' "$ME" "$*">&2; } > diff --git a/scripts/ovirt-uninstall-node-stateful b/scripts/ovirt-uninstall-node-stateful > index 5dd03ba..ca5b50f 100755 > --- a/scripts/ovirt-uninstall-node-stateful > +++ b/scripts/ovirt-uninstall-node-stateful > @@ -1,6 +1,6 @@ > #!/bin/bash > > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > PATH=$PATH:/sbin:/usr/sbin > ME=$(basename "$0") > diff --git a/scripts/persist b/scripts/persist > index 85a022e..a6818da 100755 > --- a/scripts/persist > +++ b/scripts/persist > @@ -19,9 +19,9 @@ > # also available at http://www.gnu.org/copyleft/gpl.html. > # > # Convenience wrapper to give access to the ovirt_store_config > -# function in /etc/init.d/ovirt-functions > +# function in /usr/libexec/ovirt-functions > > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > ME=$(basename "$0") > warn() { printf '%s: %s\n' "$ME" "$*">&2; } > diff --git a/scripts/unpersist b/scripts/unpersist > index b0df524..62ed87d 100755 > --- a/scripts/unpersist > +++ b/scripts/unpersist > @@ -19,9 +19,9 @@ > # also available at http://www.gnu.org/copyleft/gpl.html. > # > # Convenience wrapper to give access to the ovirt_store_config > -# function in /etc/init.d/ovirt-functions > +# function in /usr/libexec/ovirt-functions > > -. /etc/init.d/ovirt-functions > +. /usr/libexec/ovirt-functions > > ME=$(basename "$0") > warn() { printf '%s: %s\n' "$ME" "$*">&2; } > diff --git a/tools/Makefile.am b/tools/Makefile.am > new file mode 100644 > index 0000000..1b4e427 > --- /dev/null > +++ b/tools/Makefile.am > @@ -0,0 +1,23 @@ > +# 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 > ACK From dpierce at redhat.com Wed Feb 24 21:11:53 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 24 Feb 2010 16:11:53 -0500 Subject: [Ovirt-devel] [PATCH] Moves all ovirt-config-* scripts to /usr/libexec. In-Reply-To: <4B8593CB.5060409@redhat.com> References: <1266936755-20615-1-git-send-email-dpierce@redhat.com> <1266936755-20615-2-git-send-email-dpierce@redhat.com> <4B8593CB.5060409@redhat.com> Message-ID: <20100224211153.GO2736@mcpierce-desktop.usersys.redhat.com> On Wed, Feb 24, 2010 at 04:02:03PM -0500, Joey Boggs wrote: > ACK Thanks, this is pushed upstream now. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From dpierce at redhat.com Wed Feb 24 22:15:46 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Wed, 24 Feb 2010 17:15:46 -0500 Subject: [Ovirt-devel] [PATCH node] fix ntp setup file In-Reply-To: <1267040972-26480-1-git-send-email-mburns@redhat.com> References: <1267040972-26480-1-git-send-email-mburns@redhat.com> Message-ID: <20100224221546.GR2736@mcpierce-desktop.usersys.redhat.com> On Wed, Feb 24, 2010 at 02:49:32PM -0500, Mike Burns wrote: > If not specifying an ntp server, the conf file for ntp was incorrect. > It resulted in a failure in augtool and caused networking to never > start. > > This allows us to workaround augeas bug > https://bugzilla.redhat.com/show_bug.cgi?id=566844 > > Signed-off-by: Mike Burns > --- > scripts/ovirt-config-networking | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/scripts/ovirt-config-networking b/scripts/ovirt-config-networking > index ec154c2..ee64c98 100755 > --- a/scripts/ovirt-config-networking > +++ b/scripts/ovirt-config-networking > @@ -431,7 +431,7 @@ function save_ntp_configuration > local ntproot="/files/etc/ntp.conf" > > printf "\ > -rm ${ntproot}\n\n > +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\ > -- > 1.6.6.1 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel ACK. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From mburns at redhat.com Wed Feb 24 22:32:32 2010 From: mburns at redhat.com (Mike Burns) Date: Wed, 24 Feb 2010 17:32:32 -0500 Subject: [Ovirt-devel] [PATCH node] fix ntp setup file In-Reply-To: <20100224221546.GR2736@mcpierce-desktop.usersys.redhat.com> References: <1267040972-26480-1-git-send-email-mburns@redhat.com> <20100224221546.GR2736@mcpierce-desktop.usersys.redhat.com> Message-ID: <1267050752.3262.28.camel@localhost.localdomain> On Wed, 2010-02-24 at 17:15 -0500, Darryl L. Pierce wrote: > ACK. > Pushed. From taosheng.chen at gmail.com Thu Feb 25 01:36:52 2010 From: taosheng.chen at gmail.com (Tao-Sheng Chen) Date: Thu, 25 Feb 2010 09:36:52 +0800 Subject: [Ovirt-devel] oVirt supports XEN? Message-ID: >From FAQ, it seems that oVirt didn't support XEN..but... Does current oVirt release support XEN? -- Tao-Sheng Chen -------------- next part -------------- An HTML attachment was scrubbed... URL: From mloiseleur at linagora.com Thu Feb 25 08:37:17 2010 From: mloiseleur at linagora.com (Loiseleur Michel) Date: Thu, 25 Feb 2010 09:37:17 +0100 Subject: [Ovirt-devel] [PATCH] fix storage problem. Message-ID: <1267087037-3145-1-git-send-email-mloiseleur@linagora.com> Since Ruby::Qmf moves, the .key() method does not work anymore. It forces to use a .get_attr('key') in order to get the good value. Signed-off-by: Loiseleur Michel --- src/task-omatic/taskomatic.rb | 15 +++++++-------- 1 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb index c0a56b8..7de725d 100755 --- a/src/task-omatic/taskomatic.rb +++ b/src/task-omatic/taskomatic.rb @@ -608,7 +608,7 @@ class TaskOmatic storage_volume.size = volume.capacity / 1024 storage_volume.storage_pool_id = db_pool.id storage_volume.write_attribute(storage_volume.volume_name, volume.name) - storage_volume.key = volume.key + storage_volume.key = volume.get_attr('key') storage_volume.lv_owner_perms = owner storage_volume.lv_group_perms = group storage_volume.lv_mode_perms = mode @@ -661,14 +661,14 @@ class TaskOmatic existing_vol = StorageVolume.find(:first, :conditions => ["storage_pool_id = ? AND key = ?", - db_pool_phys.id, volume.key]) + db_pool_phys.id, volume.get_attr('key')]) - puts "Existing volume is #{existing_vol}, searched for storage volume key and #{volume.key}" + puts "Existing volume is #{existing_vol}, searched for storage volume key and #{volume.get_attr('key')}" # Only add if it's not already there. if not existing_vol add_volume_to_db(db_pool_phys, volume); else - @logger.debug "Scanned volume #{volume.key} already exists in db.." + @logger.debug "Scanned volume #{volume.get_attr('key')} already exists in db.." end # Now check for an LVM pool carving up this volume. @@ -710,11 +710,11 @@ class TaskOmatic lvm_storage_volume = StorageVolume.factory(lvm_db_pool.get_type_label) existing_vol = StorageVolume.find(:first, :conditions => ["storage_pool_id = ? AND key = ?", - lvm_db_pool.id, lvm_volume.key]) + lvm_db_pool.id, lvm_volume.get_attr('key')]) if not existing_vol add_volume_to_db(lvm_db_pool, lvm_volume, "0744", "0744", "0744"); else - @logger.info "volume #{lvm_volume.key} already exists in db.." + @logger.info "volume #{lvm_volume.get_attr('key')} already exists in db.." end end end @@ -756,7 +756,7 @@ class TaskOmatic end db_volume.reload - db_volume.key = volume.key + db_volume.key = volume.get_attr('key') db_volume.path = volume.path db_volume.state = StorageVolume::STATE_AVAILABLE db_volume.save! @@ -966,4 +966,3 @@ end taskomatic = TaskOmatic.new() taskomatic.mainloop() - -- 1.7.0 From mloiseleur at linagora.com Thu Feb 25 08:43:32 2010 From: mloiseleur at linagora.com (Michel Loiseleur) Date: Thu, 25 Feb 2010 09:43:32 +0100 Subject: [Ovirt-devel] [PATCH] Increase timeout for live migration In-Reply-To: <1266332722-4414-1-git-send-email-mloiseleur@linagora.com> References: <1266332722-4414-1-git-send-email-mloiseleur@linagora.com> Message-ID: <4B863834.5090409@linagora.com> Le 16/02/2010 16:05, Loiseleur Michel a ?crit : > Live migration is an operation which can takes times, like 2 or 3 minutes for heavy vms. Fixing this timeout work around another bug of db-o-matic: the infinite loop where node A has a defined& stopped vm X and node B has a defined& running vm X. I encountered this bug because the live migration has hit the timeout limit. > > Signed-off-by: Loiseleur Michel > --- > src/task-omatic/taskomatic.rb | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb > index be244c9..c0a56b8 100755 > --- a/src/task-omatic/taskomatic.rb > +++ b/src/task-omatic/taskomatic.rb > @@ -548,7 +548,7 @@ class TaskOmatic > dest_uri = "qemu+tcp://" + dest_node.hostname + "/system" > @logger.debug("Migrating from #{src_uri} to #{dest_uri}") > > - result = vm.migrate(dest_uri, Libvirt::Domain::MIGRATE_LIVE, '', '', 0, :timeout => 60 * 10) > + result = vm.migrate(dest_uri, Libvirt::Domain::MIGRATE_LIVE, '', '', 0, :timeout => 60 * 50) > @logger.error "Error migrating VM: #{result.text}" unless result.status == 0 > > # undefine can fail, for instance, if we live migrated from A -> B, and > Applied on 'next' branch, since this pach is quite easy and I haven't receive any comments on it. Regards, -- Loiseleur Michel Directeur de l'OSSA Linagora / 27, rue de Berri / 75008 PARIS Tel/Fax : 01 58 18 68 41 / 01 58 18 68 29 http://www.08000linux.com/ | http://www.tosca-project.net "Ce n'est pas le logiciel qui est libre, c'est vous" From dmitry at sec.t-labs.tu-berlin.de Thu Feb 25 08:47:51 2010 From: dmitry at sec.t-labs.tu-berlin.de (Dmitry Nedospasov) Date: Thu, 25 Feb 2010 09:47:51 +0100 Subject: [Ovirt-devel] oVirt supports XEN? In-Reply-To: References: Message-ID: <4B863937.5010601@sec.t-labs.tu-berlin.de> On 25.2.10 02:36, Tao-Sheng Chen wrote: > Does current oVirt release support XEN? I'm actually starting to work on this in my free time. If anyone is interested in working on this with me, feel free to contact me. D. -- Dmitry Nedospasov TU-Berlin / Deutsche Telekom Laboratories GPG Key: 0x00E8E7AA -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 259 bytes Desc: OpenPGP digital signature URL: From mloiseleur at linagora.com Thu Feb 25 12:28:59 2010 From: mloiseleur at linagora.com (Loiseleur Michel) Date: Thu, 25 Feb 2010 13:28:59 +0100 Subject: [Ovirt-devel] [PATCH] Enhance vms display Message-ID: <1267100939-8689-1-git-send-email-mloiseleur@linagora.com> It can be quite hard to manage a pool of 40-50 VMs without informations about the OS running, the contact (which is the only one to know when the vm can really be destroyed) or an End Of Life date. This patch add those fields, and rework a little the VM list view, in order to show gracefully those new fields. It has been made at the expense of UUID, Total Run Time & Load fields. Since those fields are often better displayed from a monitoring software, I have though it was acceptable. Signed-off-by: Loiseleur Michel --- src/app/controllers/pool_controller.rb | 6 ++-- src/app/views/vm/_form.rhtml | 10 ++++++-- src/app/views/vm/_grid.rhtml | 9 ++++--- src/db/migrate/044_add_vm_fields.rb | 34 ++++++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 10 deletions(-) create mode 100644 src/db/migrate/044_add_vm_fields.rb diff --git a/src/app/controllers/pool_controller.rb b/src/app/controllers/pool_controller.rb index e86b064..e6c341d 100644 --- a/src/app/controllers/pool_controller.rb +++ b/src/app/controllers/pool_controller.rb @@ -94,11 +94,11 @@ class PoolController < ApplicationController end def vms_json(args) - attr_list = [:id, :description, :uuid, + attr_list = [:id, :description, :num_vcpus_allocated, :memory_allocated_in_mb, - :state, :calc_uptime, :id] + :state, :contact, :os, :eol, :comment ] if (@pool.is_a? VmResourcePool) and @pool.get_hardware_pool.can_view(@user) - attr_list.insert(3, [:host, :hostname]) + attr_list.insert(2, [:host, :hostname]) end json_list(args[:full_items], attr_list, [:all], args[:find_opts]) end diff --git a/src/app/views/vm/_form.rhtml b/src/app/views/vm/_form.rhtml index adb75d2..13e73db 100644 --- a/src/app/views/vm/_form.rhtml +++ b/src/app/views/vm/_form.rhtml @@ -8,10 +8,14 @@
General
- <%= text_field_with_label "Name:", "vm", "description", {:style=>"width:250px;"} %> - <%= text_field_with_label "UUID:", "vm", "uuid", {:style=>"width:250px;"} %> - <%= select_with_label "Operating System:", 'vm', 'provisioning_and_boot_settings', @provisioning_options, :style=>"width:250px;" %> + <%= text_field_with_label "Name:", "vm", "description" %> + <%= text_field_with_label "UUID:", "vm", "uuid" %> + <%= select_with_label "Provisioning:", 'vm', 'provisioning_and_boot_settings', @provisioning_options %> <% if controller.action_name == "edit" %>*Warning* Editing provision could overwrite vm<% end %> + <%= text_field_with_label "Contact:", "vm", "contact" %> + <%= text_field_with_label "Operating System:", "vm", "os" %> + <%= text_field_with_label "End Of Life:", "vm", "eol" %> + <%= text_field_with_label "Comment:", "vm", "comment" %>
diff --git a/src/app/views/vm/_grid.rhtml b/src/app/views/vm/_grid.rhtml index e3fa0e0..fe821e1 100644 --- a/src/app/views/vm/_grid.rhtml +++ b/src/app/views/vm/_grid.rhtml @@ -27,16 +27,17 @@ <% end %> colModel : [ {display: '', name : 'id', width : 20, sortable : false, align: 'left', process: <%= table_id %>checkbox}, - {display: 'Description', name : 'description', width : 180, sortable : true, align: 'left'}, - {display: 'UUID', name : 'uuid', width : 180, sortable : true, align: 'left'}, + {display: 'Name', name : 'description', width : 180, sortable : true, align: 'left'}, <% if (pool.is_a? VmResourcePool) and pool.get_hardware_pool.can_view(@user) %> {display: 'Host', name : 'host', width: 180, sortable : true, align: 'left' }, <% end %> {display: 'CPUs', name : 'num_vcpus_allocated', width : 40, sortable : true, align: 'left'}, {display: 'Memory (MB)', name : 'memory_allocated', width : 60, sortable : true, align: 'right'}, {display: 'State', name : 'state', width : 50, sortable : true, align: 'right'}, - {display: 'Total Run Time', name : 'calc_uptime', width : 50, align: 'right'}, - {display: 'Load', name : 'load', width: 180, sortable : false, align: 'left', process: <%= table_id %>_load_widget } + {display: 'Contact', name : 'contact', width : 100, align: 'left'}, + {display: 'OS', name : 'os', width : 60, sortable : true, align: 'left'}, + {display: 'EOL', name : 'eol', width : 60, sortable : true, align: 'right'}, + {display: 'Comment', name : 'comment', width : 100, sortable : true, align: 'right'} ], sortname: "description", sortorder: "asc", diff --git a/src/db/migrate/044_add_vm_fields.rb b/src/db/migrate/044_add_vm_fields.rb new file mode 100644 index 0000000..834f0ec --- /dev/null +++ b/src/db/migrate/044_add_vm_fields.rb @@ -0,0 +1,34 @@ +# Copyright (C) 2010 Linagora. +# Written by Michel Loiseleur +# +# 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. + +# introduce information fields for VMs +class AddVmFields < ActiveRecord::Migration + def self.up + add_column :vms, :contact, :string, :null => false, :default => '' + add_column :vms, :comment, :string, :null => false, :default => '' + add_column :vms, :eol, :date, :null => false, :default => Date.new(1970,01,01).to_s + add_column :vms, :os, :string, :null => false, :default => '' + end + + def self.down + remove_column :vms, :contact + remove_column :vms, :comment + remove_column :vms, :eol + remove_column :vms, :os + end +end -- 1.7.0 From dpierce at redhat.com Thu Feb 25 12:46:16 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Thu, 25 Feb 2010 07:46:16 -0500 Subject: [Ovirt-devel] oVirt supports XEN? In-Reply-To: References: Message-ID: <20100225124616.GS2736@mcpierce-desktop.usersys.redhat.com> On Thu, Feb 25, 2010 at 09:36:52AM +0800, Tao-Sheng Chen wrote: > >From FAQ, it seems that oVirt didn't support XEN..but... > > Does current oVirt release support XEN? The managed node supports KVM only at the moment. That said, Xen support is not something that could be included at some point. If there's interest in it then it's possible to include it. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From jboggs at redhat.com Thu Feb 25 15:03:29 2010 From: jboggs at redhat.com (Joey Boggs) Date: Thu, 25 Feb 2010 10:03:29 -0500 Subject: [Ovirt-devel] [PATCH node 1/5] Initial multipath stuff In-Reply-To: <1267033671-25516-1-git-send-email-mburns@redhat.com> References: <1267033435.3262.4.camel@localhost.localdomain> <1267033671-25516-1-git-send-email-mburns@redhat.com> Message-ID: <4B869141.7090500@redhat.com> On 02/24/2010 12:47 PM, Mike Burns wrote: > Includes choosing device to install to > ovirt-node-image stuff > fix autoinstall to translate ovirt_init param > Add manual device option > > Signed-off-by: Mike Burns > --- > recipe/common-install.ks | 4 + > recipe/common-post.ks | 11 +++ > scripts/ovirt-config-storage | 171 ++++++++++++++++++++++++++++++++++++++---- > scripts/ovirt-functions | 6 +- > 4 files changed, 174 insertions(+), 18 deletions(-) > > diff --git a/recipe/common-install.ks b/recipe/common-install.ks > index f3443b6..5c1e239 100644 > --- a/recipe/common-install.ks > +++ b/recipe/common-install.ks > @@ -18,3 +18,7 @@ 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 > diff --git a/recipe/common-post.ks b/recipe/common-post.ks > index 0f09581..293c341 100644 > --- a/recipe/common-post.ks > +++ b/recipe/common-post.ks > @@ -152,6 +152,7 @@ rm -f /etc/cron.daily/logrotate > touch /var/lib/random-seed > mkdir /live > mkdir /boot > +mkdir -p /var/cache/multipathd > sed -i '/^files \/etc*/ s/^/#/' /etc/rwtab > cat> /etc/rwtab.d/ovirt< dirs /var/lib/multipath > @@ -162,7 +163,17 @@ files /var/cache/hald > files /var/empty/sshd/etc/localtime > files /var/lib/dbus > files /var/lib/libvirt > +files /var/lib/multipath > +files /var/cache/multipathd > empty /mnt > empty /live > empty /boot > EOF > + > + > +#use all hard-coded defaults for multipath > +cat /dev/mull> /etc/multipath.conf > + > +#lvm.conf should use /dev/mapper and /dev/sdX devices > +# and not /dev/dm-X devices > +sed -i 's/preferred_names = \[ \]/preferred_names = [ "^\/dev\/mapper", "^\/dev\/[hsv]d" ]/g' /etc/lvm/lvm.conf > diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage > index be22ef6..c3715fb 100755 > --- a/scripts/ovirt-config-storage > +++ b/scripts/ovirt-config-storage > @@ -34,6 +34,68 @@ logging_min_size=5 > data_min_size=5 > swap_min_size=5 > > +# return sd name for given #:# identifier > +get_sd_name() { > + local id=$1 > + local device_var=$2 > + for device in $(ls /sys/block) > + do > + if [[ $id = $(cat /sys/block/$device/dev) ]]; then > + eval $device_var=$device > + return > + fi > + done > + eval $device_var=1 > +} > + > +# gets the dependent block devices for multipath devices > +get_multipath_devices() { > + local mpath_device=mpath-$(basename $1) > + local deplist_var=$2 > + local deplist="" > + > + #get dependencies for multipath device > + local deps=$(dmsetup deps -u $mpath_device \ > + | sed -r 's/\(([0-9]+), ([0-9]+)\)/\1:\2/g' \ > + | sed 's/ /\n/g' | grep [0-9]:[0-9] ) > + > + local device="" > + for dep in $deps > + do > + local device="" > + get_sd_name $dep device > + if [[ ! $device = 1 ]]; then > + if [[ $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 mpath_var=$2 > + > + local basedev=$(basename $dev) > + > + local mpath_device=$(multipath -ll $dev |grep -n . | \ > + grep "^1:" |awk '{print $1}' | sed 's/^1:/\/dev\/mapper\//g') > + > + if [ -z "$mpath_device" ]; then > + mpath_device=$dev > + fi > + > + eval $mpath_var=$mpath_device > +} > + > + > get_drive_size() > { > local drive=$1 > @@ -53,8 +115,12 @@ get_drive_size() > fi > if [ -z "$udi" ]; then > # If hal didn't find the device, it could be a virtio block device > + # or a multipath device > # In this case, use sfdisk -s to get the size > - size=$(sfdisk -s $drive) > + size=$(sfdisk -s $drive 2>/dev/null) > + if [ -z "$size" ]; then > + size=0 > + fi > size=$(echo "scale=0; $size * 1024" | bc -l) > else > size=$(hal-get-property --udi "$udi" --key storage.size) > @@ -69,7 +135,7 @@ get_drive_size() > > size=$(echo "scale=0; $size / (1024 * 1024)" | bc -l) > echo "$drive ($size MB)" > - echo "Disk Identifier: $(basename "$udi")" > + test -z "$udi" || echo "Disk Identifier: $(basename "$udi")" > if [ -n "$space_var" ]; then > eval $space_var=$size > fi > @@ -151,6 +217,29 @@ check_partition_sizes() > return $rc > } > > +manual_input() > +{ > + local manual_device > + local return_var=$1 > + while true; do > + read -rp "Enter disk device path: " manual_device > + if [ -z "$device" ]; then > + return 1 > + fi > + translate_multipath_device $manual_device manual_device > + eval $return_var="$manual_device" > + if [ -n "$manual_device" ]; then > + if [ -b "$(readlink -f $device)" ]; then > + return 0 > + fi > + else > + echo "Aborting." > + 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). > @@ -161,7 +250,7 @@ check_partition_sizes() > get_dev_name() > { > local udi_list=$(hal-find-by-capability --capability storage) > - local byid_list=$(find /dev/disk/by-id -mindepth 1 -not -name '*-part*') > + local byid_list=$(find /dev/disk/by-id -mindepth 1 -not -name '*-part*' 2>/dev/null) > if test -z "$udi_list" -a -z "$byid_list"; then > warn "ERROR: no usable storage devices detected" > return 1 > @@ -193,7 +282,33 @@ get_dev_name() > > # FIXME: workaround for detecting virtio block devices > devices="$devices $(ls /dev/vd? 2> /dev/null | xargs)" > - devices=$(echo $devices | tr ' ' '\n' | sort -u | xargs) > + > + # FIXME: workaround for detecting cciss devices > + for dev in $(ls /dev/cciss 2>/dev/null); do > + if [[ ! $dev =~ p[0-9]+\$ ]]; then > + devices="$devices /dev/cciss/dev" > + fi > + done > + > + # Include mulitpath devices > + local devs_to_remove > + for dev in $(dmsetup ls --target=multipath | awk '{print $1}'); do > + devices="$devices /dev/mapper/$dev" > + local sd_devs="" > + get_multipath_devices $dev sd_devs > + devs_to_remove="${devs_to_remove} ${sd_devs}" > + done > + > + # Remove /dev/sd* devices that are part of a multipath device > + local dev_list > + for dev in $devices > + do > + if [[ ! "$devs_to_remove" =~ "$(basename $dev)" ]]; then > + dev_list="$dev_list $dev" > + fi > + done > + > + devices=$(echo $dev_list | tr ' ' '\n' | sort -u | xargs) > > local num_devices=$(echo "$devices" | wc -w) > # If there's only one device, use it. > @@ -209,9 +324,10 @@ get_dev_name() > get_drive_size $d>&2 > done > local choices="$devices Abort" > - select device in $choices > + select device in $choices "Manual Selection" > do > test "$device" = Abort&& return 1 > + test "$device" = "Manual selection"&& manual_input device > test -z "$device"&& continue > echo "$device" > return 0 > @@ -375,6 +491,17 @@ wipe_lvm_on_disk() > done > } > > + > +reread_partitions() > +{ > + local drive=$1 > + if [[ $drive =~ "^/dev/mapper" ]]; then > + kpartx -a -p p $drive > + else > + blockdev --rereadpt $drive > + fi > +} > + > perform_partitioning() > { > if [[ -z "$HOSTVGDRIVE"&& "$OVIRT_ISCSI_ENABLED" != "y" ]]; then > @@ -404,15 +531,20 @@ perform_partitioning() > log "Partitioning drive: $BOOTDRIVE" > log "Wiping old boot sector" > dd if=/dev/zero of=$BOOTDRIVE bs=1024K count=1 > - blockdev --rereadpt $BOOTDRIVE > + reread_partitions $BOOTDRIVE > partprobe -s $BOOTDRIVE > log "Creating boot partition" > parted $BOOTDRIVE -s "mklabel ${LABEL_TYPE}" > parted $BOOTDRIVE -s "mkpartfs primary ext2 0M ${boot_size_si}M" > + reread_partitions $BOOTDRIVE > + partboot=$BOOTDRIVE1 > + if [ ! -e $partboot ]; then > + partboot=${BOOTDRIVE}p1 > + fi > # sleep to ensure filesystems are created before continuing > sleep 10 > - mke2fs ${BOOTDRIVE}1 -L Boot > - tune2fs -c 0 -i 0 ${BOOTDRIVE}1 > + mke2fs ${partboot} -L Boot > + tune2fs -c 0 -i 0 ${partboot} > log "Completed!" > return > fi > @@ -422,7 +554,7 @@ perform_partitioning() > # FIXME: save a backup copy, just in case? > log "Wiping old boot sector" > dd if=/dev/zero of=$ROOTDRIVE bs=1024K count=1 > - blockdev --rereadpt $ROOTDRIVE > + reread_partitions $ROOTDRIVE > partprobe -s $ROOTDRIVE > log "Labeling Drive: $ROOTDRIVE" > parted $ROOTDRIVE -s "mklabel ${LABEL_TYPE}" > @@ -435,12 +567,19 @@ perform_partitioning() > let RootBackup_end=${ROOT_SIZE}*2 > parted $ROOTDRIVE -s "mkpart primary ext2 0M ${ROOT_SIZE}M" > parted $ROOTDRIVE -s "mkpart primary ext2 ${ROOT_SIZE}M ${RootBackup_end}M" > + reread_partitions $ROOTDRIVE > + partroot=${ROOTDRIVE}1 > + partrootbackup=${ROOTDRIVE}2 > + if [ ! -e $partroot ]; then > + partroot=${ROOTDRIVE}p1 > + partrootbackup=${ROOTDRIVE}p2 > + fi > # sleep to ensure filesystems are created before continuing > sleep 10 > - mke2fs ${ROOTDRIVE}1 -L Root > - mke2fs ${ROOTDRIVE}2 -L RootBackup > - tune2fs -c 0 -i 0 ${ROOTDRIVE}1 > - tune2fs -c 0 -i 0 ${ROOTDRIVE}2 > + mke2fs ${partroot} -L Root > + mke2fs ${partrootbackup} -L RootBackup > + tune2fs -c 0 -i 0 ${partroot} > + tune2fs -c 0 -i 0 ${partrootbackup} > log "Creating LVM partition" > > if [ $ROOTDRIVE == $HOSTVGDRIVE ]; then > @@ -454,6 +593,7 @@ perform_partitioning() > parted $HOSTVGDRIVE -s "set $hostvgpart lvm on" > parted $ROOTDRIVE -s "print" > udevadm settle 2> /dev/null || udevsettle > + reread_partitions $HOSTVGDRIVE > > # sync GPT to the legacy MBR partitions > if [ "gpt" == "$LABEL_TYPE" ]; then > @@ -702,8 +842,9 @@ DATA_SIZE=${OVIRT_VOL_DATA_SIZE:-$default_data_size} > if [ -n "$OVIRT_INIT" ]; then > # if present, use the drive selected with 'ovirt_init' boot parameter > # setting these the same until kernel cmdline argument implemented > - ROOTDRIVE=$OVIRT_INIT > - HOSTVGDRIVE=$OVIRT_INIT > + translate_multipath_device $OVIRT_INIT DRIVE > + ROOTDRIVE=$DRIVE > + HOSTVGDRIVE=$DRIVE > get_drive_size $ROOTDRIVE ROOTDRIVESPACE > fi > > diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions > index ff2b016..4027613 100644 > --- a/scripts/ovirt-functions > +++ b/scripts/ovirt-functions > @@ -332,7 +332,7 @@ unmount_logging_services() { > cd /etc/init.d > for prg in $(lsof -Fc +D /var/log|grep ^c|sort -u); do > srv=$(grep -l ${prg#c}$ *) > - service $srv stop > + service $srv stop 6>&- 7>&- > services="$services $srv" > done > # debugging help > @@ -364,7 +364,7 @@ mount_logging() { > rmdir $log2 > restorecon -rv /var/log > for srv in $services; do > - service $srv start > + service $srv start 6>&- 7>&- > done > > return 0 > @@ -392,7 +392,7 @@ unmount_logging() { > return $rc > fi > for srv in $services; do > - service $srv start > + service $srv start 6>&- 7>&- > done > > return 0 > ACK From jboggs at redhat.com Thu Feb 25 15:05:16 2010 From: jboggs at redhat.com (Joey Boggs) Date: Thu, 25 Feb 2010 10:05:16 -0500 Subject: [Ovirt-devel] [PATCH node 2/5] Check for negative data partition with default storage config In-Reply-To: <1267033671-25516-2-git-send-email-mburns@redhat.com> References: <1267033435.3262.4.camel@localhost.localdomain> <1267033671-25516-2-git-send-email-mburns@redhat.com> Message-ID: <4B8691AC.9030509@redhat.com> On 02/24/2010 12:47 PM, Mike Burns wrote: > If the data partition is a negative size, don't offer default sizes. > Instead force the user to enter partition sizes > > Signed-off-by: Mike Burns > --- > scripts/ovirt-config-storage | 28 ++++++++++++++++++---------- > 1 files changed, 18 insertions(+), 10 deletions(-) > > diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage > index c3715fb..a16126c 100755 > --- a/scripts/ovirt-config-storage > +++ b/scripts/ovirt-config-storage > @@ -17,7 +17,7 @@ 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 local storage." > + die "You cannot configure storage on a running system. Please boot from CD/USB to configure storage." > fi > > default_overcommit=0.5 > @@ -361,9 +361,12 @@ do_configure() > 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" > > - do_review > - if ask_yes_or_no "Use these default values ([Y]es/[N]o)?"; then > - return > + 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 > @@ -438,8 +441,9 @@ do_review() > { > if [[ -z "$ROOTDRIVE"&& "$OVIRT_ISCSI_ENABLED" != "y" ]]; then > printf "\nNo Root storage device selected.\n" > - return > + return 1 > fi > + local is_negative=0 > > if [ "$OVIRT_ISCSI_ENABLED" != "y" ]; then > local data_size_display="$DATA_SIZE MB" > @@ -448,15 +452,17 @@ do_review() > 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 > > cat< > -The local disk will be repartitioned as follows: > +The selected disk will be repartitioned as follows: > ================================================ > Root Drive: $(get_drive_size $ROOTDRIVE) > HostVG Drive: $(get_drive_size $HOSTVGDRIVE) > @@ -470,7 +476,7 @@ EOF > else > cat< > -The local disk will be repartitioned as follows: > +The selected disk will be repartitioned as follows: > ================================================ > Boot Drive: $(get_drive_size $BOOTDRIVE) > Boot partition size: $BOOT_SIZE > @@ -478,6 +484,8 @@ The local disk will be repartitioned as follows: > EOF > > fi > + > + return ${is_negative-0} > } > > # cleanup lvms on selected disk > @@ -693,9 +701,9 @@ do_confirm() > "$w8" \ > "$wb$sp$w" \ > "$wb$sp$w" \ > - "$wb If you proceed, this will destroy all data on $w" \ > - "$wb your local system, and your hard disk will be $w" \ > - "$wb irreversably reconfigured $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" \ > ACK From jboggs at redhat.com Thu Feb 25 15:05:25 2010 From: jboggs at redhat.com (Joey Boggs) Date: Thu, 25 Feb 2010 10:05:25 -0500 Subject: [Ovirt-devel] [PATCH node 3/5] Handle existing HostVGs on the storage In-Reply-To: <1267033671-25516-3-git-send-email-mburns@redhat.com> References: <1267033435.3262.4.camel@localhost.localdomain> <1267033671-25516-3-git-send-email-mburns@redhat.com> Message-ID: <4B8691B5.2070701@redhat.com> On 02/24/2010 12:47 PM, Mike Burns wrote: > Allow the user to install on a device that already contains HostVG. > Fail install if HostVG exists on a different drive. > > Signed-off-by: Mike Burns > --- > scripts/ovirt-config-storage | 81 +++++++++++++++++++++++++++++++++++++---- > 1 files changed, 73 insertions(+), 8 deletions(-) > > diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage > index a16126c..44389f3 100755 > --- a/scripts/ovirt-config-storage > +++ b/scripts/ovirt-config-storage > @@ -349,6 +349,24 @@ do_configure() > > printf "\n\nPlease select the disk to use for the HostVG.\n\n" > HOSTVGDRIVE=$(get_dev_name) || return 0 > + local skipped=false > + if check_existing_hostvg $HOSTVGDRIVE devs; then > + 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 > + return 1 > + fi > + stop_log > + else > + skipped=true > + fi > + done > + fi > + $skipped&& printf "Installation cannot proceed with existing HostVG.\n"&& return 0 > get_drive_size $HOSTVGDRIVE HOSTVGDRIVESPACE > echo $HOSTVGDRIVESPACE > fi > @@ -488,15 +506,59 @@ EOF > return ${is_negative-0} > } > > +#Check for an existing HostVG on any device on the system. > +# Return 0 if then is a HostVG found, unless only one found is on $1 > +# Return 1 if no HostVG found or only found on $1 > +check_existing_hostvg() > +{ > + local install_dev=$1 > + local devices_var=$2 > + if [ -z "$install_dev" ]; then > + devices="$(pvs -o pv_name,vg_name --noheadings | \ > + grep "HostVG" | awk '{print $1}' )" > + else > + devices="$(pvs -o pv_name,vg_name --noheadings | \ > + grep -v ${install_dev} | grep "HostVG" | awk '{print $1}' )" > + fi > + rc=1 > + if [ -n "$devices" ]; then > + printf "\n" > + printf "There appears to already be an installation on another device:\n" > + for device in $devices; do > + get_multipath_devices ${device%p[0-9]} sd_dev > + sd_dev=$(echo $sd_dev | awk '{print $1}') > + udi=$(hal-find-by-property --key block.device --string /dev/${sd_dev}) > + printf "\t$device ($(basename "$udi"))\n" > + done > + 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 -z $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 dev=${1-$HOSTVGDRIVE} > unmount_logging > for vg in $(pvs -o vg_name --noheadings $HOSTVGDRIVE* 2>/dev/null|sort -u); do > + if pvs -o pv_name,vg_name --noheadings | \ > + grep $vg | grep -v -q $dev* 2>/dev/null; then > + log "The volume group \"$vg\" spans multiple disks." > + log "This operation cannot complete. Please manullay" > + log "cleanup the storage using standard linux tools." > + return 1 > + fi > wipe_volume_group $vg > done > + return 0 > } > > > @@ -867,19 +929,22 @@ if [ "$1" == "AUTO" ]; then > log "Beginning automatic disk partitioning.\n" > if [ -n "$OVIRT_INIT" ]; then > # do not format if HostVG exists on selected disk... > - pvs -o vg_name --noheadings $HOSTVGDRIVE* 2>/dev/null|grep -q -m1 "HostVG" > - existingHostVG=$? > + check_existing_hostvg $HOSTVGDRIVE > + existingHostVG=$? > # ... unless overridden by ovirt_firstboot parameter > - if is_firstboot || [ $existingHostVG -ne 0 ]; then > + if is_firstboot || [ $existingHostVG -ne 0 ]; then > if check_partition_sizes; then > - log "Partitioning hard disk..." > - perform_partitioning > + log "Partitioning hard disk..." > + perform_partitioning > + exit $? > fi > - else > + else > log "Skip disk partitioning, HostVG exists" > - fi > + exit 1 > + fi > else > - log "Missing device parameter: unable to partition any disk" > + 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\"" > ACK From jboggs at redhat.com Thu Feb 25 15:15:31 2010 From: jboggs at redhat.com (Joey Boggs) Date: Thu, 25 Feb 2010 10:15:31 -0500 Subject: [Ovirt-devel] [PATCH node 5/5] Check for plymouth running before trying to kill it In-Reply-To: <1267033671-25516-5-git-send-email-mburns@redhat.com> References: <1267033435.3262.4.camel@localhost.localdomain> <1267033671-25516-5-git-send-email-mburns@redhat.com> Message-ID: <4B869413.2030001@redhat.com> On 02/24/2010 12:47 PM, Mike Burns wrote: > Don't try to kill plymouth if it's already dead > > Signed-off-by: Mike Burns > --- > scripts/ovirt-functions | 5 +++-- > 1 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/scripts/ovirt-functions b/scripts/ovirt-functions > index 4027613..1db89ae 100644 > --- a/scripts/ovirt-functions > +++ b/scripts/ovirt-functions > @@ -382,8 +382,9 @@ unmount_logging() { > > log "Unmounting log partition" > # plymouthd keeps /var/log/boot.log > - plymouth --quit > - plymouth --wait > + if plymouth --ping ; then > + plymouth --quit > + fi > unmount_logging_services > > umount /var/log > ACK From jboggs at redhat.com Thu Feb 25 15:16:33 2010 From: jboggs at redhat.com (Joey Boggs) Date: Thu, 25 Feb 2010 10:16:33 -0500 Subject: [Ovirt-devel] [PATCH node 4/5] update uninstall steps to handle multipath In-Reply-To: <1267033671-25516-4-git-send-email-mburns@redhat.com> References: <1267033435.3262.4.camel@localhost.localdomain> <1267033671-25516-4-git-send-email-mburns@redhat.com> Message-ID: <4B869451.2070905@redhat.com> On 02/24/2010 12:47 PM, Mike Burns wrote: > Signed-off-by: Mike Burns > --- > scripts/ovirt-config-uninstall | 51 +++++++++++++++++++++++++++------------ > 1 files changed, 35 insertions(+), 16 deletions(-) > > diff --git a/scripts/ovirt-config-uninstall b/scripts/ovirt-config-uninstall > index 820eead..a2c9b3c 100755 > --- a/scripts/ovirt-config-uninstall > +++ b/scripts/ovirt-config-uninstall > @@ -29,24 +29,43 @@ EOF > > if ask_yes_or_no "Do you wish to continue and uninstall this node ([Y]es/[N]o)?"; then > if [ -d /dev/HostVG ]; then > - log "Uninstalling node" > - log "Detaching logging" > - unmount_logging > - log "Removing volume group" > - wipe_volume_group "HostVG" > - partition=$(findfs LABEL=Root) > - if [ -n "$partition" ]; then > - log "Removing partitions" > - drive=$(echo $partition | awk '{ print substr($0, 1, length($0) - 1) }') > - parted -s $drive "rm 1" > - parted -s $drive "rm 2" > + 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 > + log "Removing volume group" > + wipe_volume_group "HostVG" > + partition=$(readlink -f $(findfs LABEL=Root)) > + if [ -n "$partition" ]; then > + log "Removing partitions" > + eval $(echo $partition | awk ' { > + print "drive=" substr($0,1,length($1)-1); > + print "drive2=" substr($0,1,length($1)-2); > + }') > + if [ ! -e "$drive" ]; then > + drive="$drive2" > + partpv="$drive}p2" > + else > + partpv="${drive}2" > + fi > + parted -s $drive "rm 1" > + pvremove ${partpv} > + parted -s $drive "rm 2" > parted -s $drive "rm 3" > - fi > - printf "Finished uninstalling node." > + fi > + #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 > + log "There is no installed node instance to remove." > + log "Aborting" > + exit 1 > fi > else > log "Aborted" > ACK From mburns at redhat.com Thu Feb 25 15:23:35 2010 From: mburns at redhat.com (Mike Burns) Date: Thu, 25 Feb 2010 10:23:35 -0500 Subject: [Ovirt-devel] [PATCH node 4/5] update uninstall steps to handle multipath In-Reply-To: <4B869451.2070905@redhat.com> References: <1267033435.3262.4.camel@localhost.localdomain> <1267033671-25516-4-git-send-email-mburns@redhat.com> <4B869451.2070905@redhat.com> Message-ID: <1267111415.3262.47.camel@localhost.localdomain> On Thu, 2010-02-25 at 10:16 -0500, Joey Boggs wrote: > > > ACK > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel Thanks. All 5 pushed to next From dpierce at redhat.com Thu Feb 25 20:55:42 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Thu, 25 Feb 2010 15:55:42 -0500 Subject: [Ovirt-devel] [PATCH] fix storage problem. In-Reply-To: <1267087037-3145-1-git-send-email-mloiseleur@linagora.com> References: <1267087037-3145-1-git-send-email-mloiseleur@linagora.com> Message-ID: <20100225205542.GB3962@mcpierce-desktop.usersys.redhat.com> On Thu, Feb 25, 2010 at 09:37:17AM +0100, Loiseleur Michel wrote: > Since Ruby::Qmf moves, the .key() method does not work anymore. It forces to use a .get_attr('key') in order to get the good value. > > Signed-off-by: Loiseleur Michel > --- > src/task-omatic/taskomatic.rb | 15 +++++++-------- > 1 files changed, 7 insertions(+), 8 deletions(-) > > diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb > index c0a56b8..7de725d 100755 > --- a/src/task-omatic/taskomatic.rb > +++ b/src/task-omatic/taskomatic.rb > @@ -608,7 +608,7 @@ class TaskOmatic > storage_volume.size = volume.capacity / 1024 > storage_volume.storage_pool_id = db_pool.id > storage_volume.write_attribute(storage_volume.volume_name, volume.name) > - storage_volume.key = volume.key > + storage_volume.key = volume.get_attr('key') > storage_volume.lv_owner_perms = owner > storage_volume.lv_group_perms = group > storage_volume.lv_mode_perms = mode > @@ -661,14 +661,14 @@ class TaskOmatic > > existing_vol = StorageVolume.find(:first, :conditions => > ["storage_pool_id = ? AND key = ?", > - db_pool_phys.id, volume.key]) > + db_pool_phys.id, volume.get_attr('key')]) > > - puts "Existing volume is #{existing_vol}, searched for storage volume key and #{volume.key}" > + puts "Existing volume is #{existing_vol}, searched for storage volume key and #{volume.get_attr('key')}" > # Only add if it's not already there. > if not existing_vol > add_volume_to_db(db_pool_phys, volume); > else > - @logger.debug "Scanned volume #{volume.key} already exists in db.." > + @logger.debug "Scanned volume #{volume.get_attr('key')} already exists in db.." > end > > # Now check for an LVM pool carving up this volume. > @@ -710,11 +710,11 @@ class TaskOmatic > lvm_storage_volume = StorageVolume.factory(lvm_db_pool.get_type_label) > existing_vol = StorageVolume.find(:first, :conditions => > ["storage_pool_id = ? AND key = ?", > - lvm_db_pool.id, lvm_volume.key]) > + lvm_db_pool.id, lvm_volume.get_attr('key')]) > if not existing_vol > add_volume_to_db(lvm_db_pool, lvm_volume, "0744", "0744", "0744"); > else > - @logger.info "volume #{lvm_volume.key} already exists in db.." > + @logger.info "volume #{lvm_volume.get_attr('key')} already exists in db.." > end > end > end > @@ -756,7 +756,7 @@ class TaskOmatic > end > > db_volume.reload > - db_volume.key = volume.key > + db_volume.key = volume.get_attr('key') > db_volume.path = volume.path > db_volume.state = StorageVolume::STATE_AVAILABLE > db_volume.save! > @@ -966,4 +966,3 @@ end > > taskomatic = TaskOmatic.new() > taskomatic.mainloop() > - > -- > 1.7.0 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel ACK and pushed. Thank you for the contribution. :) -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: