[katello-devel] changes in orchestration
Dmitri Dolguikh
dmitri at redhat.com
Tue May 31 10:02:05 UTC 2011
Hey all,
I introduced a minor change in how orchestration operates in
5b257f499567080cf4a2adcbc7f24e207eb84895. You can now find out for what
type of operation the orchestration is being performed for by calling
orchestration_for method. It will contain :create, :update, :destroy, or
a custom operation (:promote on Product, for example).
Example below shows how orchestration_for is used in
Glue::Candlepin::Product
case orchestration_for
when :create
queue.create(:name => "candlepin product: #{self.name}",
:priority => 3, :action => [self, :set_product])
queue.create(:name => "candlepin content: #{self.name}",
:priority => 4, :action => [self, :set_content])
queue.create(:name => "add content to product in candlepin:
#{self.name}", :priority => 5, :action => [self, :add_content])
# we create unlimited subscriptions for generic yum providers
if self.provider and self.provider.yum_repo?
queue.create(:name => "create unlimited subscription for
product in candlepin: #{self.name}", :priority => 7, :action => [self,
:create_unlimited_subscription])
end
when :update, :promote
queue.create(:name => "update candlepin product:
#{self.name}", :priority => 3, :action => [self, :update_content])
end
The standard :create, :update, :destroy are being set for you, but if
you need to run orchestration for a different operation, you can set it
via @orchestration_for instance variable, for example in
Glue::Pulp::Repos.promote:
def promote from_env, to_env
@orchestration_for = :promote
...
Please let me know if you any questions.
Cheers,
-d
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/katello-devel/attachments/20110531/208d087b/attachment.htm>
More information about the katello-devel
mailing list