Darryl L. Pierce
2010-Feb-17 22:20 UTC
[Ovirt-devel] [PATCH] Provides the new node lifecycle events.
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 <dpierce at redhat.com> --- 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 <<EOF +Usage: $ME -s SERVERNAME -p PORT [-i IDENTIFIER] [-k KEYTAB] [-v] [-d] [-h] + -s: sets the servername of the management server + -p: sets the port on the server to use + -i: the node's unique identifier + -k: sets the output filename for the keytab (default: $NODE_KEYTAB_FILE) + -v: verbose output (default: false) + -d: debugging output (default: false) + -z: preserve files (default: false) +EOF +} + +while getopts s:p:i:k:dvzh c; do + case $c in + s) servername=($OPTARG);; + p) serverport=($OPTARG);; + i) identifier=($OPTARG);; + k) keytab_file=($OPTARG);; + v) verbose=true; set -v;; + d) debugging=true;; + z) preserve=true;; + h) usage;; + *) usage;; + esac +done + +if [ -z "$servername" ] || [ -z "$serverport" ]; then + die "You must specify a servername and a port." +fi + +if [ -z "$identifier" ]; then + die "You must specify this node\'s unique identifier." +fi + +server_url="http://${servername}:${serverport}${awake_endpoint}" +awake_content=$WORKDIR/awake.content +tmpfile=$WORKDIR/tmp-keytab + +cat<<EOF > $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 <<EOF +Usage: $ME [-m INTEFACE] [-v] [-d] [-h] + + -s: Specifies the management server name (default: $NODE_MANAGEMENT_SERVER) + -p: Specifies the managerment server port (defautl: $NODE_MANAGEMENT_PORT) + -m: Specifies the MAC ADDRESS for the + management interface (default: $NODE_MANAGEMENT_NIC*) + -v: Display verbose output (default: false) + -d: Display debugging output (default: false) + -z: Preserve files (default: false) + -h: Display this help content + +* - defined in $NODE_CONFIG +EOF +} + +verbose=false +debugging=false +preserve=false +servername=$NODE_MANAGEMENT_SERVER +serverport=$NODE_MANAGEMENT_PORT +config_endpoint=$NODE_CONFIG_ENDPOINT +iface=$NODE_MANAGEMENT_NIC +identifier=$(hostname) + +while getopts s:p:m:vdzh c; do + case $c in + s) servername=($OPTARG);; + p) serverport=($OPTARG);; + m) iface=($OPTARG);; + d) debugging=true;; + v) verbose=true; set -v;; + z) preserve=true;; + h) usage;; + *) usage;; + esac +done + +if [ -z "$servername" ] || [ -z "$serverport" ]; then + die "You must provide both a server name and a port." +fi + +server_url="http://${servername}:${serverport}${config_endpoint}" +config_content=$WORKDIR/config.content +tmpfile=$WORKDIR/tmp-config +decoded=$WORKDIR/config.input + +debug "server_url=$server_url" +debug "config_content=$config_content" +debug "identifier=$identifier" +debug "tmpfile=$tmpfile" +debug "decoded=$decoded" + +# build the payload for config + +cat <<EOF > $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 <<EOF >> $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 = ("<p>We're sorry but we weren't able to process " - " this request.</p>") - values = dict(prefix=request.environ.get('SCRIPT_NAME', ''), - code=request.params.get('code', resp.status_int), - message=request.params.get('message', default_message)) - return values 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 <EMAIL at ADDRESS>, 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 <EMAIL at ADDRESS>\n" -"Language-Team: ru <LL at li.org>\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<mBXhe0;dLxYLng)6>)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<vVARyqhlhvUZDREF^lmT{>!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<jP}GRDi*+u-Zs z>F<|!XSIN1g<D9uzQ^z4+w=PUzN3)M(%kl<k=f77aIGXhY%!Q at I`xi%a8OC)&A_Ir 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=<Do_kc4h=c6WM!`}g(E z#J<3<Nd5cz at bvbpueWt|cA=%Mj**z|_4(Y`)q;hK`1}3l-`vvJ;!I6VQ&m~EsiWE3 z-FkyVq=s}IHWu^q^ITtJ{rvj-`uXtl_TAs$6B878czF8w_~-BQg^7>j<Kyx1@$K#H zPEb=_U}Up0E^mi!IyyR%mYwzO>A}IlqoboyQ&+&&w#&=Qrjm-vP)P6Z at 9ysI`}_OK z%F4jN!2bUJ`uh6f;^M)^&t_<C{{R2~{{HLn{6RuO{{H{@`T70*{rda+_VxAq{r>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!%<J#*;^XA%>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-*<Jd$FXc8E at IrSdl`l z&{0)KTF_7<rNt3dQe6oF*X0W!bS<PP=nARNmo7D;QH!#s4>}uEuuy4%&c&K2(ToAH z@#V*fF*a<p7;_ at R7aKsD7>N?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 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" - xmlns:py="http://genshi.edgewall.org/" - xmlns:xi="http://www.w3.org/2001/XInclude"> - - <xi:include href="master.html" /> - -<head> - <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/> - <title>A ${code} Error has Occurred </title> -</head> - -<body> -<h1>Error ${code}</h1> - -<div>${XML(message)}</div> -</body> -</html> 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 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" - xmlns:py="http://genshi.edgewall.org/" - xmlns:xi="http://www.w3.org/2001/XInclude"> - - <head> - <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/> - <title>Welcome to the oVirt management server</title> - </head> - - <body> - <h1>Welcome To The oVirt Server Reference Implementation</h1> - - <p> - This server provides a reference implementation for how a management server should interact - with the oVirt managed node. - </p> - </body> -</html> 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