[PATCH] removed obsolete calls to get_login_user
by Scott Seago
Signed-off-by: Scott Seago <sseago(a)redhat.com>
---
src/app/controllers/application_controller.rb | 4 ----
src/app/controllers/instance_controller.rb | 2 +-
2 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/src/app/controllers/application_controller.rb b/src/app/controllers/application_controller.rb
index bc560b9..142a6bf 100644
--- a/src/app/controllers/application_controller.rb
+++ b/src/app/controllers/application_controller.rb
@@ -46,10 +46,6 @@ class ApplicationController < ActionController::Base
return 'dcloud'
end
- def get_login_user
- "deltacloudadmin"
- end
-
def get_nav_items
@providers = Provider.find(:all)
end
diff --git a/src/app/controllers/instance_controller.rb b/src/app/controllers/instance_controller.rb
index 8893286..fc05113 100644
--- a/src/app/controllers/instance_controller.rb
+++ b/src/app/controllers/instance_controller.rb
@@ -69,7 +69,7 @@ class InstanceController < ApplicationController
raise ActionError.new("#{action} is an invalid action.")
end
#permissons check here
- @task = @instance.queue_action(get_login_user, action, action_args)
+ @task = @instance.queue_action(@current_user, action, action_args)
unless @task
raise ActionError.new("#{action} cannot be performed on this instance.")
end
--
1.6.2.5
14 years, 2 months
[PATCH aggregator] updated / simplified build system and rpm spec
by Mo Morsi
- replace autotools based build system a simpler rake based one
- cleanup up rpmspec, added missing deps, renamed from portal to
aggregator, and git moved to contrib dir
---
Makefile.am | 56 ------------
Rakefile | 45 ++++++++++
configure.ac | 11 ---
contrib/deltacloud-aggregator.spec | 139 +++++++++++++++++++++++++++++++
deltacloud-portal.spec.in | 162 ------------------------------------
5 files changed, 184 insertions(+), 229 deletions(-)
delete mode 100644 Makefile.am
create mode 100644 Rakefile
delete mode 100644 configure.ac
create mode 100644 contrib/deltacloud-aggregator.spec
delete mode 100644 deltacloud-portal.spec.in
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index e5d97f8..0000000
--- a/Makefile.am
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright (C) 2008 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA 02110-1301, USA. A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-
-DELTACLOUD_CACHE_DIR ?= $(HOME)/deltacloud-cache
-
-EXTRA_DIST = \
- .gitignore \
- deltacloud-portal.spec \
- deltacloud-portal.spec.in \
- conf \
- src
-
-DISTCLEANFILES = $(PACKAGE)-$(VERSION).tar.gz
-
-# For Release: 0..., set _deltacloud_dev=1 so that we get extra_release.GIT-
-# annotated rpm version strings.
-_deltacloud_dev = \
- $(shell grep -q '^[[:space:]]*Release:[[:space:]]*0' \
- $(srcdir)/*.spec.in && echo 1 || :)
-
-git_head = $$(git log -1 --pretty=format:%h)
-GIT_RELEASE = $$(date --utc +%Y%m%d%H%M%S)git$(git_head)
-RPMDIR = $$(rpm --eval '%{_rpmdir}')
-RPM_FLAGS = --define "deltacloud_cache_dir $(DELTACLOUD_CACHE_DIR)"
-RPM_FLAGS += $(if $(_deltacloud_dev),--define "extra_release .$(GIT_RELEASE)")
-
-rpms: dist
- rpmbuild $(RPM_FLAGS) -ta $(distdir).tar.gz
-
-srpms: dist
- rpmbuild $(RPM_FLAGS) -ts $(distdir).tar.gz
-
-publish: rpms
- mkdir -p $(DELTACLOUD_CACHE_DIR)
- rsync -aq $(shell rpm --eval '%{_rpmdir}')/ $(DELTACLOUD_CACHE_DIR)/deltacloud/
- rsync -aq $(shell rpm --eval '%{_srcrpmdir}')/ $(DELTACLOUD_CACHE_DIR)/deltacloud/src
- createrepo $(DELTACLOUD_CACHE_DIR)/deltacloud
-
-genlangs:
- cd src && rake updatepo && rake makemo
-
-.PHONY: rpms publish srpms genlangs
diff --git a/Rakefile b/Rakefile
new file mode 100644
index 0000000..be8f0ae
--- /dev/null
+++ b/Rakefile
@@ -0,0 +1,45 @@
+# deltacloud rakefile
+
+require 'rake/gempackagetask'
+
+PKG_NAME='deltacloud-aggregator'
+GEM_NAME=PKG_NAME
+PKG_VERSION='0.0.2'
+SPEC_FILE="deltacloud-aggregator.spec"
+
+PKG_FILES = FileList[
+ "conf/*", "contrib/*", "src/**/*",
+ "README", "AUTHORS", "COPYING"
+]
+
+DIST_FILES = FileList[
+ "pkg/*.tgz", "pkg/*.gem"
+]
+
+SPEC = Gem::Specification.new do |s|
+ s.name = GEM_NAME
+ s.version = PKG_VERSION
+ s.email = "deltacloud-devel(a)lists.fedorahosted.org",
+ s.homepage = "http://deltacloud.org"
+ s.summary = "An API that abstracts the differences between clouds"
+ s.files = PKG_FILES
+ s.required_ruby_version = '>= 1.8.1'
+ s.description = "An API that abstracts the differences between clouds"
+end
+
+Rake::GemPackageTask.new(SPEC) do |pkg|
+ pkg.need_tar = true
+ pkg.need_zip = true
+end
+
+desc "Build (S)RPM for #{PKG_NAME}"
+task :rpm => [ :package ] do |t|
+ system("sed -e 's/@VERSION@/#{PKG_VERSION}/' contrib/#{SPEC_FILE} > pkg/#{SPEC_FILE}")
+ Dir::chdir("pkg") do |dir|
+ dir = File::expand_path(".")
+ system("rpmbuild --define '_topdir #{dir}' --define '_sourcedir #{dir}' --define '_srcrpmdir #{dir}' --define '_rpmdir #{dir}' --define '_builddir #{dir}' -ba #{SPEC_FILE} > rpmbuild.log 2>&1")
+ if $? != 0
+ raise "rpmbuild failed"
+ end
+ end
+end
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index 53f1a2e..0000000
--- a/configure.ac
+++ /dev/null
@@ -1,11 +0,0 @@
-AC_INIT([deltacloud-portal], [0.0.2], [deltacloud-devel(a)lists.fedoraproject.org])
-AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability tar-pax])
-AC_PROG_CC
-AC_CONFIG_HEADERS([config.h])
-
-# If using gcc and default CFLAGS, enable some warnings.
-test x"$ac_ct_CC:$CFLAGS" = 'xgcc:-g -O2' \
- && CFLAGS="$CFLAGS -Wshadow -Wall -Werror"
-
-AC_CONFIG_FILES([Makefile deltacloud-portal.spec])
-AC_OUTPUT
diff --git a/contrib/deltacloud-aggregator.spec b/contrib/deltacloud-aggregator.spec
new file mode 100644
index 0000000..b14db2e
--- /dev/null
+++ b/contrib/deltacloud-aggregator.spec
@@ -0,0 +1,139 @@
+%define app_root %{_datadir}/%{name}
+%define doc_root %{_datadir}/%{name}-doc
+
+Name: deltacloud-aggregator
+Version: @VERSION@
+Release: 1%{?dist}
+Summary: The Deltacloud Aggregator
+
+Group: Applications/System
+License: GPLv2+
+URL: http://deltacloud.org
+
+# until official source tarballs exist, checkout from source via
+# git clone git://git.fedorahosted.org/deltacloud/portal.git deltacloud-aggregator-0.0.2
+# tar czvf deltacloud-aggregator-0.0.2.tgz deltacloud-aggregator-0.0.2
+Source0: deltacloud-aggregator-%{version}.tgz
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+BuildArch: noarch
+
+Requires: ruby >= 1.8.1
+Requires: ruby(abi) = 1.8
+Requires: rubygem(rails) >= 2.1.1
+Requires: rubygem(daemons)
+Requires: rubygem(gettext_rails)
+Requires: postgresql
+Requires: postgresql-server
+Requires: ruby-postgres
+
+%package daemons
+Summary: Deltacloud Aggregator daemons config
+Group: Applications/Internet
+License: GPLv2+
+Requires: %{name} = %{version}-%{release}
+Requires: httpd >= 2.0
+Requires: rubygem(mongrel) >= 1.0.1
+Requires(post): chkconfig
+Requires(preun): chkconfig
+Requires(preun): initscripts
+
+
+%package doc
+Summary: Deltacloud Aggregator documentation and test suite
+Group: Documentation
+Requires: %{name} = %{version}-%{release}
+
+%description
+The Aggregator for Deltacloud.
+
+%description daemons
+The configuration necessary to run and proxy the Deltacloud Aggregator.
+
+%description doc
+Documentation and tests for the Deltacloud Aggregator
+
+%prep
+%setup -q
+
+%build
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}
+mkdir -p %{buildroot}%{app_root}
+mkdir -p %{buildroot}%{doc_root}
+mkdir -p %{buildroot}%{_initrddir}
+mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
+mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d
+mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
+
+# copy over all of the src directory...
+cp -R src/* %{buildroot}/%{app_root}
+
+# move documentation to the correct place
+mv %{buildroot}/%{app_root}/doc %{buildroot}/%{app_root}/test %{buildroot}/%{doc_root}
+
+# copy over config and init scripts
+cp conf/deltacloud-mongrel-rails conf/deltacloud-taskomatic %{buildroot}%{_initrddir}
+cp conf/*.sysconf %{buildroot}%{_sysconfdir}/sysconfig
+cp conf/deltacloud-portal.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/deltacloud-aggregator.conf
+cp conf/deltacloud-portal.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/deltacloud-aggregator
+
+# remove the files not needed for the installation
+rm -f %{buildroot}%{app_root}/task-omatic/.gitignore
+rm -f %{buildroot}%{app_root}/vendor/plugins/will_paginate/.gitignore
+rm -f %{buildroot}%{app_root}/vendor/plugins/will_paginate/.manifest
+rm -rf %{buildroot}%{app_root}/tmp
+
+%clean
+rm -rf %{buildroot}
+
+#%check
+#rake spec
+
+%pre daemons
+getent group dcloud >/dev/null || /usr/sbin/groupadd -g 109 -r dcloud 2>/dev/null || :
+getent passwd dcloud >/dev/null || \
+ /usr/sbin/useradd -u 109 -g dcloud -c "dcloud" \
+ -s /sbin/nologin -r -d /var/dcloud dcloud 2> /dev/null || :
+
+%post daemons
+# Register the httpd service
+/sbin/chkconfig --add deltacloud-taskomatic
+/sbin/chkconfig --add deltacloud-mongrel-rails
+
+%preun daemons
+if [ $1 = 0 ]; then
+/sbin/service deltacloud-taskomatic stop > /dev/null 2>&1
+/sbin/chkconfig --del deltacloud-taskomatic
+/sbin/service deltacloud-mongrel-rails stop > /dev/null 2>&1
+/sbin/chkconfig --del deltacloud-mongrel-rails
+fi
+
+%files
+%defattr(-,root,root,-)
+%{app_root}
+%doc README AUTHORS COPYING
+
+%files daemons
+%defattr(-,root,root,-)
+%{_initrddir}/deltacloud-mongrel-rails
+%{_initrddir}/deltacloud-taskomatic
+%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
+%config(noreplace) %{_sysconfdir}/sysconfig/deltacloud-mongrel-rails.sysconf
+%config(noreplace) %{_sysconfdir}/sysconfig/deltacloud-rails.sysconf
+%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
+%doc README AUTHORS COPYING
+
+%files doc
+%defattr(-,root,root,-)
+%{doc_root}
+%doc README AUTHORS COPYING
+
+%changelog
+* Wed Feb 18 2010 Mohammed Morsi <mmorsi(a)redhat.com> - 0.0.2-1
+- renamed portal to aggregator
+- updated / cleaned up package
+
+* Fri Sep 1 2009 <sseago(a)redhat.com> - 0.0.1-1
+- Initial build.
diff --git a/deltacloud-portal.spec.in b/deltacloud-portal.spec.in
deleted file mode 100644
index 642da34..0000000
--- a/deltacloud-portal.spec.in
+++ /dev/null
@@ -1,162 +0,0 @@
-%define pbuild %{_builddir}/%{name}-%{version}
-%define app_root %{_datadir}/%{name}
-%define acehome %{_datadir}/ace
-
-Summary: The Deltacloud Portal
-Name: deltacloud-portal
-Version: @VERSION@
-Release: 0%{?dist}%{?extra_release}
-Source0: http://deltacloud.org/files/%{name}-%{version}.tar.gz
-#Entire source code is GPL except for vendor/plugins/will_paginate and
-#public/javascripts/jquery.*, which is both MIT and GPL
-License: GPLv2+ and MIT and BSD
-Group: Applications/System
-Requires: ruby >= 1.8.1
-Requires: ruby(abi) = 1.8
-Requires: rubygem(activerecord) >= 2.1.1-2
-Requires: rubygem(activeldap) >= 0.10.0
-Requires: rubygem(rails) >= 2.1.1
-Requires: rubygem(mongrel) >= 1.0.1
-%if 0%{?fedora} >= 11
-Requires: rubygem(gettext_rails)
-%else
-Requires: rubygem(gettext)
-%endif
-Requires: ruby-flexmock
-Requires: postgresql-server
-Requires: ruby-postgres
-Requires: pwgen
-Requires: httpd >= 2.0
-Requires(post): /sbin/chkconfig
-Requires(preun): /sbin/chkconfig
-Requires(preun): /sbin/service
-BuildRequires: ruby >= 1.8.1
-BuildRequires: ruby-devel
-BuildRequires: rubygem(gettext)
-BuildRequires: rubygem(rake) >= 0.7
-BuildArch: noarch
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
-URL: http://deltacloud.org/
-
-%description
-The Portal for deltacloud.
-
-%prep
-%setup -q
-
-%build
-
-%install
-test "x%{buildroot}" != "x" && rm -rf %{buildroot}
-mkdir %{buildroot}
-
-%{__install} -d -m0755 %{buildroot}%{_bindir}
-%{__install} -d -m0755 %{buildroot}%{_datadir}
-%{__install} -d -m0755 %{buildroot}%{_sbindir}
-%{__install} -d -m0755 %{buildroot}%{_initrddir}
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/sysconfig
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/httpd/conf.d
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/%{name}
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/%{name}/db
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/logrotate.d
-%{__install} -d -m0755 %{buildroot}%{_localstatedir}/lib/%{name}
-%{__install} -d -m0755 %{buildroot}%{_localstatedir}/log/%{name}
-%{__install} -d -m0755 %{buildroot}%{_localstatedir}/run/%{name}
-%{__install} -d -m0755 %{buildroot}%{app_root}
-%{__install} -d -m0755 %{buildroot}/%{acehome}
-
-# Creating these files now to make sure the logfiles will be owned
-# by dcloud:dcloud. This is a temporary workaround while we've still
-# got root-owned daemon processes. Once we resolve that issue
-# these files will no longer be added explicitly here.
-touch %{buildroot}%{_localstatedir}/log/%{name}/mongrel.log
-touch %{buildroot}%{_localstatedir}/log/%{name}/rails.log
-touch %{buildroot}%{_localstatedir}/log/%{name}/taskomatic.log
-%{__install} -p -m0644 %{pbuild}/conf/%{name}.conf %{buildroot}%{_sysconfdir}/httpd/conf.d
-%{__install} -p -m0644 %{pbuild}/conf/%{name}.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
-
-%{__install} -Dp -m0755 %{pbuild}/conf/deltacloud-mongrel-rails %{buildroot}%{_initrddir}
-%{__install} -Dp -m0644 %{pbuild}/conf/deltacloud-mongrel-rails.sysconf %{buildroot}%{_sysconfdir}/sysconfig/deltacloud-mongrel-rails
-%{__install} -Dp -m0644 %{pbuild}/conf/deltacloud-rails.sysconf %{buildroot}%{_sysconfdir}/sysconfig/deltacloud-rails
-%{__install} -Dp -m0755 %{pbuild}/conf/deltacloud-taskomatic %{buildroot}%{_initrddir}
-
-# copy over all of the src directory...
-%{__cp} -a %{pbuild}/src/* %{buildroot}%{app_root}
-
-
-# move configs to /etc, keeping symlinks for Rails
-%{__mv} %{buildroot}%{app_root}/config/database.yml %{buildroot}%{_sysconfdir}/%{name}
-%{__mv} %{buildroot}%{app_root}/config/environments/development.rb %{buildroot}%{_sysconfdir}/%{name}
-%{__mv} %{buildroot}%{app_root}/config/environments/production.rb %{buildroot}%{_sysconfdir}/%{name}
-%{__mv} %{buildroot}%{app_root}/config/environments/test.rb %{buildroot}%{_sysconfdir}/%{name}
-%{__ln_s} %{_sysconfdir}/%{name}/database.yml %{buildroot}%{app_root}/config
-%{__ln_s} %{_sysconfdir}/%{name}/development.rb %{buildroot}%{app_root}/config/environments
-%{__ln_s} %{_sysconfdir}/%{name}/production.rb %{buildroot}%{app_root}/config/environments
-%{__ln_s} %{_sysconfdir}/%{name}/test.rb %{buildroot}%{app_root}/config/environments
-
-# remove the files not needed for the installation
-%{__rm} -f %{buildroot}%{app_root}/task-omatic/.gitignore
-%{__rm} -f %{buildroot}%{app_root}/vendor/plugins/will_paginate/.gitignore
-%{__rm} -f %{buildroot}%{app_root}/vendor/plugins/will_paginate/.manifest
-
-%{__rm} -rf %{buildroot}%{app_root}/tmp
-%{__mkdir} %{buildroot}%{_localstatedir}/lib/%{name}/tmp
-%{__ln_s} %{_localstatedir}/lib/%{name}/tmp %{buildroot}%{app_root}/tmp
-
-%clean
-rm -rf %{buildroot}
-
-%pre
-getent group dcloud >/dev/null || /usr/sbin/groupadd -g 109 -r dcloud 2>/dev/null || :
-getent passwd dcloud >/dev/null || \
- /usr/sbin/useradd -u 109 -g dcloud -c "dcloud" \
- -s /sbin/nologin -r -d /var/dcloud dcloud 2> /dev/null || :
-
-%post
-# script
-%define daemon_chkconfig_post(d:) \
-/sbin/chkconfig --list %{-d*} >& /dev/null \
-LISTRET=$? \
-/sbin/chkconfig --add %{-d*} \
-if [ $LISTRET -ne 0 ]; then \
- /sbin/chkconfig %{-d*} on \
-fi \
-%{nil}
-
-# if this is the initial RPM install, then we want to turn the new services
-# on; otherwise, we respect the choices the administrator already has made.
-# check this by seeing if each daemon is already installed
-%daemon_chkconfig_post -d deltacloud-mongrel-rails
-%daemon_chkconfig_post -d deltacloud-taskomatic
-
-%preun
-if [ "$1" = 0 ] ; then
- /sbin/service deltacloud-mongrel-rails stop > /dev/null 2>&1
- /sbin/service deltacloud-taskomatic stop > /dev/null 2>&1
- /sbin/chkconfig --del deltacloud-mongrel-rails
- /sbin/chkconfig --del deltacloud-taskomatic
-fi
-
-%files
-%defattr(-,root,root,0755)
-%{_initrddir}/deltacloud-mongrel-rails
-%{_initrddir}/deltacloud-taskomatic
-%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
-%config(noreplace) %{_sysconfdir}/sysconfig/deltacloud-mongrel-rails
-%config(noreplace) %{_sysconfdir}/sysconfig/deltacloud-rails
-%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
-%doc README AUTHORS COPYING
-%attr(-, dcloud, dcloud) %{_localstatedir}/lib/%{name}
-%attr(-, dcloud, dcloud) %{_localstatedir}/run/%{name}
-%attr(-, dcloud, dcloud) %{_localstatedir}/log/%{name}
-%{app_root}
-%dir %{_sysconfdir}/%{name}
-%dir %{_sysconfdir}/%{name}/db
-%config(noreplace) %{_sysconfdir}/%{name}/database.yml
-%config(noreplace) %{_sysconfdir}/%{name}/development.rb
-%config(noreplace) %{_sysconfdir}/%{name}/production.rb
-%config(noreplace) %{_sysconfdir}/%{name}/test.rb
-
-%changelog
-* Fri Sep 1 2009 <sseago(a)redhat.com> - 0.0.1-1
-- Initial build.
--
1.6.2.5
14 years, 2 months
[PATCH] Make sure to require rubygems before rest_client
by Chris Lalancette
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
client/lib/deltacloud.rb | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/client/lib/deltacloud.rb b/client/lib/deltacloud.rb
index c38eb97..37649dc 100644
--- a/client/lib/deltacloud.rb
+++ b/client/lib/deltacloud.rb
@@ -15,6 +15,7 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+require 'rubygems'
require 'rest_client'
require 'rexml/document'
require 'logger'
--
1.6.6
14 years, 2 months
[PATCH core] Change how hte mock driver initializes itself
by David Lutterkort
Hi,
it seems that the fact that you need to run 'rake fixtures' in the
client/ dir before the mock driver does anything useful causes needless
pain and suffering. This patch here tries to alleviate the situation by
storing initial data files with the driver, and automatically
initializing storage for the running driver (in
$DELTACLOUD_MOCK_STORAGE, or, if that's not set,
in /var/tmp/deltalcoud-mock-$USER)
David
>From c02980e9d8963a428984eb384ff4cefd6efa303d Mon Sep 17 00:00:00 2001
From: David Lutterkort <lutter(a)redhat.com>
Date: Thu, 25 Feb 2010 15:29:24 -0800
Subject: [PATCH core] Mock driver: change how we store mock state
* store initial data files with driver in directory data/
* keep data for running driver in $DELTACLOUD_MOCK_STORAGE or
/var/tmp/deltacloud-mock-$USER
* automatically initialize driver storage from the initial data
This makes the mock driver independent of the client/ directory, and avoids
the confusion from having to manually initialize the per-driver storage
---
.../deltacloud/drivers/mock/data/images/img1.yml | 3 +
.../deltacloud/drivers/mock/data/images/img2.yml | 3 +
.../deltacloud/drivers/mock/data/images/img3.yml | 3 +
.../drivers/mock/data/instances/inst1.yml | 8 ++++
.../drivers/mock/data/instances/inst2.yml | 8 ++++
.../drivers/mock/data/storage_snapshots/snap1.yml | 4 ++
.../drivers/mock/data/storage_snapshots/snap2.yml | 4 ++
.../drivers/mock/data/storage_snapshots/snap3.yml | 4 ++
.../drivers/mock/data/storage_volumes/vol1.yml | 6 +++
.../drivers/mock/data/storage_volumes/vol2.yml | 6 +++
.../drivers/mock/data/storage_volumes/vol3.yml | 6 +++
.../lib/deltacloud/drivers/mock/mock_driver.rb | 42 ++++++++++++-------
12 files changed, 81 insertions(+), 16 deletions(-)
create mode 100644 server/libexec/lib/deltacloud/drivers/mock/data/images/.gitignore
create mode 100644 server/libexec/lib/deltacloud/drivers/mock/data/images/img1.yml
create mode 100644 server/libexec/lib/deltacloud/drivers/mock/data/images/img2.yml
create mode 100644 server/libexec/lib/deltacloud/drivers/mock/data/images/img3.yml
create mode 100644 server/libexec/lib/deltacloud/drivers/mock/data/instances/.gitignore
create mode 100644 server/libexec/lib/deltacloud/drivers/mock/data/instances/inst1.yml
create mode 100644 server/libexec/lib/deltacloud/drivers/mock/data/instances/inst2.yml
create mode 100644 server/libexec/lib/deltacloud/drivers/mock/data/storage_snapshots/.gitignore
create mode 100644 server/libexec/lib/deltacloud/drivers/mock/data/storage_snapshots/snap1.yml
create mode 100644 server/libexec/lib/deltacloud/drivers/mock/data/storage_snapshots/snap2.yml
create mode 100644 server/libexec/lib/deltacloud/drivers/mock/data/storage_snapshots/snap3.yml
create mode 100644 server/libexec/lib/deltacloud/drivers/mock/data/storage_volumes/.gitignore
create mode 100644 server/libexec/lib/deltacloud/drivers/mock/data/storage_volumes/vol1.yml
create mode 100644 server/libexec/lib/deltacloud/drivers/mock/data/storage_volumes/vol2.yml
create mode 100644 server/libexec/lib/deltacloud/drivers/mock/data/storage_volumes/vol3.yml
diff --git a/server/libexec/lib/deltacloud/drivers/mock/data/images/.gitignore b/server/libexec/lib/deltacloud/drivers/mock/data/images/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/server/libexec/lib/deltacloud/drivers/mock/data/images/img1.yml b/server/libexec/lib/deltacloud/drivers/mock/data/images/img1.yml
new file mode 100644
index 0000000..9e56d25
--- /dev/null
+++ b/server/libexec/lib/deltacloud/drivers/mock/data/images/img1.yml
@@ -0,0 +1,3 @@
+:description: Fedora 10
+:owner_id: fedoraproject
+:architecture: x86_64
diff --git a/server/libexec/lib/deltacloud/drivers/mock/data/images/img2.yml b/server/libexec/lib/deltacloud/drivers/mock/data/images/img2.yml
new file mode 100644
index 0000000..df8ffa6
--- /dev/null
+++ b/server/libexec/lib/deltacloud/drivers/mock/data/images/img2.yml
@@ -0,0 +1,3 @@
+:description: Fedora 10
+:owner_id: fedoraproject
+:architecture: i386
diff --git a/server/libexec/lib/deltacloud/drivers/mock/data/images/img3.yml b/server/libexec/lib/deltacloud/drivers/mock/data/images/img3.yml
new file mode 100644
index 0000000..a6b82a6
--- /dev/null
+++ b/server/libexec/lib/deltacloud/drivers/mock/data/images/img3.yml
@@ -0,0 +1,3 @@
+:description: JBoss
+:owner_id: mockuser
+:architecture: i386
diff --git a/server/libexec/lib/deltacloud/drivers/mock/data/instances/.gitignore b/server/libexec/lib/deltacloud/drivers/mock/data/instances/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/server/libexec/lib/deltacloud/drivers/mock/data/instances/inst1.yml b/server/libexec/lib/deltacloud/drivers/mock/data/instances/inst1.yml
new file mode 100644
index 0000000..26a6e3b
--- /dev/null
+++ b/server/libexec/lib/deltacloud/drivers/mock/data/instances/inst1.yml
@@ -0,0 +1,8 @@
+:name: MockUserInstance
+:state: RUNNING
+:image_id: img3
+:owner_id: mockuser
+:public_addresses: [ img3.inst1.public.com ]
+:private_addresses: [ img3.inst1.private.com ]
+:flavor_id: m1-small
+:realm_id: us
diff --git a/server/libexec/lib/deltacloud/drivers/mock/data/instances/inst2.yml b/server/libexec/lib/deltacloud/drivers/mock/data/instances/inst2.yml
new file mode 100644
index 0000000..ee1de37
--- /dev/null
+++ b/server/libexec/lib/deltacloud/drivers/mock/data/instances/inst2.yml
@@ -0,0 +1,8 @@
+:name: AnotherInstance
+:state: RUNNING
+:image_id: img1
+:owner_id: anotheruser
+:public_addresses: [ img1.inst2.public.com ]
+:private_addresses: [ img1.inst2.private.com ]
+:flavor_id: m1-small
+:realm_id: us
diff --git a/server/libexec/lib/deltacloud/drivers/mock/data/storage_snapshots/.gitignore b/server/libexec/lib/deltacloud/drivers/mock/data/storage_snapshots/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/server/libexec/lib/deltacloud/drivers/mock/data/storage_snapshots/snap1.yml b/server/libexec/lib/deltacloud/drivers/mock/data/storage_snapshots/snap1.yml
new file mode 100644
index 0000000..180a2c7
--- /dev/null
+++ b/server/libexec/lib/deltacloud/drivers/mock/data/storage_snapshots/snap1.yml
@@ -0,0 +1,4 @@
+:owner_id: fedoraproject
+:created: Wed Jul 29 18:15:24 UTC 2009
+:state: COMPLETED
+:storage_volume_id: vol1
diff --git a/server/libexec/lib/deltacloud/drivers/mock/data/storage_snapshots/snap2.yml b/server/libexec/lib/deltacloud/drivers/mock/data/storage_snapshots/snap2.yml
new file mode 100644
index 0000000..f68c8ce
--- /dev/null
+++ b/server/libexec/lib/deltacloud/drivers/mock/data/storage_snapshots/snap2.yml
@@ -0,0 +1,4 @@
+:owner_id: mockuser
+:created: Wed Jul 29 18:15:24 UTC 2009
+:state: COMPLETED
+:storage_volume_id: vol2
diff --git a/server/libexec/lib/deltacloud/drivers/mock/data/storage_snapshots/snap3.yml b/server/libexec/lib/deltacloud/drivers/mock/data/storage_snapshots/snap3.yml
new file mode 100644
index 0000000..f68c8ce
--- /dev/null
+++ b/server/libexec/lib/deltacloud/drivers/mock/data/storage_snapshots/snap3.yml
@@ -0,0 +1,4 @@
+:owner_id: mockuser
+:created: Wed Jul 29 18:15:24 UTC 2009
+:state: COMPLETED
+:storage_volume_id: vol2
diff --git a/server/libexec/lib/deltacloud/drivers/mock/data/storage_volumes/.gitignore b/server/libexec/lib/deltacloud/drivers/mock/data/storage_volumes/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/server/libexec/lib/deltacloud/drivers/mock/data/storage_volumes/vol1.yml b/server/libexec/lib/deltacloud/drivers/mock/data/storage_volumes/vol1.yml
new file mode 100644
index 0000000..8a8923d
--- /dev/null
+++ b/server/libexec/lib/deltacloud/drivers/mock/data/storage_volumes/vol1.yml
@@ -0,0 +1,6 @@
+:owner_id: fedoraproject
+:created: Thu Jul 30 14:35:11 UTC 2009
+:state: AVAILABLE
+:capacity: 1
+:device:
+:instance_id:
diff --git a/server/libexec/lib/deltacloud/drivers/mock/data/storage_volumes/vol2.yml b/server/libexec/lib/deltacloud/drivers/mock/data/storage_volumes/vol2.yml
new file mode 100644
index 0000000..536dde1
--- /dev/null
+++ b/server/libexec/lib/deltacloud/drivers/mock/data/storage_volumes/vol2.yml
@@ -0,0 +1,6 @@
+:owner_id: mockuser
+:created: Thu Jul 30 14:35:11 UTC 2009
+:state: AVAILABLE
+:capacity: 1
+:device:
+:instance_id:
diff --git a/server/libexec/lib/deltacloud/drivers/mock/data/storage_volumes/vol3.yml b/server/libexec/lib/deltacloud/drivers/mock/data/storage_volumes/vol3.yml
new file mode 100644
index 0000000..5001d88
--- /dev/null
+++ b/server/libexec/lib/deltacloud/drivers/mock/data/storage_volumes/vol3.yml
@@ -0,0 +1,6 @@
+:owner_id: mockuser
+:created: Thu Jul 30 14:35:11 UTC 2009
+:state: IN-USE
+:capacity: 1
+:device: /dev/sda1
+:instance_id: inst1
diff --git a/server/libexec/lib/deltacloud/drivers/mock/mock_driver.rb b/server/libexec/lib/deltacloud/drivers/mock/mock_driver.rb
index 863de4d..315c839 100644
--- a/server/libexec/lib/deltacloud/drivers/mock/mock_driver.rb
+++ b/server/libexec/lib/deltacloud/drivers/mock/mock_driver.rb
@@ -23,11 +23,6 @@ module Deltacloud
module Mock
class MockDriver < Deltacloud::BaseDriver
- unless defined?(STORAGE_ROOT)
- STORAGE_ROOT = File::join(File::dirname(__FILE__),
- "../../../../../../client/specs/data")
- end
-
#
# Flavors
#
@@ -92,6 +87,22 @@ class MockDriver < Deltacloud::BaseDriver
stopped.to( :finish ) .on( :destroy )
end
+ def initialize
+ if ENV["DELTACLOUD_MOCK_STORAGE"]
+ @storage_root = ENV["DELTACLOUD_MOCK_STORAGE"]
+ elsif ENV["USER"]
+ @storage_root = File::join("/var/tmp", "deltacloud-mock-#{ENV["USER"]}")
+ else
+ raise "Please set either the DELTACLOUD_MOCK_STORAGE or USER environment variable"
+ end
+ if ! File::directory?(@storage_root)
+ FileUtils::rm_rf(@storage_root)
+ FileUtils::mkdir_p(@storage_root)
+ data = Dir::glob(File::join(File::dirname(__FILE__), "data", "*"))
+ FileUtils::cp_r(data, @storage_root)
+ end
+ end
+
def flavors(credentials, opts=nil)
return FLAVORS if ( opts.nil? )
results = FLAVORS
@@ -113,9 +124,8 @@ class MockDriver < Deltacloud::BaseDriver
def images(credentials, opts=nil )
check_credentials( credentials )
- puts(STORAGE_ROOT)
images = []
- Dir[ "#{STORAGE_ROOT}/images/*.yml" ].each do |image_file|
+ Dir[ "#{(a)storage_root}/images/*.yml" ].each do |image_file|
image = YAML.load( File.read( image_file ) )
image[:id] = File.basename( image_file, ".yml" )
images << Image.new( image )
@@ -137,7 +147,7 @@ class MockDriver < Deltacloud::BaseDriver
def instances(credentials, opts=nil)
check_credentials( credentials )
instances = []
- Dir[ "#{STORAGE_ROOT}/instances/*.yml" ].each do |instance_file|
+ Dir[ "#{(a)storage_root}/instances/*.yml" ].each do |instance_file|
instance = YAML.load( File.read( instance_file ) )
if ( instance[:owner_id] == credentials.user )
instance[:id] = File.basename( instance_file, ".yml" )
@@ -151,7 +161,7 @@ class MockDriver < Deltacloud::BaseDriver
def create_instance(credentials, image_id, opts)
check_credentials( credentials )
- ids = Dir[ "#{STORAGE_ROOT}/instances/*.yml" ].collect{|e| File.basename( e, ".yml" )}
+ ids = Dir[ "#{(a)storage_root}/instances/*.yml" ].collect{|e| File.basename( e, ".yml" )}
count = 0
while true
@@ -188,7 +198,7 @@ class MockDriver < Deltacloud::BaseDriver
:realm_id=>realm_id,
:actions=>instance_actions_for( 'RUNNING' )
}
- File.open( "#{STORAGE_ROOT}/instances/#{next_id}.yml", 'w' ) {|f|
+ File.open( "#{(a)storage_root}/instances/#{next_id}.yml", 'w' ) {|f|
YAML.dump( instance, f )
}
instance[:id] = next_id
@@ -196,7 +206,7 @@ class MockDriver < Deltacloud::BaseDriver
end
def start_instance(credentials, id)
- instance_file = "#{STORAGE_ROOT}/instances/#{id}.yml"
+ instance_file = "#{(a)storage_root}/instances/#{id}.yml"
instance_yml = YAML.load( File.read( instance_file ) )
instance_yml[:state] = 'RUNNING'
File.open( instance_file, 'w' ) do |f|
@@ -206,7 +216,7 @@ class MockDriver < Deltacloud::BaseDriver
end
def reboot_instance(credentials, id)
- instance_file = "#{STORAGE_ROOT}/instances/#{id}.yml"
+ instance_file = "#{(a)storage_root}/instances/#{id}.yml"
instance_yml = YAML.load( File.read( instance_file ) )
instance_yml[:state] = 'RUNNING'
File.open( instance_file, 'w' ) do |f|
@@ -217,7 +227,7 @@ class MockDriver < Deltacloud::BaseDriver
def stop_instance(credentials, id)
puts "STOP INSTANCE #{id}"
- instance_file = "#{STORAGE_ROOT}/instances/#{id}.yml"
+ instance_file = "#{(a)storage_root}/instances/#{id}.yml"
instance_yml = YAML.load( File.read( instance_file ) )
instance_yml[:state] = 'STOPPED'
File.open( instance_file, 'w' ) do |f|
@@ -230,7 +240,7 @@ class MockDriver < Deltacloud::BaseDriver
def destroy_instance(credentials, id)
check_credentials( credentials )
- FileUtils.rm( "#{STORAGE_ROOT}/instances/#{id}.yml" )
+ FileUtils.rm( "#{(a)storage_root}/instances/#{id}.yml" )
end
#
@@ -240,7 +250,7 @@ class MockDriver < Deltacloud::BaseDriver
def storage_volumes(credentials, opts=nil)
check_credentials( credentials )
volumes = []
- Dir[ "#{STORAGE_ROOT}/storage_volumes/*.yml" ].each do |storage_volume_file|
+ Dir[ "#{(a)storage_root}/storage_volumes/*.yml" ].each do |storage_volume_file|
storage_volume = YAML.load( File.read( storage_volume_file ) )
if ( storage_volume[:owner_id] == credentials.user )
storage_volume[:id] = File.basename( storage_volume_file, ".yml" )
@@ -258,7 +268,7 @@ class MockDriver < Deltacloud::BaseDriver
def storage_snapshots(credentials, opts=nil)
check_credentials( credentials )
snapshots = []
- Dir[ "#{STORAGE_ROOT}/storage_snapshots/*.yml" ].each do |storage_snapshot_file|
+ Dir[ "#{(a)storage_root}/storage_snapshots/*.yml" ].each do |storage_snapshot_file|
storage_snapshot = YAML.load( File.read( storage_snapshot_file ) )
if ( storage_snapshot[:owner_id] == credentials.user )
storage_snapshot[:id] = File.basename( storage_snapshot_file, ".yml" )
--
1.6.6.1
14 years, 2 months
[PATCH aggregator] updated / simplified rpm specfile
by Mo Morsi
(renamed from portal to aggregator)
---
deltacloud-aggregator.spec | 135 ++++++++++++++++++++++++++++++++++++
deltacloud-portal.spec.in | 162 --------------------------------------------
2 files changed, 135 insertions(+), 162 deletions(-)
create mode 100644 deltacloud-aggregator.spec
delete mode 100644 deltacloud-portal.spec.in
diff --git a/deltacloud-aggregator.spec b/deltacloud-aggregator.spec
new file mode 100644
index 0000000..a568c12
--- /dev/null
+++ b/deltacloud-aggregator.spec
@@ -0,0 +1,135 @@
+%define app_root %{_datadir}/%{name}
+%define doc_root %{_datadir}/%{name}-doc
+
+Name: deltacloud-aggregator
+Version: 0.0.2
+Release: 1%{?dist}
+Summary: The Deltacloud Aggregator
+
+Group: Applications/System
+License: GPLv2+
+URL: http://deltacloud.org
+
+# until official source tarballs exist, checkout from source via
+# git clone git://git.fedorahosted.org/deltacloud/portal.git deltacloud-aggregator-0.0.2
+# tar czvf deltacloud-aggregator.tgz deltacloud-aggregator-0.0.2
+Source0: deltacloud-aggregator.tgz
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+BuildArch: noarch
+
+Requires: ruby >= 1.8.1
+Requires: ruby(abi) = 1.8
+Requires: rubygem(rails) >= 2.1.1
+#BuildRequires(check): rubygem(rake) >= 0.7
+
+%package daemons
+Summary: Deltacloud Aggregator daemons config
+Group: Applications/Internet
+License: GPLv2+
+Requires: %{name} = %{version}-%{release}
+Requires: httpd >= 2.0
+Requires: rubygem(mongrel) >= 1.0.1
+Requires(post): chkconfig
+Requires(preun): chkconfig
+Requires(preun): initscripts
+
+
+%package doc
+Summary: Deltacloud Aggregator documentation and test suite
+Group: Documentation
+Requires: %{name} = %{version}-%{release}
+
+%description
+The Aggregator for Deltacloud.
+
+%description daemons
+The configuration necessary to run and proxy the Deltacloud Aggregator.
+
+%description doc
+Documentation and tests for the Deltacloud Aggregator
+
+%prep
+%setup -q
+
+%build
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}
+mkdir -p %{buildroot}%{app_root}
+mkdir -p %{buildroot}%{doc_root}
+mkdir -p %{buildroot}%{_initrddir}
+mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
+mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d
+mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
+
+# copy over all of the src directory...
+cp -R src/* %{buildroot}/%{app_root}
+
+# move documentation to the correct place
+mv %{buildroot}/%{app_root}/doc %{buildroot}/%{app_root}/test %{buildroot}/%{doc_root}
+
+# copy over config and init scripts
+cp conf/deltacloud-mongrel-rails conf/deltacloud-taskomatic %{buildroot}%{_initrddir}
+cp conf/*.sysconf %{buildroot}%{_sysconfdir}/sysconfig
+cp conf/deltacloud-portal.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/deltacloud-aggregator.conf
+cp conf/deltacloud-portal.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/deltacloud-aggregator
+
+# remove the files not needed for the installation
+rm -f %{buildroot}%{app_root}/task-omatic/.gitignore
+rm -f %{buildroot}%{app_root}/vendor/plugins/will_paginate/.gitignore
+rm -f %{buildroot}%{app_root}/vendor/plugins/will_paginate/.manifest
+rm -rf %{buildroot}%{app_root}/tmp
+
+%clean
+rm -rf %{buildroot}
+
+#%check
+#rake spec
+
+%pre daemons
+getent group dcloud >/dev/null || /usr/sbin/groupadd -g 109 -r dcloud 2>/dev/null || :
+getent passwd dcloud >/dev/null || \
+ /usr/sbin/useradd -u 109 -g dcloud -c "dcloud" \
+ -s /sbin/nologin -r -d /var/dcloud dcloud 2> /dev/null || :
+
+%post daemons
+# Register the httpd service
+/sbin/chkconfig --add deltacloud-taskomatic
+/sbin/chkconfig --add deltacloud-mongrel-rails
+
+%preun daemons
+if [ $1 = 0 ]; then
+/sbin/service deltacloud-taskomatic stop > /dev/null 2>&1
+/sbin/chkconfig --del deltacloud-taskomatic
+/sbin/service deltacloud-mongrel-rails stop > /dev/null 2>&1
+/sbin/chkconfig --del deltacloud-mongrel-rails
+fi
+
+%files
+%defattr(-,root,root,-)
+%{app_root}
+%doc README AUTHORS COPYING
+
+%files daemons
+%defattr(-,root,root,-)
+%{_initrddir}/deltacloud-mongrel-rails
+%{_initrddir}/deltacloud-taskomatic
+%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
+%config(noreplace) %{_sysconfdir}/sysconfig/deltacloud-mongrel-rails.sysconf
+%config(noreplace) %{_sysconfdir}/sysconfig/deltacloud-rails.sysconf
+%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
+%doc README AUTHORS COPYING
+
+%files doc
+%defattr(-,root,root,-)
+%{doc_root}
+%doc README AUTHORS COPYING
+
+%changelog
+* Wed Feb 18 2010 Mohammed Morsi <mmorsi(a)redhat.com> - 0.0.2-1
+- renamed portal to aggregator
+- updated / cleaned up package
+
+* Fri Sep 1 2009 <sseago(a)redhat.com> - 0.0.1-1
+- Initial build.
diff --git a/deltacloud-portal.spec.in b/deltacloud-portal.spec.in
deleted file mode 100644
index 642da34..0000000
--- a/deltacloud-portal.spec.in
+++ /dev/null
@@ -1,162 +0,0 @@
-%define pbuild %{_builddir}/%{name}-%{version}
-%define app_root %{_datadir}/%{name}
-%define acehome %{_datadir}/ace
-
-Summary: The Deltacloud Portal
-Name: deltacloud-portal
-Version: @VERSION@
-Release: 0%{?dist}%{?extra_release}
-Source0: http://deltacloud.org/files/%{name}-%{version}.tar.gz
-#Entire source code is GPL except for vendor/plugins/will_paginate and
-#public/javascripts/jquery.*, which is both MIT and GPL
-License: GPLv2+ and MIT and BSD
-Group: Applications/System
-Requires: ruby >= 1.8.1
-Requires: ruby(abi) = 1.8
-Requires: rubygem(activerecord) >= 2.1.1-2
-Requires: rubygem(activeldap) >= 0.10.0
-Requires: rubygem(rails) >= 2.1.1
-Requires: rubygem(mongrel) >= 1.0.1
-%if 0%{?fedora} >= 11
-Requires: rubygem(gettext_rails)
-%else
-Requires: rubygem(gettext)
-%endif
-Requires: ruby-flexmock
-Requires: postgresql-server
-Requires: ruby-postgres
-Requires: pwgen
-Requires: httpd >= 2.0
-Requires(post): /sbin/chkconfig
-Requires(preun): /sbin/chkconfig
-Requires(preun): /sbin/service
-BuildRequires: ruby >= 1.8.1
-BuildRequires: ruby-devel
-BuildRequires: rubygem(gettext)
-BuildRequires: rubygem(rake) >= 0.7
-BuildArch: noarch
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
-URL: http://deltacloud.org/
-
-%description
-The Portal for deltacloud.
-
-%prep
-%setup -q
-
-%build
-
-%install
-test "x%{buildroot}" != "x" && rm -rf %{buildroot}
-mkdir %{buildroot}
-
-%{__install} -d -m0755 %{buildroot}%{_bindir}
-%{__install} -d -m0755 %{buildroot}%{_datadir}
-%{__install} -d -m0755 %{buildroot}%{_sbindir}
-%{__install} -d -m0755 %{buildroot}%{_initrddir}
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/sysconfig
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/httpd/conf.d
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/%{name}
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/%{name}/db
-%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/logrotate.d
-%{__install} -d -m0755 %{buildroot}%{_localstatedir}/lib/%{name}
-%{__install} -d -m0755 %{buildroot}%{_localstatedir}/log/%{name}
-%{__install} -d -m0755 %{buildroot}%{_localstatedir}/run/%{name}
-%{__install} -d -m0755 %{buildroot}%{app_root}
-%{__install} -d -m0755 %{buildroot}/%{acehome}
-
-# Creating these files now to make sure the logfiles will be owned
-# by dcloud:dcloud. This is a temporary workaround while we've still
-# got root-owned daemon processes. Once we resolve that issue
-# these files will no longer be added explicitly here.
-touch %{buildroot}%{_localstatedir}/log/%{name}/mongrel.log
-touch %{buildroot}%{_localstatedir}/log/%{name}/rails.log
-touch %{buildroot}%{_localstatedir}/log/%{name}/taskomatic.log
-%{__install} -p -m0644 %{pbuild}/conf/%{name}.conf %{buildroot}%{_sysconfdir}/httpd/conf.d
-%{__install} -p -m0644 %{pbuild}/conf/%{name}.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
-
-%{__install} -Dp -m0755 %{pbuild}/conf/deltacloud-mongrel-rails %{buildroot}%{_initrddir}
-%{__install} -Dp -m0644 %{pbuild}/conf/deltacloud-mongrel-rails.sysconf %{buildroot}%{_sysconfdir}/sysconfig/deltacloud-mongrel-rails
-%{__install} -Dp -m0644 %{pbuild}/conf/deltacloud-rails.sysconf %{buildroot}%{_sysconfdir}/sysconfig/deltacloud-rails
-%{__install} -Dp -m0755 %{pbuild}/conf/deltacloud-taskomatic %{buildroot}%{_initrddir}
-
-# copy over all of the src directory...
-%{__cp} -a %{pbuild}/src/* %{buildroot}%{app_root}
-
-
-# move configs to /etc, keeping symlinks for Rails
-%{__mv} %{buildroot}%{app_root}/config/database.yml %{buildroot}%{_sysconfdir}/%{name}
-%{__mv} %{buildroot}%{app_root}/config/environments/development.rb %{buildroot}%{_sysconfdir}/%{name}
-%{__mv} %{buildroot}%{app_root}/config/environments/production.rb %{buildroot}%{_sysconfdir}/%{name}
-%{__mv} %{buildroot}%{app_root}/config/environments/test.rb %{buildroot}%{_sysconfdir}/%{name}
-%{__ln_s} %{_sysconfdir}/%{name}/database.yml %{buildroot}%{app_root}/config
-%{__ln_s} %{_sysconfdir}/%{name}/development.rb %{buildroot}%{app_root}/config/environments
-%{__ln_s} %{_sysconfdir}/%{name}/production.rb %{buildroot}%{app_root}/config/environments
-%{__ln_s} %{_sysconfdir}/%{name}/test.rb %{buildroot}%{app_root}/config/environments
-
-# remove the files not needed for the installation
-%{__rm} -f %{buildroot}%{app_root}/task-omatic/.gitignore
-%{__rm} -f %{buildroot}%{app_root}/vendor/plugins/will_paginate/.gitignore
-%{__rm} -f %{buildroot}%{app_root}/vendor/plugins/will_paginate/.manifest
-
-%{__rm} -rf %{buildroot}%{app_root}/tmp
-%{__mkdir} %{buildroot}%{_localstatedir}/lib/%{name}/tmp
-%{__ln_s} %{_localstatedir}/lib/%{name}/tmp %{buildroot}%{app_root}/tmp
-
-%clean
-rm -rf %{buildroot}
-
-%pre
-getent group dcloud >/dev/null || /usr/sbin/groupadd -g 109 -r dcloud 2>/dev/null || :
-getent passwd dcloud >/dev/null || \
- /usr/sbin/useradd -u 109 -g dcloud -c "dcloud" \
- -s /sbin/nologin -r -d /var/dcloud dcloud 2> /dev/null || :
-
-%post
-# script
-%define daemon_chkconfig_post(d:) \
-/sbin/chkconfig --list %{-d*} >& /dev/null \
-LISTRET=$? \
-/sbin/chkconfig --add %{-d*} \
-if [ $LISTRET -ne 0 ]; then \
- /sbin/chkconfig %{-d*} on \
-fi \
-%{nil}
-
-# if this is the initial RPM install, then we want to turn the new services
-# on; otherwise, we respect the choices the administrator already has made.
-# check this by seeing if each daemon is already installed
-%daemon_chkconfig_post -d deltacloud-mongrel-rails
-%daemon_chkconfig_post -d deltacloud-taskomatic
-
-%preun
-if [ "$1" = 0 ] ; then
- /sbin/service deltacloud-mongrel-rails stop > /dev/null 2>&1
- /sbin/service deltacloud-taskomatic stop > /dev/null 2>&1
- /sbin/chkconfig --del deltacloud-mongrel-rails
- /sbin/chkconfig --del deltacloud-taskomatic
-fi
-
-%files
-%defattr(-,root,root,0755)
-%{_initrddir}/deltacloud-mongrel-rails
-%{_initrddir}/deltacloud-taskomatic
-%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
-%config(noreplace) %{_sysconfdir}/sysconfig/deltacloud-mongrel-rails
-%config(noreplace) %{_sysconfdir}/sysconfig/deltacloud-rails
-%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
-%doc README AUTHORS COPYING
-%attr(-, dcloud, dcloud) %{_localstatedir}/lib/%{name}
-%attr(-, dcloud, dcloud) %{_localstatedir}/run/%{name}
-%attr(-, dcloud, dcloud) %{_localstatedir}/log/%{name}
-%{app_root}
-%dir %{_sysconfdir}/%{name}
-%dir %{_sysconfdir}/%{name}/db
-%config(noreplace) %{_sysconfdir}/%{name}/database.yml
-%config(noreplace) %{_sysconfdir}/%{name}/development.rb
-%config(noreplace) %{_sysconfdir}/%{name}/production.rb
-%config(noreplace) %{_sysconfdir}/%{name}/test.rb
-
-%changelog
-* Fri Sep 1 2009 <sseago(a)redhat.com> - 0.0.1-1
-- Initial build.
--
1.6.2.5
14 years, 2 months
docs/site update plan
by Jason Guiditta
Just want to throw this plan out there to make sure no one strenuously
objects. We have been talking about moving the entire site codebase
(ie, what is displayed on public site) into the docs repo. The main
reasons for this are:
* The current docs (and other pages) are woefully out of date, and not
enough people have the access or ability to update them
* We don't want to deal with the old html duplication of layouts, etc
So, we looked into options for tools that could generate this from
things like haml, sass, markdown, and others. We have settled on using
one called webby (http://webby.rubyforge.org/). The plan is to use this
to generate the html when we make updates and then someone can easily
push this to the live site after local testing (eventually this will be
automated). Following is our plan to make this happen. Right now,
Steve and I will be doing the work, but volunteers to help are welcome!
== The Plan ==
1. Create a temporary repo on fedorapeople. This has the benefit of
being able to put the test version of the generated site up for review
before pushing.
2. Build the basic infrastructure for the main site in webby there.
3. Once that is pretty functional, squash history (local repo, not on
fp) into a reasonable patchset that we can either send to the list, or
just push to docs repo.
4. Add in existing markdown api docs to work in new site structure, push
this as another patch
5. Add any additional bits needed to generate diagrams for api
-j
14 years, 2 months
Added filtering by instance state
by Michal Fojtik
Hi,
This patch will add possibility to filter instances by state.
Basic usage example:
/api/instances?state=RUNNING
Or you could use command line client:
./bin/deltacloudc instances -sRUNNING
./bin/deltacloudc instances -sSTOPPED
I added filters into some drivers which doesn't have filter_on method inside 'instances'.
14 years, 2 months
[PATCH core] Misc small but important fixes
by David Lutterkort
These three patches fix a few crucial things:
1/3 runs the server in development mode by default for better stacktraces
2/3 fixes another Sinatra 0.9.4 incompatibility
3/3 makes requests with extensions (/api/flavors.xml) work under Sinatra 0.9.4
David
14 years, 2 months
Fix for Chrome Accept headers
by Michal Fojtik
Hi everyone,
This little patch will fix Chrome behavior, which I discovered recently.
When you navigate to API page, you will get XML version of API.
This is because Chrome sending 'application/xml' mime type before
'text/html' (which is weird but standard correct).
Unfortunately, we are lacking 'q' parameter handling in 'respond_to'
plugin to handle this correctly...
14 years, 2 months