Fwd: Rails 4 will be only Ruby 1.9.3 compatible
by Mo Morsi
With ruby 1.9.3 on the horizon for Fedora and Rails 4 development
starting up, early next year would be a good time to start thinking
about updating our project.
-Mo
-------- Original Message --------
Subject: Rails 4 will be only Ruby 1.9.3 compatible
Date: Wed, 21 Dec 2011 09:01:23 +0100
From: Vít Ondruch <vondruch(a)redhat.com>
Reply-To: Ruby SIG mailing list <ruby-sig(a)lists.fedoraproject.org>
To: Ruby SIG mailing list <ruby-sig(a)lists.fedoraproject.org>
Hi all,
You are probably already aware, but just for your information, Ruby on
Rails 4.0 will be compatible only with Ruby 1.9.3 and should be released
in the summer 2012
http://weblog.rubyonrails.org/2011/12/20/rails-master-is-now-4-0-0-beta
Vit
_______________________________________________
ruby-sig mailing list
ruby-sig(a)lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/ruby-sig
12 years, 4 months
[PATCH conductor 1/3] BZ 768089: Refactor provider account matching to facilitate stubbing (revised)
by Scott Seago
Instance.match was one long 70 line method, which wasn't conducive to stubbing out parts of it for rspec tests.
---
src/app/models/instance.rb | 51 +++++++-----------------------------
src/app/models/provider_account.rb | 31 ++++++++++++++++++++++
src/app/util/taskomatic.rb | 11 +++++---
3 files changed, 48 insertions(+), 45 deletions(-)
diff --git a/src/app/models/instance.rb b/src/app/models/instance.rb
index 08aa3b6..111cbd9 100644
--- a/src/app/models/instance.rb
+++ b/src/app/models/instance.rb
@@ -184,6 +184,15 @@ class Instance < ActiveRecord::Base
Aeolus::Image::Warehouse::ImageBuild.find(image_build_uuid) if image_build_uuid
end
+ def build
+ image_build || (image.nil? ? nil : image.latest_pushed_build)
+ end
+
+ def provider_images_for_match(provider)
+ the_build = build
+ (the_build ? the_build.provider_images : []).select {|pi| pi.provider_name == provider.name}
+ end
+
def assembly_xml
@assembly_xml ||= AssemblyXML.new(self[:assembly_xml].to_s)
end
@@ -346,50 +355,10 @@ class Instance < ActiveRecord::Base
errors << I18n.t('instances.errors.image_not_found', :b_uuid=> image_build_uuid, :i_uuid => image_uuid) if image_build.nil? and image.nil?
return [[], errors] unless errors.empty?
- build = image_build || image.latest_pushed_build
- provider_images = build ? build.provider_images : []
matched = []
pool.pool_family.provider_accounts.each do |account|
- unless account.provider.enabled?
- errors << I18n.t('instances.errors.must_be_enabled', :account_name => account.name)
- next
- end
+ account.instance_matches(self, matched, errors)
- # match_provider_hardware_profile returns a single provider
- # hardware_profile that can satisfy the input hardware_profile
- hwp = HardwareProfile.match_provider_hardware_profile(account.provider,
- hardware_profile)
- unless hwp
- errors << I18n.t('instances.errors.hw_profile_match_not_found', :account_name => account.name)
- next
- end
- account_images = provider_images.select {|pi| pi.provider_name == account.provider.name}
- if account_images.empty?
- errors << I18n.t('instances.errors.image_not_pushed_to_provider', :account_name => account.name)
- next
- end
- if account.quota.reached?
- errors << I18n.t('instances.errors.provider_account_quota_reached', :account_name => account.name)
- next
- end
- if requires_config_server? and account.config_server.nil?
- errors << I18n.t('instances.errors.no_config_server_available', :account_name => account.name)
- next
- end
- account_images.each do |pi|
- if not frontend_realm.nil?
- brealms = frontend_realm.realm_backend_targets.select {|brealm_target| brealm_target.target_provider == account.provider}
- if brealms.empty?
- errors << I18n.t('instances.errors.realm_not_mapped', :frontend_realm_name => frontend_realm.name)
- next
- end
- brealms.each do |brealm_target|
- matched << Match.new(pool.pool_family, account, hwp, pi, brealm_target.target_realm)
- end
- else
- matched << Match.new(pool.pool_family, account, hwp, pi, nil)
- end
- end
end
[matched, errors]
diff --git a/src/app/models/provider_account.rb b/src/app/models/provider_account.rb
index 88ac8d4..8079119 100644
--- a/src/app/models/provider_account.rb
+++ b/src/app/models/provider_account.rb
@@ -338,6 +338,37 @@ class ProviderAccount < ActiveRecord::Base
end
end
+ def instance_matches(instance, matched, errors)
+ if !provider.enabled?
+ errors << I18n.t('instances.errors.must_be_enabled', :account_name => name)
+ elsif quota.reached?
+ errors << I18n.t('instances.errors.provider_account_quota_reached', :account_name => name)
+ # match_provider_hardware_profile returns a single provider
+ # hardware_profile that can satisfy the input hardware_profile
+ elsif !(hwp = HardwareProfile.match_provider_hardware_profile(provider, instance.hardware_profile))
+ errors << I18n.t('instances.errors.hw_profile_match_not_found', :account_name => name)
+ elsif (account_images = instance.provider_images_for_match(provider)).empty?
+ errors << I18n.t('instances.errors.image_not_pushed_to_provider', :account_name => name)
+ elsif instance.requires_config_server? and config_server.nil?
+ errors << I18n.t('instances.errors.no_config_server_available', :account_name => name)
+ else
+ account_images.each do |pi|
+ if not instance.frontend_realm.nil?
+ brealms = instance.frontend_realm.realm_backend_targets.select {|brealm_target| brealm_target.target_provider == provider}
+ if brealms.empty?
+ errors << I18n.t('instances.errors.realm_not_mapped', :frontend_realm_name => instance.frontend_realm.name)
+ next
+ end
+ brealms.each do |brealm_target|
+ matched << Instance::Match.new(instance.pool.pool_family, self, hwp, pi, brealm_target.target_realm)
+ end
+ else
+ matched << Instance::Match.new(instance.pool.pool_family, self, hwp, pi, nil)
+ end
+ end
+ end
+ end
+
private
def self.apply_search_filter(search)
diff --git a/src/app/util/taskomatic.rb b/src/app/util/taskomatic.rb
index 9750873..3629706 100644
--- a/src/app/util/taskomatic.rb
+++ b/src/app/util/taskomatic.rb
@@ -32,10 +32,7 @@ module Taskomatic
task.state = Task::STATE_RUNNING
task.save!
-
- Rails.logger.info "Task instance create completed with key #{dcloud_instance.id} and state #{dcloud_instance.state}"
- task.instance.external_key = dcloud_instance.id
- task.instance.state = dcloud_to_instance_state(dcloud_instance.state)
+ handle_instance_state(task.instance,dcloud_instance)
task.instance.save!
rescue HttpException => ex
task.failure_code = Task::FAILURE_PROVIDER_CONTACT_FAILED
@@ -48,6 +45,12 @@ module Taskomatic
end
end
+ def self.handle_instance_state(instance, dcloud_instance)
+ Rails.logger.info "Task instance create completed with key #{dcloud_instance.id} and state #{dcloud_instance.state}"
+ instance.external_key = dcloud_instance.id
+ instance.state = dcloud_to_instance_state(dcloud_instance.state)
+ end
+
def self.do_action(task, action)
task.time_started = Time.now
--
1.7.6.4
12 years, 4 months
General_Development_Process
by Mike Orazi
All,
I recently reviewed our general development process [1] and made some minor updates. It was my best effort at trying to describe our **current** norms that the community put forward quite some time ago. I really only made updates to remove meetings that are no longer regularly held & to adjust the time line for the the last week of a sprint to reflect the somewhat recent adjustment to sprint demos on Tuesdays. If there are any glaring issues, feel free to update at will!
Since there have been a number of questions about bugzilla states raised on irc, I thought it would be a good time to highlight the last section on that page covers our current conventions (and crutches somewhat on the state definitions on the bugzilla instance [2]).
The big note here is this is the **current** norms and I suspect that as we continue to grow and mature as a community things will get updated (and likely sooner rather than later) to help us all work easier/better/faster/smarter.
Thanks,
Mike
[1] https://www.aeolusproject.org/redmine/projects/aeolus/wiki/General_Develo...
[2] https://bugzilla.redhat.com/page.cgi?id=fields.html#status
12 years, 4 months
[PATCH configure] BZ 746702 - Check node config files are in correct format before executing puppet
by Richard Su
aeolus-configure and aeolus-cleanup calls aeolus-node-check to verify node config
files are correctly formatted. If there is a formatting problem, the file name
and the line number causing the issue are displayed.
---
bin/aeolus-cleanup | 6 +++
bin/aeolus-configure | 4 ++
bin/aeolus-node-check | 43 ++++++++++++++++++++
contrib/aeolus-configure.spec | 1 +
spec/fixtures/nodes/good-node-file | 8 ++++
.../no-colon-between-parameter-name-and-value | 1 +
.../nodes/no-space-between-dash-and-class-name | 1 +
.../no-space-between-parameter-name-and-value | 1 +
.../fixtures/nodes/one-space-before-parameter-name | 1 +
.../nodes/three-spaces-before-parameter-name | 1 +
spec/node-check_spec.rb | 38 +++++++++++++++++
11 files changed, 105 insertions(+), 0 deletions(-)
create mode 100755 bin/aeolus-node-check
create mode 100644 spec/fixtures/nodes/good-node-file
create mode 100644 spec/fixtures/nodes/no-colon-between-parameter-name-and-value
create mode 100644 spec/fixtures/nodes/no-space-between-dash-and-class-name
create mode 100644 spec/fixtures/nodes/no-space-between-parameter-name-and-value
create mode 100644 spec/fixtures/nodes/one-space-before-parameter-name
create mode 100644 spec/fixtures/nodes/three-spaces-before-parameter-name
create mode 100644 spec/node-check_spec.rb
diff --git a/bin/aeolus-cleanup b/bin/aeolus-cleanup
index 230b9a9..a538719 100644
--- a/bin/aeolus-cleanup
+++ b/bin/aeolus-cleanup
@@ -50,6 +50,12 @@ PUPPET_NODE='cleanup'
export FACTER_AEOLUS_ENABLE_HTTPS=true
export FACTER_AEOLUS_ENABLE_SECURITY=false
+
+/usr/share/aeolus-configure/modules/aeolus/aeolus-node-check /etc/aeolus-configure/nodes/$PUPPET_NODE
+if [ $? != 0 ]; then
+ exit 1
+fi
+
puppet /usr/share/aeolus-configure/modules/aeolus/aeolus.pp \
--modulepath=/usr/share/aeolus-configure/modules/ \
--external_nodes "/bin/sh /usr/share/aeolus-configure/modules/aeolus/aeolus-node $PUPPET_NODE" --node_terminus exec \
diff --git a/bin/aeolus-configure b/bin/aeolus-configure
index 9b57b99..16301a1 100755
--- a/bin/aeolus-configure
+++ b/bin/aeolus-configure
@@ -72,6 +72,10 @@ export FACTER_RAILS_TOKEN=`</dev/urandom tr -dc a-f0-9 | head -c128`
NODE_ARRAY=(`echo $PUPPET_NODE | tr "," "\n"`)
for x in "${NODE_ARRAY[@]}"
do
+ /usr/share/aeolus-configure/modules/aeolus/aeolus-node-check /etc/aeolus-configure/nodes/$x
+ if [ $? != 0 ]; then
+ exit 1
+ fi
puppet /usr/share/aeolus-configure/modules/aeolus/aeolus.pp \
--modulepath=/usr/share/aeolus-configure/modules/ \
--external_nodes "/bin/sh /usr/share/aeolus-configure/modules/aeolus/aeolus-node $x" --node_terminus exec \
diff --git a/bin/aeolus-node-check b/bin/aeolus-node-check
new file mode 100755
index 0000000..4fe9ad8
--- /dev/null
+++ b/bin/aeolus-node-check
@@ -0,0 +1,43 @@
+#!/usr/bin/ruby
+
+# Copyright 2011 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+filename = ARGV[0]
+file = File.open(filename, 'r') or raise "Could not open file\n"
+counter = 1
+errors = []
+while (line = file.gets)
+ if (line != "\n" && line[0..0] != "#" && line[0..10] != "parameters:" && line[0..7] != "classes:" && line[0..1] != "--")
+ # skip any non parameter or classes lines
+ if (line[0..1] == " " && line[2..2] != " " && line.index(":") != nil && line.split(":")[1][0..0] == " ")
+ # matches correct parameter line
+ elsif (line[0..1] == "- ")
+ # matches correct classes line
+ else
+ errors << "incorrect format in line #{counter}: #{line}"
+ end
+ end
+ counter = counter + 1
+end
+file.close
+
+if (errors.size() > 0)
+ puts "Errors found in #{filename}"
+ puts "parameters must be in the form [space][space][parameter name][colon][space][parameter value]"
+ puts "classes must be in the form [dash][space][class name]"
+ errors.each { |e| puts e }
+ exit 1
+end
+exit 0
diff --git a/contrib/aeolus-configure.spec b/contrib/aeolus-configure.spec
index 93fd0e1..9fec9c2 100644
--- a/contrib/aeolus-configure.spec
+++ b/contrib/aeolus-configure.spec
@@ -47,6 +47,7 @@ Aeolus Configure Puppet Recipe
%{__cp} -R %{pbuild}/recipes/openssl/ %{buildroot}/%{aeolushome}/modules/openssl
%{__cp} -R %{pbuild}/recipes/postgres/ %{buildroot}/%{aeolushome}/modules/postgres
%{__cp} -R %{pbuild}/bin/aeolus-node %{buildroot}/%{aeolushome}/modules/aeolus/
+%{__cp} -R %{pbuild}/bin/aeolus-node-check %{buildroot}/%{aeolushome}/modules/aeolus/
%{__cp} -R %{pbuild}/bin/aeolus-check-services %{buildroot}/%{_bindir}/
%{__cp} -R %{pbuild}/bin/aeolus-restart-services %{buildroot}/%{_sbindir}/
%{__cp} -R %{pbuild}/bin/aeolus-configure-image %{buildroot}/%{_sbindir}/
diff --git a/spec/fixtures/nodes/good-node-file b/spec/fixtures/nodes/good-node-file
new file mode 100644
index 0000000..af4f2c1
--- /dev/null
+++ b/spec/fixtures/nodes/good-node-file
@@ -0,0 +1,8 @@
+#
+
+#
+---
+parameters:
+ enable_https: true
+classes:
+- aeolus::conductor
\ No newline at end of file
diff --git a/spec/fixtures/nodes/no-colon-between-parameter-name-and-value b/spec/fixtures/nodes/no-colon-between-parameter-name-and-value
new file mode 100644
index 0000000..76d3c1d
--- /dev/null
+++ b/spec/fixtures/nodes/no-colon-between-parameter-name-and-value
@@ -0,0 +1 @@
+ rhevm_nfs_server virtlab108.virt.bos.redhat.com
\ No newline at end of file
diff --git a/spec/fixtures/nodes/no-space-between-dash-and-class-name b/spec/fixtures/nodes/no-space-between-dash-and-class-name
new file mode 100644
index 0000000..2e07555
--- /dev/null
+++ b/spec/fixtures/nodes/no-space-between-dash-and-class-name
@@ -0,0 +1 @@
+-aeolus::conductor
\ No newline at end of file
diff --git a/spec/fixtures/nodes/no-space-between-parameter-name-and-value b/spec/fixtures/nodes/no-space-between-parameter-name-and-value
new file mode 100644
index 0000000..648195e
--- /dev/null
+++ b/spec/fixtures/nodes/no-space-between-parameter-name-and-value
@@ -0,0 +1 @@
+ rhevm_nfs_server:virtlab108.virt.bos.redhat.com
\ No newline at end of file
diff --git a/spec/fixtures/nodes/one-space-before-parameter-name b/spec/fixtures/nodes/one-space-before-parameter-name
new file mode 100644
index 0000000..8b990aa
--- /dev/null
+++ b/spec/fixtures/nodes/one-space-before-parameter-name
@@ -0,0 +1 @@
+ rhevm_nfs_server: virtlab108.virt.bos.redhat.com
\ No newline at end of file
diff --git a/spec/fixtures/nodes/three-spaces-before-parameter-name b/spec/fixtures/nodes/three-spaces-before-parameter-name
new file mode 100644
index 0000000..31c41ad
--- /dev/null
+++ b/spec/fixtures/nodes/three-spaces-before-parameter-name
@@ -0,0 +1 @@
+ rhevm_nfs_server: virtlab108.virt.bos.redhat.com
diff --git a/spec/node-check_spec.rb b/spec/node-check_spec.rb
new file mode 100644
index 0000000..d7d33cb
--- /dev/null
+++ b/spec/node-check_spec.rb
@@ -0,0 +1,38 @@
+# Copyright 2011 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+def run_and_check_status (node, expected_exit_status)
+ `./bin/aeolus-node-check ./spec/fixtures/nodes/#{node}`
+ $?.exitstatus.should be(expected_exit_status), "#{node}"
+end
+
+
+describe "aeolus-node-check" do
+ it "error message display" do
+ output=`./bin/aeolus-node-check ./spec/fixtures/nodes/no-colon-between-parameter-name-and-value`
+ output.should == "Errors found in ./spec/fixtures/nodes/no-colon-between-parameter-name-and-value\nparameters must be in the form [space][space][parameter name][colon][space][parameter value]\nclasses must be in the form [dash][space][class name]\nincorrect format in line 1: rhevm_nfs_server virtlab108.virt.bos.redhat.com\n"
+ end
+
+ it "should raise an error with these files" do
+ run_and_check_status("no-colon-between-parameter-name-and-value", 1)
+ run_and_check_status("no-space-between-dash-and-class-name", 1)
+ run_and_check_status("no-space-between-parameter-name-and-value", 1)
+ run_and_check_status("one-space-before-parameter-name", 1)
+ run_and_check_status("three-spaces-before-parameter-name", 1)
+ end
+
+ it "should run successful without error" do
+ run_and_check_status("good-node-file", 0)
+ end
+end
--
1.7.6.4
12 years, 4 months
[PATCH configure] BZ 746702 - Check node config files are in correct format before executing puppet
by Richard Su
https://bugzilla.redhat.com/show_bug.cgi?id=746702
aeolus-configure and aeolus-cleanup calls aeolus-node-check to verify node config
files are correctly formatted. If there is a formatting problem, the file name
and the line number causing the issue are displayed.
---
bin/aeolus-cleanup | 7 +++-
bin/aeolus-configure | 4 ++
bin/aeolus-node-check | 43 ++++++++++++++++++++
contrib/aeolus-configure.spec | 1 +
spec/fixtures/nodes/good-node-file | 8 ++++
.../no-colon-between-parameter-name-and-value | 1 +
.../nodes/no-space-between-dash-and-class-name | 1 +
.../no-space-between-parameter-name-and-value | 1 +
.../fixtures/nodes/one-space-before-parameter-name | 1 +
.../nodes/three-spaces-before-parameter-name | 1 +
spec/node-check_spec.rb | 38 +++++++++++++++++
11 files changed, 105 insertions(+), 1 deletions(-)
create mode 100755 bin/aeolus-node-check
create mode 100644 spec/fixtures/nodes/good-node-file
create mode 100644 spec/fixtures/nodes/no-colon-between-parameter-name-and-value
create mode 100644 spec/fixtures/nodes/no-space-between-dash-and-class-name
create mode 100644 spec/fixtures/nodes/no-space-between-parameter-name-and-value
create mode 100644 spec/fixtures/nodes/one-space-before-parameter-name
create mode 100644 spec/fixtures/nodes/three-spaces-before-parameter-name
create mode 100644 spec/node-check_spec.rb
diff --git a/bin/aeolus-cleanup b/bin/aeolus-cleanup
index 7d15559..dc447f5 100644
--- a/bin/aeolus-cleanup
+++ b/bin/aeolus-cleanup
@@ -57,6 +57,11 @@ export FACTER_AEOLUS_ENABLE_HTTPS=true
export FACTER_AEOLUS_ENABLE_SECURITY=false
export FACTER_AEOLUS_SAVE_DATA=$SAVE_DATA
+/usr/share/aeolus-configure/modules/aeolus/aeolus-node-check /etc/aeolus-configure/nodes/$PUPPET_NODE
+if [ $? != 0 ]; then
+ exit 1
+fi
+
NODE_ARRAY=(`echo $PUPPET_NODE | tr "," "\n"`)
for x in "${NODE_ARRAY[@]}"
do
@@ -70,4 +75,4 @@ do
if [ $? != 0 -a $? != 2 ] ; then
exit 1
fi
-done
\ No newline at end of file
+done
diff --git a/bin/aeolus-configure b/bin/aeolus-configure
index 503851d..151584a 100755
--- a/bin/aeolus-configure
+++ b/bin/aeolus-configure
@@ -72,6 +72,10 @@ export FACTER_RAILS_TOKEN=`</dev/urandom tr -dc a-f0-9 | head -c128`
NODE_ARRAY=(`echo $PUPPET_NODE | tr "," "\n"`)
for x in "${NODE_ARRAY[@]}"
do
+ /usr/share/aeolus-configure/modules/aeolus/aeolus-node-check /etc/aeolus-configure/nodes/$x
+ if [ $? != 0 ]; then
+ exit 1
+ fi
puppet /usr/share/aeolus-configure/modules/aeolus/aeolus.pp \
--modulepath=/usr/share/aeolus-configure/modules/ \
--external_nodes "/bin/sh /usr/share/aeolus-configure/modules/aeolus/aeolus-node ${x}_configure" --node_terminus exec \
diff --git a/bin/aeolus-node-check b/bin/aeolus-node-check
new file mode 100755
index 0000000..4fe9ad8
--- /dev/null
+++ b/bin/aeolus-node-check
@@ -0,0 +1,43 @@
+#!/usr/bin/ruby
+
+# Copyright 2011 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+filename = ARGV[0]
+file = File.open(filename, 'r') or raise "Could not open file\n"
+counter = 1
+errors = []
+while (line = file.gets)
+ if (line != "\n" && line[0..0] != "#" && line[0..10] != "parameters:" && line[0..7] != "classes:" && line[0..1] != "--")
+ # skip any non parameter or classes lines
+ if (line[0..1] == " " && line[2..2] != " " && line.index(":") != nil && line.split(":")[1][0..0] == " ")
+ # matches correct parameter line
+ elsif (line[0..1] == "- ")
+ # matches correct classes line
+ else
+ errors << "incorrect format in line #{counter}: #{line}"
+ end
+ end
+ counter = counter + 1
+end
+file.close
+
+if (errors.size() > 0)
+ puts "Errors found in #{filename}"
+ puts "parameters must be in the form [space][space][parameter name][colon][space][parameter value]"
+ puts "classes must be in the form [dash][space][class name]"
+ errors.each { |e| puts e }
+ exit 1
+end
+exit 0
diff --git a/contrib/aeolus-configure.spec b/contrib/aeolus-configure.spec
index b063410..03fc5ba 100644
--- a/contrib/aeolus-configure.spec
+++ b/contrib/aeolus-configure.spec
@@ -47,6 +47,7 @@ Aeolus Configure Puppet Recipe
%{__cp} -R %{pbuild}/recipes/openssl/ %{buildroot}/%{aeolushome}/modules/openssl
%{__cp} -R %{pbuild}/recipes/postgres/ %{buildroot}/%{aeolushome}/modules/postgres
%{__cp} -R %{pbuild}/bin/aeolus-node %{buildroot}/%{aeolushome}/modules/aeolus/
+%{__cp} -R %{pbuild}/bin/aeolus-node-check %{buildroot}/%{aeolushome}/modules/aeolus/
%{__cp} -R %{pbuild}/bin/aeolus-check-services %{buildroot}/%{_bindir}/
%{__cp} -R %{pbuild}/bin/aeolus-restart-services %{buildroot}/%{_sbindir}/
%{__cp} -R %{pbuild}/bin/aeolus-configure %{buildroot}/%{_sbindir}/
diff --git a/spec/fixtures/nodes/good-node-file b/spec/fixtures/nodes/good-node-file
new file mode 100644
index 0000000..af4f2c1
--- /dev/null
+++ b/spec/fixtures/nodes/good-node-file
@@ -0,0 +1,8 @@
+#
+
+#
+---
+parameters:
+ enable_https: true
+classes:
+- aeolus::conductor
\ No newline at end of file
diff --git a/spec/fixtures/nodes/no-colon-between-parameter-name-and-value b/spec/fixtures/nodes/no-colon-between-parameter-name-and-value
new file mode 100644
index 0000000..76d3c1d
--- /dev/null
+++ b/spec/fixtures/nodes/no-colon-between-parameter-name-and-value
@@ -0,0 +1 @@
+ rhevm_nfs_server virtlab108.virt.bos.redhat.com
\ No newline at end of file
diff --git a/spec/fixtures/nodes/no-space-between-dash-and-class-name b/spec/fixtures/nodes/no-space-between-dash-and-class-name
new file mode 100644
index 0000000..2e07555
--- /dev/null
+++ b/spec/fixtures/nodes/no-space-between-dash-and-class-name
@@ -0,0 +1 @@
+-aeolus::conductor
\ No newline at end of file
diff --git a/spec/fixtures/nodes/no-space-between-parameter-name-and-value b/spec/fixtures/nodes/no-space-between-parameter-name-and-value
new file mode 100644
index 0000000..648195e
--- /dev/null
+++ b/spec/fixtures/nodes/no-space-between-parameter-name-and-value
@@ -0,0 +1 @@
+ rhevm_nfs_server:virtlab108.virt.bos.redhat.com
\ No newline at end of file
diff --git a/spec/fixtures/nodes/one-space-before-parameter-name b/spec/fixtures/nodes/one-space-before-parameter-name
new file mode 100644
index 0000000..8b990aa
--- /dev/null
+++ b/spec/fixtures/nodes/one-space-before-parameter-name
@@ -0,0 +1 @@
+ rhevm_nfs_server: virtlab108.virt.bos.redhat.com
\ No newline at end of file
diff --git a/spec/fixtures/nodes/three-spaces-before-parameter-name b/spec/fixtures/nodes/three-spaces-before-parameter-name
new file mode 100644
index 0000000..31c41ad
--- /dev/null
+++ b/spec/fixtures/nodes/three-spaces-before-parameter-name
@@ -0,0 +1 @@
+ rhevm_nfs_server: virtlab108.virt.bos.redhat.com
diff --git a/spec/node-check_spec.rb b/spec/node-check_spec.rb
new file mode 100644
index 0000000..d7d33cb
--- /dev/null
+++ b/spec/node-check_spec.rb
@@ -0,0 +1,38 @@
+# Copyright 2011 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+def run_and_check_status (node, expected_exit_status)
+ `./bin/aeolus-node-check ./spec/fixtures/nodes/#{node}`
+ $?.exitstatus.should be(expected_exit_status), "#{node}"
+end
+
+
+describe "aeolus-node-check" do
+ it "error message display" do
+ output=`./bin/aeolus-node-check ./spec/fixtures/nodes/no-colon-between-parameter-name-and-value`
+ output.should == "Errors found in ./spec/fixtures/nodes/no-colon-between-parameter-name-and-value\nparameters must be in the form [space][space][parameter name][colon][space][parameter value]\nclasses must be in the form [dash][space][class name]\nincorrect format in line 1: rhevm_nfs_server virtlab108.virt.bos.redhat.com\n"
+ end
+
+ it "should raise an error with these files" do
+ run_and_check_status("no-colon-between-parameter-name-and-value", 1)
+ run_and_check_status("no-space-between-dash-and-class-name", 1)
+ run_and_check_status("no-space-between-parameter-name-and-value", 1)
+ run_and_check_status("one-space-before-parameter-name", 1)
+ run_and_check_status("three-spaces-before-parameter-name", 1)
+ end
+
+ it "should run successful without error" do
+ run_and_check_status("good-node-file", 0)
+ end
+end
--
1.7.6.4
12 years, 4 months
[PATCH configure] BZ 725596 - umount rhev export only if it is not in use
by Richard Su
https://bugzilla.redhat.com/show_bug.cgi?id=725596
umounting the RHEV export directory while it is in use
would result in an error.
---
recipes/aeolus/manifests/profiles/rhevm.pp | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/recipes/aeolus/manifests/profiles/rhevm.pp b/recipes/aeolus/manifests/profiles/rhevm.pp
index bc86caf..1d5d73d 100644
--- a/recipes/aeolus/manifests/profiles/rhevm.pp
+++ b/recipes/aeolus/manifests/profiles/rhevm.pp
@@ -76,7 +76,8 @@ class aeolus::profiles::rhevm {
}
class aeolus::profiles::rhevm::disabled {
- mount {"$rhevm_nfs_mount_point":
- ensure => unmounted,
- device => "$rhevm_nfs_server:$rhevm_nfs_export"}
+ exec {"umount $rhevm_nfs_mount_point":
+ path => ["/sbin", "/bin"],
+ onlyif => [["mount -l | grep $rhevm_nfs_mount_point"],
+ ["/bin/sh -c '! (ps -ef | grep -v grep | grep dc-rhev-image)'"]]}
}
--
1.7.6.4
12 years, 4 months
[PATCH conductor] BZ 760901 - removed lined touching unused lock file
by Richard Su
https://bugzilla.redhat.com/show_bug.cgi?id=760901
This error would appear in RHEL but not Fedora:
touch: missing file operand
The file it is touching is not used.
---
conf/aeolus-conductor | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/conf/aeolus-conductor b/conf/aeolus-conductor
index 0099c61..0a15fc1 100755
--- a/conf/aeolus-conductor
+++ b/conf/aeolus-conductor
@@ -50,7 +50,6 @@ start() {
/usr/bin/curl --silent http://$ADDR:3000$PREFIX >& /dev/null
RETVAL=$?
if [ $RETVAL -eq 0 ] ; then
- touch $THIN_LOCKFILE
echo_success
echo
exit 0
--
1.7.6.4
12 years, 4 months
ERROR: ProviderAccountNotFound
by Berezovski, Vladimir
Hi ,
I ran this command :
# aeolus-cli push --provider ec2-us-east-1 --account ec2-us-east-1 --image b7aefc7c-2ca8-4f5b-b46b-003b6483d406 --build 038a8a1b-572d-4906-9fb8-c9c652589cdf --targetimage ae864a3c-a547-4b95-8079-60d0216969bc
ERROR: ProviderAccountNotFound => Could not find provider account for name ec2-us-east-1
Test for ec2-us-east-1 was successful .
# aeolus-cli list --providers Name Type Target Reference
------------------ ----- ----------------------------------
rhevm rhevm https://rhevm2.il.nds.com:8443/api
ec2-us-west-2 ec2 us-west-2
ec2-ap-southeast-1 ec2 ap-southeast-1
ec2-eu-west-1 ec2 eu-west-1
ec2-ap-northeast-1 ec2 ap-northeast-1
ec2-us-east-1 ec2 us-east-1
ec2-us-west-1 ec2 us-west-1
Looks like push command doesn't recognize my providers
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
aeolus-configure -p rhevm,ec2 error
by Berezovski, Vladimir
Hi ,
I updated Aeolus to 0.7.0-4 version on RH6 host : yum update aeolus-all
Now when reconfigure providers I get this error :
#/usr/sbin/aeolus-configure -p rhevm,ec2
err: /Stage[main]/Aeolus::Profiles::Rhevm/Aeolus::Conductor::Login[admin]/Web_request[admin-conductor-login]/post: change from to https://localhost/conductor/user_session failed: An exception was raised when invoking web request: Invalid HTTP Return Code: 500,
was expecting one of 200
In conductor's page I see the following message :
"A secret is required to generate an integrity hash for cookie session data. Use config.secret_token = "some secret phrase of at least 30 characters"in config/initializers/secret_token.rb.tt"
If I'm not mistaken the file /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/generators/rails/app/templates/config/initializers/secret_token.rb.tt is to be fixed .
Can you advise how secret_token.rb.tt should look like ( example ) ?
Thanks
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