[PATCH conductor] Deployable XML parsing switched to strict mode
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
https://bugzilla.redhat.com/show_bug.cgi?id=766993
It's not possible to have now wrongly formatted document (missing tags),
DeployableXML raises exception now in this case.
---
src/app/models/deployable.rb | 10 +++++++---
src/app/models/deployment.rb | 2 ++
src/app/util/deployable_xml.rb | 2 +-
src/spec/models/deployable_spec.rb | 8 ++++++++
4 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/src/app/models/deployable.rb b/src/app/models/deployable.rb
index 59c4378..c9446f2 100644
--- a/src/app/models/deployable.rb
+++ b/src/app/models/deployable.rb
@@ -41,9 +41,13 @@ class Deployable < ActiveRecord::Base
PRESET_FILTERS_OPTIONS = []
def valid_deployable_xml?
- deployable_xml = DeployableXML.new(xml)
- unless deployable_xml.validate!
- errors.add(:xml, I18n.t('catalog_entries.flash.warning.not_valid'))
+ begin
+ deployable_xml = DeployableXML.new(xml)
+ unless deployable_xml.validate!
+ errors.add(:xml, I18n.t('catalog_entries.flash.warning.not_valid'))
+ end
+ rescue Nokogiri::XML::SyntaxError => e
+ errors.add(:base, I18n.t("deployments.errors.not_valid_deployable_xml", :msg => "#{e.message}"))
end
end
diff --git a/src/app/models/deployment.rb b/src/app/models/deployment.rb
index 7b5ce76..ea62c33 100644
--- a/src/app/models/deployment.rb
+++ b/src/app/models/deployment.rb
@@ -79,6 +79,8 @@ class Deployment < ActiveRecord::Base
deployable_xml.validate!
rescue DeployableXML::ValidationError => e
errors.add(:deployable_xml, e.message)
+ rescue Nokogiri::XML::SyntaxError => e
+ errors.add(:base, I18n.t("deployments.errors.not_valid_deployable_xml", :msg => "#{e.message}"))
end
end
diff --git a/src/app/util/deployable_xml.rb b/src/app/util/deployable_xml.rb
index 8295340..995cfff 100644
--- a/src/app/util/deployable_xml.rb
+++ b/src/app/util/deployable_xml.rb
@@ -173,7 +173,7 @@ class DeployableXML
if xmlstr_or_node.is_a? Nokogiri::XML::Node
@root = xmlstr_or_node
elsif xmlstr_or_node.is_a? String
- @doc = Nokogiri::XML(xmlstr_or_node)
+ @doc = Nokogiri::XML(xmlstr_or_node) { |config| config.strict }
@root = @doc.root.at_xpath("/deployable") if @doc.root
end
@relax_file = "#{File.dirname(File.expand_path(__FILE__))}/deployable-rng.xml"
diff --git a/src/spec/models/deployable_spec.rb b/src/spec/models/deployable_spec.rb
index 9f7cbaf..cf4bb1d 100644
--- a/src/spec/models/deployable_spec.rb
+++ b/src/spec/models/deployable_spec.rb
@@ -30,4 +30,12 @@ describe Deployable do
doc.at_xpath('/deployable/assemblies/assembly')[:name].should eql(image.name)
doc.at_xpath('/deployable/assemblies/assembly/image')[:id].should eql(image.uuid)
end
+
+ it "should not be valid if xml is not parsable" do
+ deployable = FactoryGirl.build(:deployable)
+ deployable.should be_valid
+ deployable.xml << "</deployable>"
+ deployable.should_not be_valid
+ end
+
end
--
1.7.6
12 years, 3 months
aeolus-cli build : ERROR: => Unknown Error
by Berezovski, Vladimir
Testing Aeolus on FC15 64 bits .
When building new image for ec2 I get this error:
# aeolus-cli build --target ec2 --template ./fc15.tmpl
ERROR: => Unknown Error
#cat <template>
<name>Fedora15Template</name>
<os>
<name>Fedora</name>
<version>15</version>
<arch>x86_64</arch>
<install type="url">
<url>http://download.fedoraproject.org/pub/fedora/linux/releases/15/Fedora/x86...</url>
</install>
<rootpw>linux</rootpw>
</os>
<description>A Fedora 15 Image Factory Template</description>
</template>
/var/log/imagefactory.log says :
2011-12-27 11:05:43,289 DEBUG paste.httpserver.ThreadPool pid(6124) Message: Added task (0 tasks queued)
2011-12-27 11:05:43,414 ERROR imgfac.rest.imagefactory pid(6124) Message: None object cannot be quoted
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/imgfac/rest/imagefactory.py", line 50, in validate_two_leg_oauth
oauth_server.verify_request(req, oauth_consumer, None)
File "/usr/lib/python2.7/site-packages/oauth2/__init__.py", line 602, in verify_request
self._check_signature(request, consumer, token)
File "/usr/lib/python2.7/site-packages/oauth2/__init__.py", line 652, in _check_signature
valid = signature_method.check(request, consumer, token, signature)
File "/usr/lib/python2.7/site-packages/oauth2/__init__.py", line 705, in check
built = self.sign(request, consumer, token)
File "/usr/lib/python2.7/site-packages/oauth2/__init__.py", line 730, in sign
key, raw = self.signing_base(request, consumer, token)
File "/usr/lib/python2.7/site-packages/oauth2/__init__.py", line 722, in signing_base
key = '%s&' % escape(consumer.secret)
File "/usr/lib/python2.7/site-packages/oauth2/__init__.py", line 86, in escape
return urllib.quote(s, safe='~')
File "/usr/lib64/python2.7/urllib.py", line 1225, in quote
raise TypeError('None object cannot be quoted')
TypeError: None object cannot be quoted
Best regards ,
Vladimir Berezovski
________________________________
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster(a)nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes.
To protect the environment please do not print this e-mail unless necessary.
An NDS Group Limited company. www.nds.com
12 years, 4 months
regarding display of existing instances on AWS account
by balan rp
Hi Team,
In my organization, we are using Amazon cloud services.I was
evaluating the cloud management systems and installed the Aeolus for
evaluation.I successfully installed the software on Fedora 16 and
while setting up the configurations, i had a doubt.The documentation
clearly explains method to upload an image to AWS and we can see them
of Aeolus console.But i couldn't see the instances which are present
on my AWS account. My intention is to view my existing instances in
AWS also deploying and managing new one's using Aeolus.
Please could you let me know whether its possible.
Thanks,Balu
12 years, 4 months
[PATCH conductor] Error displayed after provider destroy fails
by Tomas Hrcka
---
src/app/controllers/providers_controller.rb | 13 ++++++++-----
src/config/locales/en.yml | 3 ++-
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/app/controllers/providers_controller.rb b/src/app/controllers/providers_controller.rb
index 1d568f1..efd00b7 100644
--- a/src/app/controllers/providers_controller.rb
+++ b/src/app/controllers/providers_controller.rb
@@ -20,7 +20,6 @@ class ProvidersController < ApplicationController
def index
@params = params
-
begin
@provider = Provider.find(session[:current_provider_id]) if session[:current_provider_id]
rescue ActiveRecord::RecordNotFound => exc
@@ -32,7 +31,7 @@ class ProvidersController < ApplicationController
respond_to do |format|
format.html do
if @providers.present?
- redirect_to edit_provider_path(@provider), :notice => flash[:notice]
+ redirect_to edit_provider_path(@provider), :flash => { :notice => flash[:notice], :error => flash[:error] }
else
render :action => :index
end
@@ -148,11 +147,15 @@ class ProvidersController < ApplicationController
def destroy
provider = Provider.find(params[:id])
require_privilege(Privilege::MODIFY, provider)
- provider.destroy
- session[:current_provider_id] = nil
+ if provider.destroy
+ session[:current_provider_id] = nil
+ flash[:notice] = t("providers.flash.notice.deleted")
+ else
+ flash[:error] = t("providers.flash.error.not_deleted", :errors => provider.errors)
+ end
respond_to do |format|
- format.html { redirect_to providers_path, :notice => t("providers.index.deleted") }
+ format.html { redirect_to providers_path }
end
end
diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
index 7189c5f..6d2d9d0 100644
--- a/src/config/locales/en.yml
+++ b/src/config/locales/en.yml
@@ -886,7 +886,6 @@ en:
provider_type: Provider Type
x_deltacloud_driver: X-Deltacloud-Driver
x_deltacloud_provider: X-Deltacloud-Provider
- deleted: "Provider has been successfully deleted."
no_providers_available: No providers available. Please create one first.
create_new_provider: "Create New Provider"
new:
@@ -913,9 +912,11 @@ en:
added: "Provider added."
updated: "Provider updated."
connected: "Successfully Connected to Provider"
+ deleted: "Provider has been successfully deleted."
error:
not_added: "Cannot add the provider."
not_updated: "Cannot update the provider."
+ not_deleted: "Provider was not deleted, because of errors %{errors}"
warning:
connect_failed: "Failed to connect to Provider!"
alerts:
--
1.7.7.4
12 years, 4 months
problem to push rhev image
by Berezovski, Vladimir
I have a problem to get rhevm image ready before pushing it to rhevm provider . Image status is not being changed at all from NEW to COMPLETED .
In order to proceed with push command I need to know $target_id parameter and although build was release long time ago image status is unknown .
# cat rh6.tmpl
<template>
<name>rhel6_1_x86_64</name>
<os>
<name>RHEL-6</name>
<version>1</version>
<arch>x86_64</arch>
<rootpw>password</rootpw>
<install type='url'>
<url>ftp://loacl_ftp_server/RH6/x86_64/os/</url>
</install>
</os>
<description>rhel 6.1 x86_64 template </description>
</template>
#aeolus-cli build --target rhevm -template rh6.tmpl
This was done yesterday .
Examining this image today gives this info :
# aeolus-cli list --builds 2a1d7009-8d86-4148-b941-e4817cdce816
ID Image
------------------------------------ ------------------------------------
37ba4394-3e5a-41ff-9f7d-71380a368d70 2a1d7009-8d86-4148-b941-e4817cdce816
[root@rh6lab3 ~]# aeolus-cli list --targetimages 37ba4394-3e5a-41ff-9f7d-71380a368d70
ID Status Build
-- ------ -----
In a case with ec2 provider I see image status is COMPLETED .
As a result it is not possible to push this image . In /var/log/imagefactory.log nothing suspicious .
Best regards ,
Vladimir Berezovski
________________________________
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster(a)nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes.
To protect the environment please do not print this e-mail unless necessary.
An NDS Group Limited company. www.nds.com
12 years, 4 months
[PATCH conductor] BZ 769635, added scope enabled to Provider and ProviderAccount
by Tomas Hrcka
---
src/app/controllers/images_controller.rb | 8 ++++----
src/app/models/provider.rb | 2 ++
src/app/models/provider_account.rb | 2 ++
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/app/controllers/images_controller.rb b/src/app/controllers/images_controller.rb
index d793432..4e1921a 100644
--- a/src/app/controllers/images_controller.rb
+++ b/src/app/controllers/images_controller.rb
@@ -44,14 +44,14 @@ class ImagesController < ApplicationController
pimg = @image.provider_images.first
provider = Provider.find_by_name(pimg.provider)
type = provider.provider_type
- acct = ProviderAccount.find_by_provider_name_and_login(provider.name, pimg.provider_account_identifier)
+ acct = ProviderAccount.enabled.find_by_provider_name_and_login(provider.name, pimg.provider_account_identifier)
raise unless acct
@account_groups = {type.deltacloud_driver => {:type => type, :accounts => [acct]}}
rescue Exception => e
- @account_groups = ProviderAccount.group_by_type(current_user)
+ @account_groups = ProviderAccount.enabled.group_by_type(current_user)
end
else
- @account_groups = ProviderAccount.group_by_type(current_user)
+ @account_groups = ProviderAccount.enabled.group_by_type(current_user)
end
# according to imagefactory Builder.first shouldn't be implemented yet
# but it does what we need - returns builder object which contains
@@ -83,7 +83,7 @@ class ImagesController < ApplicationController
def new
if 'import' == params[:tab]
- @accounts = ProviderAccount.list_for_user(current_user, Privilege::USE)
+ @accounts = ProviderAccount.enabled.list_for_user(current_user, Privilege::USE)
render :import and return
else
@environment = PoolFamily.find(params[:environment])
diff --git a/src/app/models/provider.rb b/src/app/models/provider.rb
index 45bfd84..693d921 100644
--- a/src/app/models/provider.rb
+++ b/src/app/models/provider.rb
@@ -59,6 +59,8 @@ class Provider < ActiveRecord::Base
before_destroy :destroyable?
+ scope :enabled, where("enabled = ?", true)
+
def encoded_url_with_driver_and_provider
url_extras = ";driver=#{provider_type.deltacloud_driver}"
if deltacloud_provider
diff --git a/src/app/models/provider_account.rb b/src/app/models/provider_account.rb
index 8079119..8332135 100644
--- a/src/app/models/provider_account.rb
+++ b/src/app/models/provider_account.rb
@@ -68,6 +68,8 @@ class ProviderAccount < ActiveRecord::Base
before_create :no_account?
before_destroy :destroyable?
+ scope :enabled, where(:provider_id => Provider.enabled)
+
def validate_presence_of_credentials
provider.provider_type.credential_definitions.each do |cd|
errors.add(:base, "#{cd.label} can't be blank") if credentials_hash[cd.name].blank?
--
1.7.7.4
12 years, 4 months
[PATCH conductor] BZ#766163 Add reboot_multiple to grid view of instances, controller method and localization.
by Tomas Hrcka
---
src/app/controllers/instances_controller.rb | 22 ++++++++++++++++++++++
src/app/views/instances/_list.html.haml | 1 +
src/config/locales/en.yml | 1 +
src/config/routes.rb | 1 +
4 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/src/app/controllers/instances_controller.rb b/src/app/controllers/instances_controller.rb
index 5979a1c..23b404b 100644
--- a/src/app/controllers/instances_controller.rb
+++ b/src/app/controllers/instances_controller.rb
@@ -178,6 +178,28 @@ class InstancesController < ApplicationController
do_operation(:reboot)
end
+ def multi_reboot
+ notices = ""
+ errors = ""
+ Instance.find(params[:instance_selected] || []).each do |instance|
+ begin
+ require_privilege(Privilege::USE,instance)
+ instance.reboot
+ notices << "#{instance.name}: #{t('instances.flash.notice.reboot')}"
+ rescue Exception => err
+ errors << "#{instance.name}: " + err
+ end
+ end
+ # If nothing is selected, display an error message:
+ errors = t('instances.none_selected') if errors.blank? && notices.blank?
+ flash[:notice] = notices unless notices.blank?
+ flash[:error] = errors unless errors.blank?
+ respond_to do |format|
+ format.html { redirect_to params[:backlink] || pools_path(:view => 'filter', :details_tab => 'instances') }
+ format.json { render :json => {:success => notices, :errors => errors} }
+ end
+ end
+
def filter
redirect_to_original({"instances_preset_filter" => params[:instances_preset_filter], "instances_search" => params[:instances_search]})
end
diff --git a/src/app/views/instances/_list.html.haml b/src/app/views/instances/_list.html.haml
index 8e68a2b..6b5a21a 100644
--- a/src/app/views/instances/_list.html.haml
+++ b/src/app/views/instances/_list.html.haml
@@ -1,6 +1,7 @@
- content_for :form_header do
%li= link_to "#{t'instances.list.export_events'}", export_events_instances_path, :class => 'button'
%li= restful_submit_tag "#{t'instances.list.stop_selected_instances'}", 'stop', multi_stop_instances_path, 'GET', :class => 'button', :id => 'stop_selected_instances'
+ %li= restful_submit_tag "#{t'instances.list.reboot_selected_instances'}", 'reboot', multi_reboot_instances_path, 'GET', :class => 'button', :id => 'reboot_selected_instances'
= hidden_field_tag 'backlink', request.url
- content_for :filter_controls do
diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
index 99050d5..10fd03a 100644
--- a/src/config/locales/en.yml
+++ b/src/config/locales/en.yml
@@ -275,6 +275,7 @@ en:
list:
export_events: Export events
stop_selected_instances: Stop selected instances
+ reboot_selected_instances: Reboot selected instances
stopped_instances_hidden: Stopped instances are hidden
showing_all_instances: Showing all instances
show_all: show all
diff --git a/src/config/routes.rb b/src/config/routes.rb
index 09e96be..94e87e8 100644
--- a/src/config/routes.rb
+++ b/src/config/routes.rb
@@ -118,6 +118,7 @@ Conductor::Application.routes.draw do
collection do
get 'start'
get 'multi_stop'
+ get 'multi_reboot'
get 'remove_failed'
get 'export_events'
post 'filter'
--
1.7.7.4
12 years, 4 months
[PATCH aeolus-cli (rev 3)] Changes to build behavior in rpmtask.rb, Rakefile
by steve linabery
(revision 3 of patch)
Source a .spec.in file and output .spec.
Determine whether to include extra_release based on setting of Release in .spec.in
Make Version a constant in Rakefile.
---
Rakefile | 5 +-
rake/rpmtask.rb | 31 +++++++++----
rubygem-aeolus-cli.spec | 113 --------------------------------------------
rubygem-aeolus-cli.spec.in | 113 ++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 138 insertions(+), 124 deletions(-)
delete mode 100644 rubygem-aeolus-cli.spec
create mode 100644 rubygem-aeolus-cli.spec.in
diff --git a/Rakefile b/Rakefile
index f37a160..2d39510 100644
--- a/Rakefile
+++ b/Rakefile
@@ -23,10 +23,11 @@ require 'rake/rpmtask'
RPMBUILD_DIR = "#{File.expand_path('~')}/rpmbuild"
RPM_SPEC = "rubygem-aeolus-cli.spec"
+PKG_VERSION = "0.3.0"
spec = Gem::Specification.new do |s|
s.name = 'aeolus-cli'
- s.version = '0.3.0'
+ s.version = PKG_VERSION
s.summary= 'cli for aeolus cloud suite'
s.description = 'Commandline interface for working with the aeolus cloud management suite'
s.author = 'Jason Guiditta, Martyn Taylor'
@@ -67,7 +68,7 @@ RSpec::Core::RakeTask.new do |t|
t.pattern = FileList['spec/**/*.rb']
end
-Rake::RpmTask.new(RPM_SPEC) do |rpm|
+Rake::RpmTask.new(RPM_SPEC, {:suffix => '.in', :pkg_version => PKG_VERSION}) do |rpm|
rpm.need_tar = true
rpm.package_files.include("lib/*")
rpm.topdir = "#{RPMBUILD_DIR}"
diff --git a/rake/rpmtask.rb b/rake/rpmtask.rb
index 93d24e9..94bd143 100644
--- a/rake/rpmtask.rb
+++ b/rake/rpmtask.rb
@@ -26,24 +26,41 @@ module Rake
# Create a package based upon a RPM spec.
# RPM packages, can be produced by this task.
class RpmTask < PackageTask
- # RPM spec containing the metadata for this package
+ # filename for output RPM spec
attr_accessor :rpm_spec
+ # package version
+ attr_accessor :pkg_version
+
# RPM build dir
attr_accessor :topdir
# Include extra_release information in the rpm
attr_accessor :include_extra_release
- def initialize(rpm_spec)
- init(rpm_spec)
+ def initialize(rpm_spec, args = {})
+ init(rpm_spec,args)
yield self if block_given?
define if block_given?
end
- def init(rpm_spec)
- @include_extra_release = true
+ def init(rpm_spec,args)
@rpm_spec = rpm_spec
+
+ if args[:suffix]
+ rpm_spec_in = @rpm_spec + args[:suffix]
+ @include_extra_release = eval `grep -q '^[[:space:]]*Release:[[:space:]]*0' #{rpm_spec_in} && echo true || echo false`
+
+ git_head = `git log -1 --pretty=format:%h`
+ extra_release = @include_extra_release ? ("." + Time.now.strftime("%Y%m%d%H%M%S").gsub(/\s/, '') + "git" + "#{git_head}") : ''
+
+ if args[:pkg_version]
+ pkg_version = args[:pkg_version]
+ `sed -e "s|@VERSION@|#{pkg_version}|;s|^\\(Release:[^%]*\\)|\\1#{extra_release}|" #{rpm_spec_in} > #{@rpm_spec}`
+ else
+ `sed -e "s|^\\(Release:[^%]*\\)|\\1#{extra_release}|" #{rpm_spec_in} > #{@rpm_spec}`
+ end
+ end
# parse this out of the rpmbuild macros,
# not ideal but better than hardcoding this
@@ -94,16 +111,12 @@ module Rake
# FIXME properly determine :package build artifact(s) to copy to sources dir
file rpm_file, [:include_extra_release] => [:package, "#{@topdir}/SOURCES", "#{@topdir}/SPECS"] do |t,args|
- @include_extra_release = args.include_extra_release != "false"
- git_head = `git log -1 --pretty=format:%h`
- extra_release = "." + Time.now.strftime("%Y%m%d%H%M%S").gsub(/\s/, '') + "git" + "#{git_head}"
cp "#{package_dir}/#{@name}-#{(a)version}.tgz", "#{@topdir}/SOURCES/"
# FIXME - This seems like a hack, but we don't know the gem's name
cp "#{package_dir}/#{(a)name.gsub('rubygem-', '')}-#{(a)version}.gem", "#{@topdir}/SOURCES/"
cp @rpm_spec, "#{@topdir}/SPECS"
sh "#{@rpmbuild_cmd} " +
"--define '_topdir #{@topdir}' " +
- "--define 'extra_release #{@include_extra_release ? extra_release : ''}' " +
"-ba #{@rpm_spec}"
end
end
diff --git a/rubygem-aeolus-cli.spec b/rubygem-aeolus-cli.spec
deleted file mode 100644
index bf46aa5..0000000
--- a/rubygem-aeolus-cli.spec
+++ /dev/null
@@ -1,113 +0,0 @@
-%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
-%global gemname aeolus-cli
-%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
-%global mandir %{_mandir}/man1
-%global rubyabi 1.8
-
-Summary: Command-line interface for working with the Aeolus cloud suite
-Name: rubygem-aeolus-cli
-Version: 0.3.0
-Release: 0%{?extra_release}%{?dist}
-Group: Development/Languages
-License: ASL 2.0
-URL: http://aeolusproject.org
-
-# The source for this packages was pulled from the upstream's git repo.
-# Use the following commands to generate the gem
-# git clone git://github.com/aeolusproject/aeolus-cli.git
-# cd aeolus-cli
-# rake gem
-Source0: %{gemname}-%{version}.gem
-
-Requires: ruby(abi) = %{rubyabi}
-Requires: rubygems
-Requires: rubygem(nokogiri) >= 1.4.0
-Requires: rubygem(rest-client)
-Requires: rubygem(imagefactory-console) >= 0.4.0
-Requires: rubygem(activesupport)
-Requires: rubygem(activeresource)
-
-BuildRequires: ruby
-BuildRequires: rubygems
-BuildRequires: rubygem(rspec-core)
-
-BuildArch: noarch
-Provides: rubygem(%{gemname}) = %{version}
-
-%description
-CLI for Aeolus Image Factory
-
-%prep
-%setup -q -c -T
-mkdir -p ./%{gemdir}
-gem install --local --install-dir ./%{gemdir} --force --rdoc %{SOURCE0}
-
-%build
-
-%install
-rm -rf %{buildroot}
-mkdir -p %{buildroot}%{gemdir}
-cp -a .%{gemdir}/* %{buildroot}%{gemdir}/
-
-mkdir -p %{buildroot}/%{_bindir}
-mv %{buildroot}%{gemdir}/bin/* %{buildroot}/%{_bindir}
-find %{buildroot}%{geminstdir}/bin -type f | xargs chmod 755
-rmdir %{buildroot}%{gemdir}/bin
-rm -rf %{buildroot}%{gemdir}/gems/%{gemname}-%{version}/.yardoc
-
-mkdir -p %{buildroot}%{mandir}
-mv %{buildroot}%{geminstdir}/man/* %{buildroot}%{mandir}
-
-%files
-%doc %{geminstdir}/COPYING
-%{_bindir}/aeolus
-%{_bindir}/aeolus-image
-%dir %{geminstdir}
-%{geminstdir}/Rakefile
-%{geminstdir}/bin
-%{geminstdir}/examples
-%{geminstdir}/lib
-%{geminstdir}/man
-%{geminstdir}/spec
-%doc %{gemdir}/doc/%{gemname}-%{version}
-%{gemdir}/cache/%{gemname}-%{version}.gem
-%{gemdir}/specifications/%{gemname}-%{version}.gemspec
-%{mandir}/*
-
-%changelog
-* Thu Dec 1 2011 Steve Linabery <slinaber(a)redhat.com> - 0.3.0-0
-- Bump version
-
-* Thu Dec 1 2011 Steve Linabery <slinaber(a)redhat.com> - 0.2.0-1
-- 785c8be Change and refactor tests for refactored option parser use
-- 911d47c refactored option parser to support multiple same options
-- dd580f4 Set language in HTTP_ACCEPT_LANGUAGE header
-- 48bbaa0 RM 2803 - Add status checking on image builds and pushes - v2
-- 6907390 Added provider content cleanup output
-- d721dc0 added mention of .aeolus-cli into default help
-- 44aa00c added section explaining .aeolus-cli into manpage
-- 5db097e Added format since ARes changed default
-- f0df5bb added dependency on ActiveSupport and ActiveResource to specfile
-- 445347f bumped version in gem specification to reflect ver. in specfile
-- 97585c1 Utilize Conductor API Error Messaging
-
-* Mon Nov 21 2011 Maros Zatko <mzatko(a)redhat.com> 0.2.0-0
-- added dependency on ActiveSupport and ActiveResource
-
-* Wed Nov 16 2011 Steve Linabery <slinaber(a)redhat.com> 0.2.0-0
-- bump version and release for ongoing development
-
-* Wed Nov 9 2011 Martyn Taylor <mmorsi(a)redhat.com> - 0.0.1-4
-- Renamed Bin file to aeolus-cli
-
-* Wed Jul 20 2011 Mo Morsi <mmorsi(a)redhat.com> - 0.0.1-3
-- more updates to conform to fedora guidelines
-
-* Fri Jul 15 2011 Mo Morsi <mmorsi(a)redhat.com> - 0.0.1-2
-- updated package to conform to fedora guidelines
-
-* Mon Jul 04 2011 <mtaylor(a)redhat.com> - 0.0.1-1
-- Added man files
-
-* Wed Jun 15 2011 <jguiditt(a)redhat.com> - 0.0.1-1
-- Initial package
diff --git a/rubygem-aeolus-cli.spec.in b/rubygem-aeolus-cli.spec.in
new file mode 100644
index 0000000..100d5c0
--- /dev/null
+++ b/rubygem-aeolus-cli.spec.in
@@ -0,0 +1,113 @@
+%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
+%global gemname aeolus-cli
+%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
+%global mandir %{_mandir}/man1
+%global rubyabi 1.8
+
+Summary: Command-line interface for working with the Aeolus cloud suite
+Name: rubygem-aeolus-cli
+Version: @VERSION@
+Release: 0%{?extra_release}%{?dist}
+Group: Development/Languages
+License: ASL 2.0
+URL: http://aeolusproject.org
+
+# The source for this packages was pulled from the upstream's git repo.
+# Use the following commands to generate the gem
+# git clone git://github.com/aeolusproject/aeolus-cli.git
+# cd aeolus-cli
+# rake gem
+Source0: %{gemname}-%{version}.gem
+
+Requires: ruby(abi) = %{rubyabi}
+Requires: rubygems
+Requires: rubygem(nokogiri) >= 1.4.0
+Requires: rubygem(rest-client)
+Requires: rubygem(imagefactory-console) >= 0.4.0
+Requires: rubygem(activesupport)
+Requires: rubygem(activeresource)
+
+BuildRequires: ruby
+BuildRequires: rubygems
+BuildRequires: rubygem(rspec-core)
+
+BuildArch: noarch
+Provides: rubygem(%{gemname}) = %{version}
+
+%description
+CLI for Aeolus Image Factory
+
+%prep
+%setup -q -c -T
+mkdir -p ./%{gemdir}
+gem install --local --install-dir ./%{gemdir} --force --rdoc %{SOURCE0}
+
+%build
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}%{gemdir}
+cp -a .%{gemdir}/* %{buildroot}%{gemdir}/
+
+mkdir -p %{buildroot}/%{_bindir}
+mv %{buildroot}%{gemdir}/bin/* %{buildroot}/%{_bindir}
+find %{buildroot}%{geminstdir}/bin -type f | xargs chmod 755
+rmdir %{buildroot}%{gemdir}/bin
+rm -rf %{buildroot}%{gemdir}/gems/%{gemname}-%{version}/.yardoc
+
+mkdir -p %{buildroot}%{mandir}
+mv %{buildroot}%{geminstdir}/man/* %{buildroot}%{mandir}
+
+%files
+%doc %{geminstdir}/COPYING
+%{_bindir}/aeolus
+%{_bindir}/aeolus-image
+%dir %{geminstdir}
+%{geminstdir}/Rakefile
+%{geminstdir}/bin
+%{geminstdir}/examples
+%{geminstdir}/lib
+%{geminstdir}/man
+%{geminstdir}/spec
+%doc %{gemdir}/doc/%{gemname}-%{version}
+%{gemdir}/cache/%{gemname}-%{version}.gem
+%{gemdir}/specifications/%{gemname}-%{version}.gemspec
+%{mandir}/*
+
+%changelog
+* Thu Dec 1 2011 Steve Linabery <slinaber(a)redhat.com> - 0.3.0-0
+- Bump version
+
+* Thu Dec 1 2011 Steve Linabery <slinaber(a)redhat.com> - 0.2.0-1
+- 785c8be Change and refactor tests for refactored option parser use
+- 911d47c refactored option parser to support multiple same options
+- dd580f4 Set language in HTTP_ACCEPT_LANGUAGE header
+- 48bbaa0 RM 2803 - Add status checking on image builds and pushes - v2
+- 6907390 Added provider content cleanup output
+- d721dc0 added mention of .aeolus-cli into default help
+- 44aa00c added section explaining .aeolus-cli into manpage
+- 5db097e Added format since ARes changed default
+- f0df5bb added dependency on ActiveSupport and ActiveResource to specfile
+- 445347f bumped version in gem specification to reflect ver. in specfile
+- 97585c1 Utilize Conductor API Error Messaging
+
+* Mon Nov 21 2011 Maros Zatko <mzatko(a)redhat.com> 0.2.0-0
+- added dependency on ActiveSupport and ActiveResource
+
+* Wed Nov 16 2011 Steve Linabery <slinaber(a)redhat.com> 0.2.0-0
+- bump version and release for ongoing development
+
+* Wed Nov 9 2011 Martyn Taylor <mmorsi(a)redhat.com> - 0.0.1-4
+- Renamed Bin file to aeolus-cli
+
+* Wed Jul 20 2011 Mo Morsi <mmorsi(a)redhat.com> - 0.0.1-3
+- more updates to conform to fedora guidelines
+
+* Fri Jul 15 2011 Mo Morsi <mmorsi(a)redhat.com> - 0.0.1-2
+- updated package to conform to fedora guidelines
+
+* Mon Jul 04 2011 <mtaylor(a)redhat.com> - 0.0.1-1
+- Added man files
+
+* Wed Jun 15 2011 <jguiditt(a)redhat.com> - 0.0.1-1
+- Initial package
--
1.7.6.4
12 years, 4 months