[PATCH conductor 0/1] Upstream pagination fix
by Matt Wagner
Hi folks,
Scott and I spent a while looking at why pagination links disappear
when running on upstream ruby. The commit message in the patch expands
on the details which I won't repeat here. (I also put in a comment,
to guard against the next person looking at the code wondering why in
the world it's checking that.)
PLEASE NOTE: I have not run tests on this. My test setup appears to
be fubar at the moment, and I'd rather get this patch out than wait
until tomorrow when I have tested it. Beyond reviewing this, please
ensure that it introduces no new test failures.
-- Matt
11 years, 7 months
[PATCH conductor] Deployable deadlock detecting fix
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
When Configserver launches services on each VM, it checks if
all param references are satisfied so generally something like
this should cause a deadlock because of cyclic reference:
Assembly A, param P1 references Assembly B, param P2
Assembly B, param P1 references Assembly A, param P2
But the trick is that the above deadlock is allowed if
referenced param is 'OS' type (if it's value is not output of
some script). So cyclic references can be allowed in some cases
depending on type of referenced parameter.
But problem is that type of referenced parameter can't be easily resolved
based only on deployable XML file so only solution for Conductor for now
is to enable inter-assembly cyclic references and check only cyclic references inside
one assembly.
---
src/app/models/deployable.rb | 2 +-
src/app/util/deployable_xml.rb | 45 +++++++++++++++-----------------
src/spec/factories/deployable.rb | 53 +++-----------------------------------
src/spec/models/deployable_spec.rb | 27 +++++++------------
4 files changed, 35 insertions(+), 92 deletions(-)
diff --git a/src/app/models/deployable.rb b/src/app/models/deployable.rb
index 374b4e3..811a513 100644
--- a/src/app/models/deployable.rb
+++ b/src/app/models/deployable.rb
@@ -98,7 +98,7 @@ class Deployable < ActiveRecord::Base
errors.add(:xml,
I18n.t('catalog_entries.flash.warning.not_valid_not_existing_param',
locale_params))
- elsif reference[:to_service]
+ elsif reference[:reference][:service]
errors.add(:xml,
I18n.t('catalog_entries.flash.warning.not_valid_not_existing_service_reference',
locale_params))
diff --git a/src/app/util/deployable_xml.rb b/src/app/util/deployable_xml.rb
index e057771..837041b 100644
--- a/src/app/util/deployable_xml.rb
+++ b/src/app/util/deployable_xml.rb
@@ -184,12 +184,6 @@ class AssemblyXML
:service => service.name,
:references => service.references}
end
- # whole assembly is added as a node too because a inter-assembly references
- # reference whole assembly, not particular service
- nodes << {:assembly => name,
- :service => nil,
- :references => nodes.map {|n|
- n[:references]}.flatten}
end
private
@@ -343,28 +337,31 @@ class DeployableDependencyGraph
invalid_refs = []
dependency_nodes.each do |node|
- # skip "whole assembly" nodes
- next unless node[:service]
-
node[:references].each do |ref|
- if ref[:not_existing_ref]
- # in this case, the referenced assembly/service doesn't exist
- # at all
- invalid_refs << {:assembly => node[:assembly],
- :service => node[:service],
- :reference => ref}
- else
- # in this case, the referenced assembly/service exists, but the
- # referenced parameter is not listed in <returns> tag of the assembly
+ no_return_param = false
+
+ if ref[:service].nil?
assembly = @assemblies.find {|a| a.name == ref[:assembly]}
- next unless assembly # this shouldn't be needed
- unless assembly.output_parameters.include?(ref[:param])
- invalid_refs << {:assembly => node[:assembly],
- :service => node[:service],
- :no_return_param => true,
- :reference => ref}
+ if assembly
+ if assembly.output_parameters.include?(ref[:param])
+ # if referenced assembly exists and returns referenced param, then
+ # it's valid
+ next
+ else
+ no_return_param = true
+ end
end
+ else
+ # if a param references another service, then we check if
+ # this service exists or not. For current version of config server
+ # only services from the same assembly can be referenced
+ next unless ref[:not_existing_ref]
end
+
+ invalid_refs << {:assembly => node[:assembly],
+ :service => node[:service],
+ :no_return_param => no_return_param,
+ :reference => ref}
end
end
invalid_refs
diff --git a/src/spec/factories/deployable.rb b/src/spec/factories/deployable.rb
index 8a4f3ba..b279159 100644
--- a/src/spec/factories/deployable.rb
+++ b/src/spec/factories/deployable.rb
@@ -73,54 +73,6 @@ FactoryGirl.define do
</deployable>"
end
- factory :deployable_with_cyclic_assembly_references, :parent => :deployable do
- xml "<?xml version=\"1.0\"?>
- <deployable version='1.0' name='deployable'>
- <assemblies>
- <assembly name='assembly1' hwp='front_hwp1'>
- <image id='85653387-88b2-46b0-b7b2-c779d2af06c7'></image>
- <services>
- <service name='service1'>
- <executable url='executable_url'/>
- <parameters>
- <parameter name='param1'>
- <reference assembly='assembly2' parameter='hostname'/>
- </parameter>
- </parameters>
- </service>
- </services>
- </assembly>
- <assembly name='assembly2' hwp='front_hwp1'>
- <image id='85653387-88b2-46b0-b7b2-c779d2af06c7'></image>
- <services>
- <service name='service1'>
- <executable url='executable_url'/>
- <parameters>
- <parameter name='param1'>
- <reference assembly='assembly3' parameter='hostname'/>
- </parameter>
- </parameters>
- </service>
- </services>
- </assembly>
- <assembly name='assembly3' hwp='front_hwp1'>
- <image id='85653387-88b2-46b0-b7b2-c779d2af06c7'></image>
- <services>
- <service name='service1'>
- <executable url='executable_url'/>
- <parameters>
- <parameter name='param1'>
- <reference assembly='assembly1' parameter='hostname'/>
- </parameter>
- </parameters>
- </service>
- </services>
- </assembly>
- </assemblies>
- </deployable>"
- end
-
-
factory :deployable_with_cyclic_service_references, :parent => :deployable do
xml "<?xml version=\"1.0\"?>
<deployable version='1.0' name='deployable'>
@@ -161,7 +113,10 @@ FactoryGirl.define do
<executable url='executable_url'/>
<parameters>
<parameter name='param1'>
- <reference assembly='assembly2' service='service2'/>
+ <reference assembly='assembly1' service='service2'/>
+ </parameter>
+ <parameter name='param2'>
+ <reference assembly='assembly2' parameter='param2'/>
</parameter>
</parameters>
</service>
diff --git a/src/spec/models/deployable_spec.rb b/src/spec/models/deployable_spec.rb
index 4aec099..0deae4c 100644
--- a/src/spec/models/deployable_spec.rb
+++ b/src/spec/models/deployable_spec.rb
@@ -98,23 +98,6 @@ describe Deployable do
end
end
- describe "validation of deployable_xml with cyclic assembly references" do
- before :each do
- @deployable = FactoryGirl.build(:deployable_with_cyclic_assembly_references)
- @cycles = DeployableXML.new((a)deployable.xml).dependency_graph.cycles
- end
-
- it_behaves_like "deployable XML with cyclic reference"
-
- it "should detect cycle between multiple assmebliess" do
- cycle = @cycles.first
- cycle.length.should == 3
- cycle.find {|n| n[:assembly] == 'assembly1' && n[:service] == 'service1'}
- cycle.find {|n| n[:assembly] == 'assembly2' && n[:service] == 'service1'}
- cycle.find {|n| n[:assembly] == 'assembly3' && n[:service] == 'service1'}
- end
- end
-
describe "validation of deployable_xml with not existing references" do
before :each do
@deployable = FactoryGirl.build(:deployable_with_not_existing_references)
@@ -136,9 +119,17 @@ describe Deployable do
it "should detect reference to not existing service" do
@invalid_refs.find {|r| r[:assembly] == 'assembly1' &&
r[:service] == 'service1' &&
- r[:reference][:assembly] == 'assembly2' &&
+ r[:reference][:assembly] == 'assembly1' &&
r[:reference][:service] == 'service2'}.should_not be_nil
end
+
+ it "should detect reference to not existing parameter" do
+ @invalid_refs.find {|r| r[:assembly] == 'assembly1' &&
+ r[:service] == 'service1' &&
+ r[:no_return_param] &&
+ r[:reference][:assembly] == 'assembly2' &&
+ r[:reference][:param] == 'param2'}.should_not be_nil
+ end
end
it "should manage permissions on catalog changes" do
--
1.7.11.4
11 years, 7 months
[PATCH conductor] Fixed JSON for deployments in pools#index(pretty view) - rev.
by jzigmund@redhat.com
From: Jozef Zigmund <jzigmund(a)redhat.com>
This patch is fixing failing tests on travis-cl. Cuke fails were
caused by previous patch
(commit msg c3b1d79b729d01fa0b91455510466f3871247b29) and
they appeared only when cukes runs on bundled gems.
---
src/app/helpers/mustache_helper.rb | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/app/helpers/mustache_helper.rb b/src/app/helpers/mustache_helper.rb
index 7be992a..d8d3426 100644
--- a/src/app/helpers/mustache_helper.rb
+++ b/src/app/helpers/mustache_helper.rb
@@ -122,8 +122,7 @@ module MustacheHelper
current_user,
Privilege::VIEW).
ascending_by_name, params[:page],
- PER_PAGE).
- map {|deployment| view_context.deployment_for_mustache(deployment)}
+ PER_PAGE).map{ |deployment| deployment_for_mustache(deployment) }
}
end
--
1.7.11.4
11 years, 7 months
ANNOUNCE: Oz 0.9.0 Release
by Chris Lalancette
All,
I'm pleased to announce release 0.9.0 of Oz. Oz is a program for
doing automated installation of guest operating systems with limited
input from the user. Release 0.9.0 is a (long overdue) bugfix and
feature release for Oz. Some of the highlights between Oz 0.8.0 and
0.9.0 are:
- Easier to create Debian/Ubuntu packages
- Ability to specify the disk size in the TDL
- Ability to specify the number of CPUs and amount of memory used
for the installation VM
- Cleanup and bugfixes to oz-cleanup-cache
- Ability to install Fedora-17 disk images
- Ability to install guests as a non-root user. This has several
caveats; please see the documentation on
http://github.com/clalancette/oz for more information.
- Ability to install RHEL-6.3 disk images
- Ability to install ScientificLinuxCERN disk images
- Ability to install Mandrake 8.2 disk images
- Ability to install OpenSUSE 10.3 disk images
- Ability to install Ubuntu 12.04 disk images
A tarball of this release is available, as well as packages for
Fedora-16. Instructions on how to get and use Oz are available at
http://github.com/clalancette/oz .
If you have any questions or comments about Oz, please feel free to
contact aeolus-devel(a)lists.fedorahosted.org or me
(clalancette(a)gmail.com) directly.
Thanks to everyone who contributed to this release through bug
reports, patches, and suggestions for improvement.
Chris Lalancette
11 years, 7 months
[PATCH aeolus-configure, rev2] Bug 828515 - [RFE] Verify aeolus-cleanup command should be run
by steve linabery
Added command line options -y|--assumeyes to force operation.
If not provided, prompt user for confirmation to proceed.
---
bin/aeolus-cleanup | 16 +++++++++++++---
docs/man1/aeolus-cleanup.1 | 3 +++
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/bin/aeolus-cleanup b/bin/aeolus-cleanup
index eadc2ed..546d828 100755
--- a/bin/aeolus-cleanup
+++ b/bin/aeolus-cleanup
@@ -19,18 +19,19 @@ usage()
cat << EOF
USAGE:
-aeolus-cleanup [-d|--debug] [-h|--help] [-v|--verbose] [-s|--savedata] [-p|--profile]
+aeolus-cleanup [-d|--debug] [-h|--help] [-v|--verbose] [-s|--savedata] [-y|--assumeyes] [-p|--profile]
OPTIONS:
-h | --help Show this message.
-d | --debug Debug logging mode.
-v | --verbose Verbose logging mode.
-s | --savedata Do not delete existing data.
+ -y | --assumeyes Assume yes; assume that the answer to any question which would be asked is yes.
-p | --profile Name of profile to use. A comma separated list can be used to specify multiple profiles.
EOF
}
-args=`getopt -o :hdvsp: --long help,debug,verbose,savedata,profile -- "$@"`
+args=`getopt -o :hdvsyp: --long help,debug,verbose,savedata,assumeyes,profile -- "$@"`
if test $? != 0
then
usage
@@ -39,6 +40,7 @@ fi
SAVE_DATA=false
PUPPET_NODE='default'
+ASSUME_YES=false
eval set -- $args
while true ; do
@@ -46,13 +48,21 @@ while true ; do
-h|--help) usage ; exit 1 ; shift ;;
-d|--debug) LOGLEVEL="--debug" ; shift ;;
-v|--verbose) LOGLEVEL="--verbose" ; shift ;;
- -s|--savedata) SAVE_DATA=true ; shift ;;
+ -s|--savedata) SAVE_DATA=true ; shift ;;
+ -y|--assumeyes) ASSUME_YES=true ; shift ;;
-p|--profile) PUPPET_NODE=$2 ; shift ; shift ;;
--) shift ; break ;;
*) usage ; exit 1 ;;
esac
done
+if [ $ASSUME_YES != true ]; then
+ read -p "aeolus-cleanup will delete local aeolus installations. Are you sure you wish to proceed? [y/N]"
+ if [[ $REPLY != "y" && $REPLY != "Y" ]]; then
+ exit
+ fi
+fi
+
export FACTER_AEOLUS_ENABLE_HTTPS=true
export FACTER_AEOLUS_ENABLE_SECURITY=false
export FACTER_AEOLUS_SAVE_DATA=$SAVE_DATA
diff --git a/docs/man1/aeolus-cleanup.1 b/docs/man1/aeolus-cleanup.1
index 1c2c71a..7a10852 100644
--- a/docs/man1/aeolus-cleanup.1
+++ b/docs/man1/aeolus-cleanup.1
@@ -20,6 +20,9 @@ Verbose logging mode.
\fB\-s\fR | \fB\-\-savedata\fR
Do not delete existing data.
.TP
+\fB\-y\fR | \fB\-\-assumeyes\fR
+Assume yes; assume that the answer to any question which would be asked is yes.
+.TP
\fB\-p\fR | \fB\-\-profile\fR
Name of profile to use. A comma separated list can be used to specify multiple profiles.
.SH "SEE ALSO"
--
1.7.7.6
11 years, 7 months
[PATCH aeolus-configure] Bug 828515 - [RFE] Verify aeolus-cleanup command should be run
by steve linabery
Added command line options -y|--assumeyes to force operation.
If not provided, prompt user for confirmation to proceed.
---
bin/aeolus-cleanup | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/bin/aeolus-cleanup b/bin/aeolus-cleanup
index eadc2ed..546d828 100755
--- a/bin/aeolus-cleanup
+++ b/bin/aeolus-cleanup
@@ -19,18 +19,19 @@ usage()
cat << EOF
USAGE:
-aeolus-cleanup [-d|--debug] [-h|--help] [-v|--verbose] [-s|--savedata] [-p|--profile]
+aeolus-cleanup [-d|--debug] [-h|--help] [-v|--verbose] [-s|--savedata] [-y|--assumeyes] [-p|--profile]
OPTIONS:
-h | --help Show this message.
-d | --debug Debug logging mode.
-v | --verbose Verbose logging mode.
-s | --savedata Do not delete existing data.
+ -y | --assumeyes Assume yes; assume that the answer to any question which would be asked is yes.
-p | --profile Name of profile to use. A comma separated list can be used to specify multiple profiles.
EOF
}
-args=`getopt -o :hdvsp: --long help,debug,verbose,savedata,profile -- "$@"`
+args=`getopt -o :hdvsyp: --long help,debug,verbose,savedata,assumeyes,profile -- "$@"`
if test $? != 0
then
usage
@@ -39,6 +40,7 @@ fi
SAVE_DATA=false
PUPPET_NODE='default'
+ASSUME_YES=false
eval set -- $args
while true ; do
@@ -46,13 +48,21 @@ while true ; do
-h|--help) usage ; exit 1 ; shift ;;
-d|--debug) LOGLEVEL="--debug" ; shift ;;
-v|--verbose) LOGLEVEL="--verbose" ; shift ;;
- -s|--savedata) SAVE_DATA=true ; shift ;;
+ -s|--savedata) SAVE_DATA=true ; shift ;;
+ -y|--assumeyes) ASSUME_YES=true ; shift ;;
-p|--profile) PUPPET_NODE=$2 ; shift ; shift ;;
--) shift ; break ;;
*) usage ; exit 1 ;;
esac
done
+if [ $ASSUME_YES != true ]; then
+ read -p "aeolus-cleanup will delete local aeolus installations. Are you sure you wish to proceed? [y/N]"
+ if [[ $REPLY != "y" && $REPLY != "Y" ]]; then
+ exit
+ fi
+fi
+
export FACTER_AEOLUS_ENABLE_HTTPS=true
export FACTER_AEOLUS_ENABLE_SECURITY=false
export FACTER_AEOLUS_SAVE_DATA=$SAVE_DATA
--
1.7.7.6
11 years, 7 months
Conductor+aeolus-configure updates require action
by Matt Wagner
Hi folks,
I have just pushed updates to Conductor and aeolus-configure, as a
result of Jirka's excellent work[1][2] updating some of our UI
dependencies.
If you are working from source, there are some actions you may need to
take:
1.) Next time you pull Conductor, you will need to run "git submodule
update" in the root of the checkout (not in src).
2.) You should update Conductor and aeolus-configure at the same time.
The Conductor change introduces a column change that configure needs
to know about. (No action is really needed until next time you run
configure, but might as well update now since if you're anything like
me, you'll forget about the change by the time you run into it.)
3.) A new migration is added in the Conductor changes, so "rake
db:migrate" is in order.
4.) The RPM spec for Conductor now requires converge-ui-devel as a
BuildRequires. If required, you can build that RPM like so:
$ cd src/vendor/converge-ui
$ git fetch --tags # if necessary
$ tito build --test --rpm
You should not need to do this often -- the point of these patches is
that we are updating the version of the converge-ui library we use for
the first time in 3 months.
These changes are live on master now (as of moments ago). Barring any
catastrophes, they will land on the 1.1 branch shortly.
-- Matt
[1] https://github.com/aeolusproject/conductor/pull/52
[2] https://github.com/aeolusproject/aeolus-configure/pull/11
11 years, 7 months
postgres security in configure
by Mo Morsi
Two unrelated patches tightening up postgres hba config
in aeolus-configure.
Patches can be independently applied, reviewed, ack'd
11 years, 7 months
[PATCH conductor] additional fix for 798516: conditional logic/ruby version behavior
by Scott Seago
https://bugzilla.redhat.com/show_bug.cgi?id=798516
Apparently on f16/ruby 1.8, the conditional block with 'or' and 'not' is
not working as expected. I don't know if it's a ruby bug or something else
but it doesn't matter in this case -- using '!' and '||' is the right
way to do the conditional anyway.
---
src/app/views/permissions/_permissions.html.haml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/app/views/permissions/_permissions.html.haml b/src/app/views/permissions/_permissions.html.haml
index 6d8ab32..aadac1d 100644
--- a/src/app/views/permissions/_permissions.html.haml
+++ b/src/app/views/permissions/_permissions.html.haml
@@ -57,7 +57,7 @@
- selected = params[:select] == 'all'
= check_box_tag "permission_selected[]", permission.id, selected, :id => "permission_checkbox_#{permission.id}"
%td= link_to permission.entity.name, ((permission.entity.entity_target_type == "User") ? user_path(permission.entity.user) : user_group_path(permission.entity.user_group))
- - if not(@show_inherited or @show_global) && has_admin_perms && !(prevent_admin_deletion && BasePermissionObject.is_global_admin_perm(permission))
+ - if !(@show_inherited || @show_global) && has_admin_perms && !(prevent_admin_deletion && BasePermissionObject.is_global_admin_perm(permission))
%td= select_tag "permission_role_selected[]", options_for_select((a)roles.map {|r| [ t(r.name, :scope=> :role_defs, :default => r.name), "#{permission.id},#{r.id}" ] }, :selected => "#{permission.id},#{permission.role.id}", :disabled => @permission_object.permissions.where(["entity_id = ? and role_id != ?", permission.entity_id, permission.role_id]).collect {|p| "#{permission.id},#{p.role.id}"}), :id => "permission_role_selected_#{permission.id}"
:javascript
$("#permission_role_selected_#{permission.id}").change(function () { $("#perm_edit_button").click(); } );
--
1.7.11.4
11 years, 7 months