[PATCH conductor] locales: removed template_xml.errors.xml_parse_error since is not used anymore
by Maros Zatko
From: Maros Zatko <mzatko(a)redhat.com>
---
src/config/locales/en.yml | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
index ec067dd..8f30b08 100644
--- a/src/config/locales/en.yml
+++ b/src/config/locales/en.yml
@@ -1027,7 +1027,6 @@ en:
not_on_provider: The requested image was not found on the Provider.
template_xml:
errors:
- xml_parse_error: Failed to parse XML.
invalid_xml: "XML is not valid:"
name_is_not_set: Name is not set.
provider_images:
--
1.7.11.4
11 years, 7 months
[PATCH] BZ 805224 limit action to be executable only every 2 minutes
by Tomas Hrcka
---
src/app/models/instance.rb | 7 ++++++-
src/config/locales/en.yml | 1 +
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/app/models/instance.rb b/src/app/models/instance.rb
index fad0d03..0ec11bf 100644
--- a/src/app/models/instance.rb
+++ b/src/app/models/instance.rb
@@ -464,7 +464,12 @@ class Instance < ActiveRecord::Base
end
def reboot(user)
- do_operation(user, 'reboot')
+ if tasks.where("action = :action AND time_submitted > :time_ago",
+ {:action => "reboot", :time_ago => 2.minutes.ago}).present?
+ raise I18n.t("instances.errors.reboot_already_scheduled")
+ else
+ do_operation(user, 'reboot')
+ end
end
def forced_stop(user)
diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
index a089d31..e301b9c 100644
--- a/src/config/locales/en.yml
+++ b/src/config/locales/en.yml
@@ -530,6 +530,7 @@ en:
provider_account_quota_too_low: "%{match_provider_account} quota limit too low to launch Deployable"
stop_invalid_action: "Stop is an invalid action."
reboot_invalid_action: "Reboot is an invalid action."
+ reboot_already_scheduled: "reboot is already scheduled."
must_be_enabled: "%{account_name}: Provider must be enabled"
provider_not_available: "%{account_name}: Provider is not available"
cannot_destroy: "Destroy cannot be performed on this instance."
--
1.7.11.4
11 years, 7 months
[PATCH conductor] Fixed JSON for deployments in pools#index(pretty view)
by jzigmund@redhat.com
From: Jozef Zigmund <jzigmund(a)redhat.com>
The link to deployment#show on pools#index has been broken
after backbone refresh the page.
---
src/app/helpers/mustache_helper.rb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/app/helpers/mustache_helper.rb b/src/app/helpers/mustache_helper.rb
index be4a0c0..45d7709 100644
--- a/src/app/helpers/mustache_helper.rb
+++ b/src/app/helpers/mustache_helper.rb
@@ -122,7 +122,9 @@ module MustacheHelper
current_user,
Privilege::VIEW).
ascending_by_name, params[:page],
- PER_PAGE)
+ PER_PAGE).
+ map {|deployment| view_context.deployment_for_mustache(deployment)}
+
}
end
--
1.7.11.4
11 years, 7 months
Notes from our community-building meeting
by Matt Wagner
Hi folks,
A small group of us got together on Google Hangouts yesterday to chat
about trying to grow the upstream community. I wanted to send out some
notes on what we talked about.
In attendance: Me, Nitesh Narayan Lal, Angus Thomas, Hugh Brock, Mo
Morsi, and Justin Clift.
Credit for the idea goes to Nitesh for suggesting, and I invited a
haphazard assortment of people to attend. I think it went extremely
well, and we talked about doing this sort of thing on a regular basis,
perhaps weekly. (Thursdays at 2pm US Eastern -- UTC-0400). More are
welcome!
I was so wrapped up in the call that I didn't keep the best notes, but
here's a recap of the things I did write down:
* We should really be at more events, and/or organize more events, to
maximize awareness about our project.
* We should think more about giving away swag at such events. It's a
good way to attract interest, and it gives people something to
remember us by after the fact. We've printed up stickers in the past
(though they've been a bit elusive), but things like T-shirts or
stuffed animals and whatnot can get a lot more interest. (I
half-joking suggested a stuffed cloud after the call, but the more
I think about it, the more I actually like that idea.)
* Screencasts and webinars can be an effective training tool. We have
produced some screencasts in the past but not all of them have been
well-publicized. We should probably find a spot to put them so they're
easily-accessible.
* We talked a bit about doing things like a Chrome extension to control
Aeolus. This led to a few different lines of discussion:
- Browser plugins are automatically cross-platform, so it's not a bad
way to go about building cross-platform clients.
- Browser plugins are often distributed through a sort of marketplace
as well, which could get some additional interest.
- For any of this to work, though, we need to have a solid API that
plugins could use. Ours is current incomplete, which hampers the
ability for anyone to extend Aeolus.
- We often focus on large, enterprise users for Aeolus. I think we
have a good story for small users who just want to run one or two
cloud instances while avoiding vendor lock-in, but I don't think
it's something we have focused on. Making Aeolus interesting to
individuals or small businesses could be valuable. (I imagine that
many of us got hooked on Linux tinkering around with it on our own,
versus using it in an enterprise setting at first.)
* virt-v2v support would be incredible. The tools already exist to
convert VMs from one format to another; we would just need to build
some sort of wrapper. Then Aeolus could have a point-and-click option
to import a VM from one provider and convert it to a format for use
on another provider. This could be incredibly valuable.
* It looks like Ubuntu is the distro of choice for many users these
days. We're moving towards distributing our components in
platform-agnostic ways, but we should keep in mind that RPM-based
distros aren't all that people use. It might even be worthwhile to
eventually try to package for Debian/Ubuntu and get added to their
repos, so Aeolus is just an apt-get away.
* The idea of a contest for app developers was discussed, and would be
really interesting, if there was a budget for it. (This, too, probably
depends on having a robust API in place.)
Whew! I think that's everything. (I told you it was a productive
meeting!) Please feel to share your thoughts on these ideas and how we
might go about implementing some of them. If you're interested in
joining us next week, we'll try for another meeting on Google Plus next
Thursday at 2pm Eastern US (UTC-0400). It's a video conference, so
please remember to put on a shirt.
Best,
Matt
11 years, 7 months
[image-management-engine] Added Factory Callback Support (#13)
by jguiditta
Adds in Factory Callback Support:
= Testing Instructions
== Checkout and Build ImageFactory and plugins
make rpm
cd imagefactory-plugins/; make rpm
Openstack plugin has a dep not in fedora so will break install; just skip it.
yum install ~/rpmbuld/RPMS/imagefactory-* --skip-broken
== Run factory
sudo /usr/bin/imagefactoryd --debug --no_ssl --no_oauth --foreground
== Start up the test/dummy app
cd <rootdir of IME>/test/dummy
rake db:migrate; rails s
== Run commands from Rails Console
Open up a rails console;
cd <rootdir of IME>/test/dummy
.rake db:migrate; rails c
You can create images using the commands below. Check the test/dummy server log when creating Target and Provider Images for PUT requests. Then check to see if the model was updated properly.
== Commands
template_xml = "<template><name>mock</name><os><name>RHELMock</name><version>1</version><arch>x86_64</arch><install type=\"iso\"><iso>http://mockhost/RHELMock1-x86_64-DVD.iso</iso></install><rootpw>password</rootpw></os><description>Mock Template</description></template>"
template = ImageManagement::Template.create(:xml => template_xml)
base_image = ImageManagement::BaseImage.new
base_image.template = template
base_image.save
image_version = ImageManagement::ImageVersion.new
image_version.base_image = base_image
image_version.save
target_image = ImageManagement::TargetImage.new(:target => "MockSphere")
target_image.image_version = image_version
target_image.save
provider_image = ImageManagement::ProviderImage.new(:provider => "MockSphere", :credentials => "")
provider_image.target_image = target_image
provider_image.save
You can merge this Pull Request by running:
git pull https://github.com/mtaylor/image-management-engine factory_callbacks
Or you can view, comment on it, or merge it online at:
https://github.com/aeolus-incubator/image-management-engine/pull/13
-- Commit Summary --
* Added Factory Callback Support
-- File Changes --
M app/controllers/image_management/provider_images_controller.rb (14)
M app/controllers/image_management/target_images_controller.rb (14)
M app/models/image_management/provider_image.rb (28)
M app/models/image_management/target_image.rb (16)
M lib/generators/image_management/templates/intializers/image_management_engine.rb (4)
M lib/image_factory/model/base.rb (11)
M spec/controllers/provider_images_controller_spec.rb (20)
M spec/controllers/target_images_controller_spec.rb (18)
M spec/spec_helper.rb (4)
M test/dummy/config/initializers/image_management_engine.rb (4)
-- Patch Links --
https://github.com/aeolus-incubator/image-management-engine/pull/13.patch
https://github.com/aeolus-incubator/image-management-engine/pull/13.diff
---
Reply to this email directly or view it on GitHub:
https://github.com/aeolus-incubator/image-management-engine/pull/13
11 years, 7 months
Re: [katello-devel] some thoughts on foreman-architectures branch
by Hugh O. Brock
On Thu, Sep 06, 2012 at 04:06:14PM +0200, Ivan Nečas wrote:
> On 09/06/2012 03:30 PM, Hugh Brock wrote:
> >On Wed, Sep 05, 2012 at 04:30:59PM +0100, Dmitri Dolguikh wrote:
> >>The logic used to access Foreman server is spread over several
> >>classes: a bunch of automatically-generated proxy-type classes that
> >>reside in foreman_api gem, ForemanModel (resides in
> >>lib/resources/foreman_model.rb), that is a base-class for Foreman
> >>resource classes that reside in app/models/foreman.
> >>
> >>Good things first:
> >> - app/models/foreman classes are minimal, and clearly show what
> >>attributes are being used.
> >> - app/models/foreman classes allow for local validation via
> >>standard ActiveModel validators.
> >> - app/models/foreman classes allow for easy customization of json
> >>generation.
> >>
> >>
> >>Things I don't like:
> >> - I can't shake the feeling that the approach represented in the
> >>branch is a huge duplication of effort. We are replicating
> >>ActiveResource on every step of the way, and:
> >> - ActiveResource's error handling is better/consistent (ours is
> >>minimal and current approach would require us to recreate all of
> >>RestClient's exceptions)
> >> - ActiveResource's error parsing is much better (we'll have to
> >>duplicate AR's code to be able to parse remote errors).
> >> - Pretty much all of ForemanModel is what we'd get with
> >>ActiveResource for free. Keep in mind that custom methods are simple
> >>with ActiveResource.
> >> - Foreman uses rabl [1] for json-generation, we implemented a
> >>custom approach. I think rabl is at least worth a look.
> >> - Apipie in it's current shape promotes code duplication. See
> >>foreman_api classes, domain- and architectures-controllers in
> >>katello.
> >>
> >>
> >>I propose:
> >> - It's been close to a couple of years since we looked at
> >>ActiveResource last. I'd like to see where it is now, how hard it is
> >>to use with oauth and non-rails types of resource urls these days.
> >> - I'd like to evaluate rabl for use in Katello
> >> - I'd like to fix code duplication issues in Apipie, possibly
> >>switch it to use ActiveResource instead of RestClient
> >>
> >>
> >>-d
> >>
> >>
> >>[1] https://github.com/nesquena/rabl <https://github.com/nesquena/rabl>
> >Absent any knowledge of the actual code I strongly agree :).
> >
> >Seriously, we are using active resource pretty heavily in a lot of
> >places in Conductor, I would like to see us standardize on it to the
> >extent we can.
> Good to hear you have real experience with that. What king of
> services do you use that for? Rails app, or something totally out of
> your control (at least partly:) ? I would like to see the actual
> code and ask the people that were working on that about their
> experience with that.
>
> -- Ivan
cc-ing aeolus-devel.
Martyn, can you give the folks a run-down on our Active Resource usage?
--Hugh
--
== Hugh Brock, hbrock(a)redhat.com ==
== Engineering Manager, Cloud BU ==
== Aeolus Project: Manage virtual infrastructure across clouds. ==
== http://aeolusproject.org ==
"I know that you believe you understand what you think I said, but I’m
not sure you realize that what you heard is not what I meant."
--Robert McCloskey
11 years, 7 months
[PATCH conductor] Bug 852400 - aeolus-upgrade fails to start postgresql and conductor-delayed_job service
by steve linabery
The second stage of the current upgrade set leaves aeolus services running
after running aeolus-configure. The correct behaviour is to leave services
stopped as they are at the beginning of each upgrade stage. A future
enhancement will prompt $user at end of upgrade process to optionally restart
aeolus services.
---
.../default/0002_run_aeolus-configure.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/upgrade-scripts/default/0002_run_aeolus-configure.sh b/src/upgrade-scripts/default/0002_run_aeolus-configure.sh
index e84f1b5..d513890 100755
--- a/src/upgrade-scripts/default/0002_run_aeolus-configure.sh
+++ b/src/upgrade-scripts/default/0002_run_aeolus-configure.sh
@@ -2,12 +2,12 @@
#name: Execute aeolus-configure
#apply: aeolus-conductor
-#description: Executes aeolus-configure. Note: this restarts aeolus services. Skip this step if you want to manually run aeolus-configure later.
+#description: Executes aeolus-configure, but stops aeolus services before exiting
# default configuration values (should be the same as in our sysv init script)
if [ -f /etc/sysconfig/aeolus-conductor ]; then . /etc/sysconfig/aeolus-conductor; fi
aeolus-configure 2>&1
ret_code=$?
-
+aeolus-services stop
exit $ret_code
--
1.7.7.6
11 years, 7 months
[PATCH conductor] Fixed rspec tests
by Jan Provazník
From: Jan Provaznik <jprovazn(a)redhat.com>
This patch fixes iwhd tests which were failing if iwhd was down
(introduced my older patch 2628b0019825eae76439e05e1b000015f50b7b13)
---
src/spec/controllers/pool_families_controller_spec.rb | 1 +
src/spec/controllers/provider_accounts_controller_spec.rb | 2 ++
src/spec/models/provider_account_spec.rb | 2 ++
3 files changed, 5 insertions(+)
diff --git a/src/spec/controllers/pool_families_controller_spec.rb b/src/spec/controllers/pool_families_controller_spec.rb
index 44b2bea..9cc1079 100644
--- a/src/spec/controllers/pool_families_controller_spec.rb
+++ b/src/spec/controllers/pool_families_controller_spec.rb
@@ -207,6 +207,7 @@ describe PoolFamiliesController do
it "delete an existing pool family" do
@pool_family = FactoryGirl.create :pool_family
+ PoolFamily.any_instance.stub(:images).and_return([])
get :destroy, :id => @pool_family.id
response.status.should be_eql(200)
diff --git a/src/spec/controllers/provider_accounts_controller_spec.rb b/src/spec/controllers/provider_accounts_controller_spec.rb
index dc5e2dd..d7ad155 100644
--- a/src/spec/controllers/provider_accounts_controller_spec.rb
+++ b/src/spec/controllers/provider_accounts_controller_spec.rb
@@ -71,6 +71,7 @@ describe ProviderAccountsController do
it "should allow users with account modify permission to delete a cloud account" do
mock_warden(@admin)
+ ProviderAccount.any_instance.stub(:provider_images).and_return([])
lambda do
post :multi_destroy, :provider_id => @provider_account.provider_id, :accounts_selected => [@provider_account.id]
end.should change(ProviderAccount, :count).by(-1)
@@ -224,6 +225,7 @@ describe ProviderAccountsController do
it "when requested provider account exists" do
ProviderAccount.stub(:find).and_return(@provider_account)
+ ProviderAccount.any_instance.stub(:provider_images).and_return([])
get :destroy, :id => @provider_account.id
response.status.should be_eql(200)
response.should have_content_type("application/xml")
diff --git a/src/spec/models/provider_account_spec.rb b/src/spec/models/provider_account_spec.rb
index 5a49146..81b8286 100644
--- a/src/spec/models/provider_account_spec.rb
+++ b/src/spec/models/provider_account_spec.rb
@@ -24,6 +24,7 @@ describe ProviderAccount do
it "should not be destroyable if it has instance with status other than stopped" do
@provider_account.instances << Instance.new
+ @provider_account.stub(:provider_images).and_return([])
lambda {(a)provider_account.destroy}.should
raise_error(Aeolus::Conductor::Base::NotDestroyable)
@provider_account.instances.each { |i| i.state = "stopped" }
@@ -35,6 +36,7 @@ describe ProviderAccount do
end
it "should be destroyable if it has a config server" do
+ @provider_account.stub(:provider_images).and_return([])
@provider_account.destroy.equal?((a)provider_account).should be_true
@provider_account.should be_frozen
end
--
1.7.11.2
11 years, 7 months